From dffbbc8f1be5d21791d55f0096aa93b74fe5ef28 Mon Sep 17 00:00:00 2001 From: Forstride Date: Sun, 4 Aug 2019 08:53:48 -0400 Subject: [PATCH] Finished up Nether biomes, which now generate --- .../java/biomesoplenty/api/enums/BOPClimates.java | 8 ++++---- .../common/biome/nether/AshenInfernoBiome.java | 4 ++-- .../common/biome/nether/FungiForestBiome.java | 5 ++++- .../common/biome/nether/GlowstoneCavernBiome.java | 7 +++++-- .../common/biome/nether/UndergardenBiome.java | 3 +++ .../common/biome/nether/VisceralHeapBiome.java | 5 ++++- .../world/gen/feature/DeadCoralSpikesFeature.java | 5 ++++- .../world/gen/feature/GlowstoneSpikesFeature.java | 11 +++++++---- .../common/world/gen/feature/NetherWartFeature.java | 6 +++--- .../common/world/layer/GenLayerNetherBiome.java | 2 +- 10 files changed, 37 insertions(+), 19 deletions(-) diff --git a/src/main/java/biomesoplenty/api/enums/BOPClimates.java b/src/main/java/biomesoplenty/api/enums/BOPClimates.java index ecadb2cc0..a487518d3 100644 --- a/src/main/java/biomesoplenty/api/enums/BOPClimates.java +++ b/src/main/java/biomesoplenty/api/enums/BOPClimates.java @@ -31,7 +31,7 @@ public enum BOPClimates MEDITERRANEAN (BiomeType.WARM), SAVANNA (BiomeType.DESERT), HOT_DESERT (BiomeType.DESERT), - HELL (null); + NETHER (null); public final BiomeType biomeType; private int totalBiomesWeight; @@ -110,8 +110,7 @@ public enum BOPClimates static { - // set up vanilla biomes - + // Set up vanilla biomes BOPClimates.ICE_CAP.addBiome(10, Biomes.SNOWY_TUNDRA); BOPClimates.TUNDRA.addBiome(10, Biomes.SNOWY_TAIGA).addBiome(7, Biomes.MOUNTAINS); BOPClimates.WET_BOREAL.addBiome(10, Biomes.TAIGA); @@ -125,7 +124,8 @@ public enum BOPClimates BOPClimates.MEDITERRANEAN.addBiome(1, Biomes.PLAINS); BOPClimates.SAVANNA.addBiome(10, Biomes.SAVANNA); BOPClimates.HOT_DESERT.addBiome(15, Biomes.DESERT).addBiome(10, Biomes.BADLANDS_PLATEAU); - BOPClimates.HELL.addBiome(30, Biomes.NETHER); + + BOPClimates.NETHER.addBiome(10, Biomes.NETHER); } private static BOPClimates[] values = BOPClimates.values(); diff --git a/src/main/java/biomesoplenty/common/biome/nether/AshenInfernoBiome.java b/src/main/java/biomesoplenty/common/biome/nether/AshenInfernoBiome.java index 43b251c5e..815b2074e 100644 --- a/src/main/java/biomesoplenty/common/biome/nether/AshenInfernoBiome.java +++ b/src/main/java/biomesoplenty/common/biome/nether/AshenInfernoBiome.java @@ -33,7 +33,7 @@ public class AshenInfernoBiome extends NetherBiomeBOP this.addFeature(GenerationStage.Decoration.UNDERGROUND_DECORATION, createDecoratedFeature(Feature.NETHER_BRIDGE, IFeatureConfig.NO_FEATURE_CONFIG, Placement.NOPE, IPlacementConfig.NO_PLACEMENT_CONFIG)); this.addFeature(GenerationStage.Decoration.UNDERGROUND_DECORATION, createDecoratedFeature(Feature.NETHER_SPRING, new HellLavaConfig(false), Placement.COUNT_RANGE, new CountRangeConfig(24, 4, 8, 128))); - this.addFeature(GenerationStage.Decoration.UNDERGROUND_DECORATION, createDecoratedFeature(Feature.HELL_FIRE, IFeatureConfig.NO_FEATURE_CONFIG, Placement.HELL_FIRE, new FrequencyConfig(400))); + this.addFeature(GenerationStage.Decoration.UNDERGROUND_DECORATION, createDecoratedFeature(Feature.HELL_FIRE, IFeatureConfig.NO_FEATURE_CONFIG, Placement.HELL_FIRE, new FrequencyConfig(500))); this.addFeature(GenerationStage.Decoration.UNDERGROUND_DECORATION, createDecoratedFeature(BOPBiomeFeatures.ASH_SPLATTER, IFeatureConfig.NO_FEATURE_CONFIG, Placement.COUNT_HEIGHTMAP_DOUBLE, new FrequencyConfig(250))); @@ -48,6 +48,6 @@ public class AshenInfernoBiome extends NetherBiomeBOP this.addSpawn(EntityClassification.MONSTER, new SpawnListEntry(EntityType.MAGMA_CUBE, 20, 4, 4)); this.addSpawn(EntityClassification.MONSTER, new SpawnListEntry(EntityType.ENDERMAN, 1, 4, 4)); - this.addWeight(BOPClimates.HELL, 3); + this.addWeight(BOPClimates.NETHER, 5); } } diff --git a/src/main/java/biomesoplenty/common/biome/nether/FungiForestBiome.java b/src/main/java/biomesoplenty/common/biome/nether/FungiForestBiome.java index 9b0bdcf88..866340ba1 100644 --- a/src/main/java/biomesoplenty/common/biome/nether/FungiForestBiome.java +++ b/src/main/java/biomesoplenty/common/biome/nether/FungiForestBiome.java @@ -1,6 +1,7 @@ package biomesoplenty.common.biome.nether; import biomesoplenty.api.block.BOPBlocks; +import biomesoplenty.api.enums.BOPClimates; import biomesoplenty.common.biome.NetherBiomeBOP; import biomesoplenty.common.world.gen.feature.BOPBiomeFeatures; import net.minecraft.block.Blocks; @@ -39,7 +40,7 @@ public class FungiForestBiome extends NetherBiomeBOP this.addFeature(GenerationStage.Decoration.UNDERGROUND_DECORATION, createDecoratedFeature(BOPBiomeFeatures.HUGE_BROWN_MUSHROOM_NETHER, new BigMushroomFeatureConfig(false), Placement.COUNT_HEIGHTMAP_DOUBLE, new FrequencyConfig(75))); this.addFeature(GenerationStage.Decoration.UNDERGROUND_DECORATION, createDecoratedFeature(Feature.BUSH, new BushConfig(BOPBlocks.toadstool.getDefaultState()),Placement.COUNT_HEIGHTMAP_DOUBLE, new FrequencyConfig(7))); this.addFeature(GenerationStage.Decoration.UNDERGROUND_DECORATION, createDecoratedFeature(BOPBiomeFeatures.NETHERWART_BUBBLE, IFeatureConfig.NO_FEATURE_CONFIG, Placement.COUNT_HEIGHTMAP_DOUBLE, new FrequencyConfig(3))); - this.addFeature(GenerationStage.Decoration.UNDERGROUND_DECORATION, createDecoratedFeature(BOPBiomeFeatures.SCATTERED_NETHER_WART, IFeatureConfig.NO_FEATURE_CONFIG, Placement.COUNT_HEIGHTMAP_DOUBLE, new FrequencyConfig(2))); + this.addFeature(GenerationStage.Decoration.UNDERGROUND_DECORATION, createDecoratedFeature(BOPBiomeFeatures.SCATTERED_NETHER_WART, IFeatureConfig.NO_FEATURE_CONFIG, Placement.COUNT_HEIGHTMAP_DOUBLE, new FrequencyConfig(4))); //Base Decorations this.addFeature(GenerationStage.Decoration.UNDERGROUND_DECORATION, createDecoratedFeature(Feature.BUSH, new BushConfig(Blocks.BROWN_MUSHROOM.getDefaultState()), Placement.COUNT_HEIGHTMAP_DOUBLE, new FrequencyConfig(15))); @@ -53,5 +54,7 @@ public class FungiForestBiome extends NetherBiomeBOP this.addSpawn(EntityClassification.MONSTER, new SpawnListEntry(EntityType.ZOMBIE_PIGMAN, 100, 4, 4)); this.addSpawn(EntityClassification.MONSTER, new SpawnListEntry(EntityType.MAGMA_CUBE, 2, 4, 4)); this.addSpawn(EntityClassification.MONSTER, new SpawnListEntry(EntityType.ENDERMAN, 1, 4, 4)); + + this.addWeight(BOPClimates.NETHER, 7); } } diff --git a/src/main/java/biomesoplenty/common/biome/nether/GlowstoneCavernBiome.java b/src/main/java/biomesoplenty/common/biome/nether/GlowstoneCavernBiome.java index 0030da7b2..063ffbc52 100644 --- a/src/main/java/biomesoplenty/common/biome/nether/GlowstoneCavernBiome.java +++ b/src/main/java/biomesoplenty/common/biome/nether/GlowstoneCavernBiome.java @@ -1,6 +1,7 @@ package biomesoplenty.common.biome.nether; import biomesoplenty.api.block.BOPBlocks; +import biomesoplenty.api.enums.BOPClimates; import biomesoplenty.common.biome.NetherBiomeBOP; import biomesoplenty.common.world.gen.feature.BOPBiomeFeatures; import net.minecraft.block.Blocks; @@ -34,12 +35,12 @@ public class GlowstoneCavernBiome extends NetherBiomeBOP this.addFeature(GenerationStage.Decoration.UNDERGROUND_DECORATION, createDecoratedFeature(Feature.GLOWSTONE_BLOB, IFeatureConfig.NO_FEATURE_CONFIG, Placement.LIGHT_GEM_CHANCE, new FrequencyConfig(50))); this.addFeature(GenerationStage.Decoration.UNDERGROUND_DECORATION, createDecoratedFeature(Feature.GLOWSTONE_BLOB, IFeatureConfig.NO_FEATURE_CONFIG, Placement.COUNT_RANGE, new CountRangeConfig(50, 0, 0, 128))); - this.addFeature(GenerationStage.Decoration.UNDERGROUND_DECORATION, createDecoratedFeature(BOPBiomeFeatures.GLOWSTONE_SPIKES, IFeatureConfig.NO_FEATURE_CONFIG, Placement.COUNT_HEIGHTMAP_DOUBLE, new FrequencyConfig(7))); + this.addFeature(GenerationStage.Decoration.UNDERGROUND_DECORATION, createDecoratedFeature(BOPBiomeFeatures.GLOWSTONE_SPIKES, IFeatureConfig.NO_FEATURE_CONFIG, Placement.COUNT_HEIGHTMAP_DOUBLE, new FrequencyConfig(9))); //Base Decorations this.addFeature(GenerationStage.Decoration.UNDERGROUND_DECORATION, createDecoratedFeature(Feature.BUSH, new BushConfig(Blocks.BROWN_MUSHROOM.getDefaultState()), Placement.CHANCE_RANGE, new ChanceRangeConfig(0.25F, 0, 0, 128))); this.addFeature(GenerationStage.Decoration.UNDERGROUND_DECORATION, createDecoratedFeature(Feature.BUSH, new BushConfig(Blocks.RED_MUSHROOM.getDefaultState()), Placement.CHANCE_RANGE, new ChanceRangeConfig(0.25F, 0, 0, 128))); - this.addFeature(GenerationStage.Decoration.UNDERGROUND_DECORATION, createDecoratedFeature(Feature.ORE, new OreFeatureConfig(OreFeatureConfig.FillerBlockType.NETHERRACK, Blocks.NETHER_QUARTZ_ORE.getDefaultState(), 14), Placement.COUNT_RANGE, new CountRangeConfig(24, 10, 20, 128))); + this.addFeature(GenerationStage.Decoration.UNDERGROUND_DECORATION, createDecoratedFeature(Feature.ORE, new OreFeatureConfig(OreFeatureConfig.FillerBlockType.NETHERRACK, Blocks.NETHER_QUARTZ_ORE.getDefaultState(), 14), Placement.COUNT_RANGE, new CountRangeConfig(16, 10, 20, 128))); this.addFeature(GenerationStage.Decoration.UNDERGROUND_DECORATION, createDecoratedFeature(Feature.ORE, new OreFeatureConfig(OreFeatureConfig.FillerBlockType.NETHERRACK, Blocks.MAGMA_BLOCK.getDefaultState(), 33), Placement.MAGMA, new FrequencyConfig(4))); this.addFeature(GenerationStage.Decoration.UNDERGROUND_DECORATION, createDecoratedFeature(Feature.NETHER_SPRING, new HellLavaConfig(true), Placement.COUNT_RANGE, new CountRangeConfig(16, 10, 20, 128))); @@ -48,5 +49,7 @@ public class GlowstoneCavernBiome extends NetherBiomeBOP this.addSpawn(EntityClassification.MONSTER, new SpawnListEntry(EntityType.ZOMBIE_PIGMAN, 50, 4, 4)); this.addSpawn(EntityClassification.MONSTER, new SpawnListEntry(EntityType.MAGMA_CUBE, 2, 4, 4)); this.addSpawn(EntityClassification.MONSTER, new SpawnListEntry(EntityType.ENDERMAN, 1, 4, 4)); + + this.addWeight(BOPClimates.NETHER, 3); } } diff --git a/src/main/java/biomesoplenty/common/biome/nether/UndergardenBiome.java b/src/main/java/biomesoplenty/common/biome/nether/UndergardenBiome.java index 245071ff9..58539f45b 100644 --- a/src/main/java/biomesoplenty/common/biome/nether/UndergardenBiome.java +++ b/src/main/java/biomesoplenty/common/biome/nether/UndergardenBiome.java @@ -1,6 +1,7 @@ package biomesoplenty.common.biome.nether; import biomesoplenty.api.block.BOPBlocks; +import biomesoplenty.api.enums.BOPClimates; import biomesoplenty.common.biome.NetherBiomeBOP; import biomesoplenty.common.world.gen.feature.BOPBiomeFeatures; import net.minecraft.block.Blocks; @@ -54,5 +55,7 @@ public class UndergardenBiome extends NetherBiomeBOP this.addSpawn(EntityClassification.MONSTER, new Biome.SpawnListEntry(EntityType.ZOMBIE_PIGMAN, 100, 4, 4)); this.addSpawn(EntityClassification.MONSTER, new Biome.SpawnListEntry(EntityType.MAGMA_CUBE, 2, 4, 4)); this.addSpawn(EntityClassification.MONSTER, new Biome.SpawnListEntry(EntityType.ENDERMAN, 1, 4, 4)); + + this.addWeight(BOPClimates.NETHER, 7); } } diff --git a/src/main/java/biomesoplenty/common/biome/nether/VisceralHeapBiome.java b/src/main/java/biomesoplenty/common/biome/nether/VisceralHeapBiome.java index 3d7916692..213d19e1e 100644 --- a/src/main/java/biomesoplenty/common/biome/nether/VisceralHeapBiome.java +++ b/src/main/java/biomesoplenty/common/biome/nether/VisceralHeapBiome.java @@ -1,6 +1,7 @@ package biomesoplenty.common.biome.nether; import biomesoplenty.api.block.BOPBlocks; +import biomesoplenty.api.enums.BOPClimates; import biomesoplenty.common.biome.NetherBiomeBOP; import biomesoplenty.common.world.gen.feature.BOPBiomeFeatures; import net.minecraft.block.Blocks; @@ -35,7 +36,7 @@ public class VisceralHeapBiome extends NetherBiomeBOP this.addFeature(GenerationStage.Decoration.UNDERGROUND_DECORATION, createDecoratedFeature(Feature.GLOWSTONE_BLOB, IFeatureConfig.NO_FEATURE_CONFIG, Placement.COUNT_RANGE, new CountRangeConfig(7, 0, 0, 128))); this.addFeature(GenerationStage.Decoration.UNDERGROUND_DECORATION, createDecoratedFeature(BOPBiomeFeatures.FLESH_SPLATTER, IFeatureConfig.NO_FEATURE_CONFIG, Placement.COUNT_HEIGHTMAP_DOUBLE, new FrequencyConfig(500))); - this.addFeature(GenerationStage.Decoration.UNDERGROUND_DECORATION, createDecoratedFeature(BOPBiomeFeatures.BONE_SPINE, IFeatureConfig.NO_FEATURE_CONFIG, Placement.COUNT_HEIGHTMAP_DOUBLE, new FrequencyConfig(15))); + this.addFeature(GenerationStage.Decoration.UNDERGROUND_DECORATION, createDecoratedFeature(BOPBiomeFeatures.BONE_SPINE, IFeatureConfig.NO_FEATURE_CONFIG, Placement.COUNT_HEIGHTMAP_DOUBLE, new FrequencyConfig(17))); //Base Decorations this.addFeature(GenerationStage.Decoration.UNDERGROUND_DECORATION, createDecoratedFeature(Feature.BUSH, new BushConfig(Blocks.BROWN_MUSHROOM.getDefaultState()), Placement.CHANCE_RANGE, new ChanceRangeConfig(0.1F, 0, 0, 128))); @@ -49,5 +50,7 @@ public class VisceralHeapBiome extends NetherBiomeBOP this.addSpawn(EntityClassification.MONSTER, new SpawnListEntry(EntityType.ZOMBIE_PIGMAN, 100, 4, 4)); this.addSpawn(EntityClassification.MONSTER, new SpawnListEntry(EntityType.MAGMA_CUBE, 2, 4, 4)); this.addSpawn(EntityClassification.MONSTER, new SpawnListEntry(EntityType.ENDERMAN, 1, 4, 4)); + + this.addWeight(BOPClimates.NETHER, 7); } } diff --git a/src/main/java/biomesoplenty/common/world/gen/feature/DeadCoralSpikesFeature.java b/src/main/java/biomesoplenty/common/world/gen/feature/DeadCoralSpikesFeature.java index e13dfd91f..620d145c2 100644 --- a/src/main/java/biomesoplenty/common/world/gen/feature/DeadCoralSpikesFeature.java +++ b/src/main/java/biomesoplenty/common/world/gen/feature/DeadCoralSpikesFeature.java @@ -91,7 +91,10 @@ public class DeadCoralSpikesFeature extends Feature { for (int z = radiusStart; z <= radiusEnd; z++) { - this.setBlockState(world, pos.add(x, y, z), block); + if (this.replace.matches(world, pos.add(x, y, z))) + { + this.setBlockState(world, pos.add(x, y, z), block); + } } } } diff --git a/src/main/java/biomesoplenty/common/world/gen/feature/GlowstoneSpikesFeature.java b/src/main/java/biomesoplenty/common/world/gen/feature/GlowstoneSpikesFeature.java index 82ad6e2b3..c2c877e81 100644 --- a/src/main/java/biomesoplenty/common/world/gen/feature/GlowstoneSpikesFeature.java +++ b/src/main/java/biomesoplenty/common/world/gen/feature/GlowstoneSpikesFeature.java @@ -20,9 +20,9 @@ public class GlowstoneSpikesFeature extends Feature protected IBlockPosQuery placeOn = (world, pos) -> world.getBlockState(pos).getBlock() == Blocks.NETHERRACK; protected IBlockPosQuery replace = (world, pos) -> world.getBlockState(pos).isAir(world, pos); int minRadius = 2; - int maxRadius = 4; - int minHeight = 5; - int maxHeight = 13; + int maxRadius = 3; + int minHeight = 4; + int maxHeight = 11; public GlowstoneSpikesFeature(Function, ? extends NoFeatureConfig> deserializer) { @@ -61,7 +61,10 @@ public class GlowstoneSpikesFeature extends Feature { for (int z = radiusStart; z <= radiusEnd; z++) { - world.setBlockState(pos.add(x, y, z), Blocks.GLOWSTONE.getDefaultState(), 2); + if (this.replace.matches(world, pos.add(x, y, z))) + { + world.setBlockState(pos.add(x, y, z), Blocks.GLOWSTONE.getDefaultState(), 2); + } } } } diff --git a/src/main/java/biomesoplenty/common/world/gen/feature/NetherWartFeature.java b/src/main/java/biomesoplenty/common/world/gen/feature/NetherWartFeature.java index ff2277400..85bbac6f2 100644 --- a/src/main/java/biomesoplenty/common/world/gen/feature/NetherWartFeature.java +++ b/src/main/java/biomesoplenty/common/world/gen/feature/NetherWartFeature.java @@ -27,10 +27,10 @@ public class NetherWartFeature extends Feature { int i = 0; - for(int j = 0; j < 16; ++j) + for(int j = 0; j < 64; ++j) { - BlockPos blockpos = p_212245_4_.add(p_212245_3_.nextInt(8) - p_212245_3_.nextInt(8), p_212245_3_.nextInt(4) - p_212245_3_.nextInt(4), p_212245_3_.nextInt(8) - p_212245_3_.nextInt(8)); - if (p_212245_1_.getBlockState(blockpos).isAir(p_212245_1_, blockpos) && p_212245_1_.getBlockState(blockpos.down()).getBlock() == Blocks.NETHERRACK) + BlockPos blockpos = p_212245_4_.add(p_212245_3_.nextInt(4) - p_212245_3_.nextInt(4), p_212245_3_.nextInt(4) - p_212245_3_.nextInt(4), p_212245_3_.nextInt(4) - p_212245_3_.nextInt(4)); + if (p_212245_1_.getBlockState(blockpos).isAir(p_212245_1_, blockpos) && p_212245_1_.getBlockState(blockpos.down()).getBlock() == Blocks.NETHERRACK && p_212245_1_.getBlockState(blockpos.down().east()).getBlock() == Blocks.NETHERRACK && p_212245_1_.getBlockState(blockpos.down().west()).getBlock() == Blocks.NETHERRACK && p_212245_1_.getBlockState(blockpos.down().north()).getBlock() == Blocks.NETHERRACK && p_212245_1_.getBlockState(blockpos.down().south()).getBlock() == Blocks.NETHERRACK) { p_212245_1_.setBlockState(blockpos.down(), Blocks.SOUL_SAND.getDefaultState(), 2); p_212245_1_.setBlockState(blockpos, Blocks.NETHER_WART.getDefaultState().with(NetherWartBlock.AGE, p_212245_3_.nextInt(4)), 2); diff --git a/src/main/java/biomesoplenty/common/world/layer/GenLayerNetherBiome.java b/src/main/java/biomesoplenty/common/world/layer/GenLayerNetherBiome.java index 96923ca15..2d6b32bbf 100644 --- a/src/main/java/biomesoplenty/common/world/layer/GenLayerNetherBiome.java +++ b/src/main/java/biomesoplenty/common/world/layer/GenLayerNetherBiome.java @@ -26,6 +26,6 @@ public enum GenLayerNetherBiome implements IAreaTransformer0, IDimOffset0Transfo @Override public int apply(INoiseRandom context, int x, int z) { - return Registry.BIOME.getId(BOPClimates.HELL.getRandomBiome(context, Biomes.NETHER)); + return Registry.BIOME.getId(BOPClimates.NETHER.getRandomBiome(context, Biomes.NETHER)); } }