From ec0977da4dd0d83ac26a2c0748d41dad44e28f3b Mon Sep 17 00:00:00 2001 From: Forstride Date: Sun, 4 Aug 2019 00:26:18 -0400 Subject: [PATCH] More work on Nether biomes, tweaks to the Tundra and Bog biomes --- .../biomesoplenty/api/biome/BOPBiomes.java | 2 + .../biome/nether/InfernalAshlandsBiome.java | 50 ++++++++ .../biome/nether/VisceralHeapBiome.java | 54 +++++++++ .../common/biome/overworld/BogBiome.java | 2 +- .../common/biome/overworld/TundraBiome.java | 1 + .../biomesoplenty/common/block/AshBlock.java | 6 - .../common/block/BrambleBlock.java | 11 +- .../common/block/FleshBlock.java | 2 +- .../common/world/WorldTypeBOP.java | 2 +- .../world/gen/feature/AshSplatterFeature.java | 56 +++++++++ .../world/gen/feature/BOPBiomeFeatures.java | 10 +- .../world/gen/feature/BoneSpineFeature.java | 110 ++++++++++++++++++ .../gen/feature/FleshSplatterFeature.java | 57 +++++++++ .../gen/feature/ScatteredRocksFeature.java | 50 ++++++++ .../java/biomesoplenty/init/ModBiomes.java | 6 + .../java/biomesoplenty/init/ModBlocks.java | 2 +- .../assets/biomesoplenty/lang/en_us.json | 2 + 17 files changed, 408 insertions(+), 15 deletions(-) create mode 100644 src/main/java/biomesoplenty/common/biome/nether/InfernalAshlandsBiome.java create mode 100644 src/main/java/biomesoplenty/common/biome/nether/VisceralHeapBiome.java create mode 100644 src/main/java/biomesoplenty/common/world/gen/feature/AshSplatterFeature.java create mode 100644 src/main/java/biomesoplenty/common/world/gen/feature/BoneSpineFeature.java create mode 100644 src/main/java/biomesoplenty/common/world/gen/feature/FleshSplatterFeature.java create mode 100644 src/main/java/biomesoplenty/common/world/gen/feature/ScatteredRocksFeature.java diff --git a/src/main/java/biomesoplenty/api/biome/BOPBiomes.java b/src/main/java/biomesoplenty/api/biome/BOPBiomes.java index b3d97f539..b0da99ce8 100644 --- a/src/main/java/biomesoplenty/api/biome/BOPBiomes.java +++ b/src/main/java/biomesoplenty/api/biome/BOPBiomes.java @@ -74,7 +74,9 @@ public class BOPBiomes public static Optional woodland = Optional.empty(); public static Optional xeric_shrubland = Optional.empty(); + public static Optional infernal_ashlands = Optional.empty(); public static Optional undergarden = Optional.empty(); + public static Optional visceral_heap = Optional.empty(); public static Optional coral_deadlands = Optional.empty(); public static Optional ethereal_garden = Optional.empty(); diff --git a/src/main/java/biomesoplenty/common/biome/nether/InfernalAshlandsBiome.java b/src/main/java/biomesoplenty/common/biome/nether/InfernalAshlandsBiome.java new file mode 100644 index 000000000..ad118c7f1 --- /dev/null +++ b/src/main/java/biomesoplenty/common/biome/nether/InfernalAshlandsBiome.java @@ -0,0 +1,50 @@ +package biomesoplenty.common.biome.nether; + +import biomesoplenty.api.block.BOPBlocks; +import biomesoplenty.common.biome.NetherBiomeBOP; +import biomesoplenty.common.world.gen.feature.BOPBiomeFeatures; +import biomesoplenty.common.world.gen.feature.SplotchConfig; +import com.google.common.collect.Lists; +import net.minecraft.block.Blocks; +import net.minecraft.entity.EntityClassification; +import net.minecraft.entity.EntityType; +import net.minecraft.fluid.Fluids; +import net.minecraft.world.biome.Biome; +import net.minecraft.world.biome.DefaultBiomeFeatures; +import net.minecraft.world.gen.GenerationStage; +import net.minecraft.world.gen.carver.WorldCarver; +import net.minecraft.world.gen.feature.*; +import net.minecraft.world.gen.placement.*; +import net.minecraft.world.gen.surfacebuilders.SurfaceBuilder; + +public class InfernalAshlandsBiome extends NetherBiomeBOP +{ + public InfernalAshlandsBiome() + { + super((new Builder()).surfaceBuilder(SurfaceBuilder.NETHER, SurfaceBuilder.NETHERRACK_CONFIG).precipitation(RainType.NONE).category(Category.NETHER).depth(0.1F).scale(0.2F).temperature(2.0F).downfall(0.0F).waterColor(4159204).waterFogColor(329011).parent((String)null)); + + //Terrain + this.addStructure(Feature.NETHER_BRIDGE, IFeatureConfig.NO_FEATURE_CONFIG); + this.addCarver(GenerationStage.Carving.AIR, createCarver(WorldCarver.HELL_CAVE, new ProbabilityConfig(0.2F))); + this.addFeature(GenerationStage.Decoration.VEGETAL_DECORATION, createDecoratedFeature(Feature.SPRING_FEATURE, new LiquidsConfig(Fluids.LAVA.getDefaultState()), Placement.COUNT_VERY_BIASED_RANGE, new CountRangeConfig(20, 8, 16, 256))); + + DefaultBiomeFeatures.addMushrooms(this); + + 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(BOPBiomeFeatures.ASH_SPLATTER, IFeatureConfig.NO_FEATURE_CONFIG, Placement.COUNT_HEIGHTMAP_DOUBLE, new FrequencyConfig(250))); + + //Base Decorations + 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(10))); + this.addFeature(GenerationStage.Decoration.UNDERGROUND_DECORATION, createDecoratedFeature(Feature.NETHER_SPRING, new HellLavaConfig(true), Placement.COUNT_RANGE, new CountRangeConfig(16, 10, 20, 128))); + + //Entities + this.addSpawn(EntityClassification.MONSTER, new SpawnListEntry(EntityType.GHAST, 50, 4, 4)); + 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)); + } +} diff --git a/src/main/java/biomesoplenty/common/biome/nether/VisceralHeapBiome.java b/src/main/java/biomesoplenty/common/biome/nether/VisceralHeapBiome.java new file mode 100644 index 000000000..08ed54034 --- /dev/null +++ b/src/main/java/biomesoplenty/common/biome/nether/VisceralHeapBiome.java @@ -0,0 +1,54 @@ +package biomesoplenty.common.biome.nether; + +import biomesoplenty.api.block.BOPBlocks; +import biomesoplenty.common.biome.NetherBiomeBOP; +import biomesoplenty.common.world.gen.feature.BOPBiomeFeatures; +import net.minecraft.block.Blocks; +import net.minecraft.entity.EntityClassification; +import net.minecraft.entity.EntityType; +import net.minecraft.fluid.Fluids; +import net.minecraft.world.biome.Biome; +import net.minecraft.world.biome.DefaultBiomeFeatures; +import net.minecraft.world.gen.GenerationStage; +import net.minecraft.world.gen.carver.WorldCarver; +import net.minecraft.world.gen.feature.*; +import net.minecraft.world.gen.placement.*; +import net.minecraft.world.gen.surfacebuilders.SurfaceBuilder; + +public class VisceralHeapBiome extends NetherBiomeBOP +{ + public VisceralHeapBiome() + { + super((new Builder()).surfaceBuilder(SurfaceBuilder.NETHER, SurfaceBuilder.NETHERRACK_CONFIG).precipitation(RainType.NONE).category(Category.NETHER).depth(0.1F).scale(0.2F).temperature(2.0F).downfall(0.0F).waterColor(4159204).waterFogColor(329011).parent((String)null)); + + //Terrain + this.addStructure(Feature.NETHER_BRIDGE, IFeatureConfig.NO_FEATURE_CONFIG); + this.addCarver(GenerationStage.Carving.AIR, createCarver(WorldCarver.HELL_CAVE, new ProbabilityConfig(0.2F))); + this.addFeature(GenerationStage.Decoration.VEGETAL_DECORATION, createDecoratedFeature(Feature.SPRING_FEATURE, new LiquidsConfig(Fluids.LAVA.getDefaultState()), Placement.COUNT_VERY_BIASED_RANGE, new CountRangeConfig(20, 8, 16, 256))); + + DefaultBiomeFeatures.addMushrooms(this); + + 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(4, 4, 8, 128))); + this.addFeature(GenerationStage.Decoration.UNDERGROUND_DECORATION, createDecoratedFeature(Feature.HELL_FIRE, IFeatureConfig.NO_FEATURE_CONFIG, Placement.HELL_FIRE, new FrequencyConfig(7))); + this.addFeature(GenerationStage.Decoration.UNDERGROUND_DECORATION, createDecoratedFeature(Feature.GLOWSTONE_BLOB, IFeatureConfig.NO_FEATURE_CONFIG, Placement.LIGHT_GEM_CHANCE, new FrequencyConfig(7))); + 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(20))); + this.addFeature(GenerationStage.Decoration.UNDERGROUND_DECORATION, createDecoratedFeature(BOPBiomeFeatures.NETHERWART_BUBBLE, IFeatureConfig.NO_FEATURE_CONFIG, Placement.COUNT_HEIGHTMAP_DOUBLE, new FrequencyConfig(5))); + + //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))); + this.addFeature(GenerationStage.Decoration.UNDERGROUND_DECORATION, createDecoratedFeature(Feature.BUSH, new BushConfig(Blocks.RED_MUSHROOM.getDefaultState()), Placement.CHANCE_RANGE, new ChanceRangeConfig(0.1F, 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(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(2))); + this.addFeature(GenerationStage.Decoration.UNDERGROUND_DECORATION, createDecoratedFeature(Feature.NETHER_SPRING, new HellLavaConfig(true), Placement.COUNT_RANGE, new CountRangeConfig(8, 10, 20, 128))); + + //Entities + this.addSpawn(EntityClassification.MONSTER, new SpawnListEntry(EntityType.GHAST, 50, 4, 4)); + 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)); + } +} diff --git a/src/main/java/biomesoplenty/common/biome/overworld/BogBiome.java b/src/main/java/biomesoplenty/common/biome/overworld/BogBiome.java index 76ba56a0c..df950b34d 100644 --- a/src/main/java/biomesoplenty/common/biome/overworld/BogBiome.java +++ b/src/main/java/biomesoplenty/common/biome/overworld/BogBiome.java @@ -57,7 +57,7 @@ public class BogBiome extends BiomeBOP //////////////////////////////////////////////////////////// // Vegetation - this.addFeature(GenerationStage.Decoration.VEGETAL_DECORATION, Biome.createDecoratedFeature(Feature.RANDOM_SELECTOR, new MultipleRandomFeatureConfig(new Feature[]{BOPBiomeFeatures.SPRUCE_TWIGLET_TREE, BOPBiomeFeatures.MAPLE_TWIGLET_TREE}, new IFeatureConfig[]{IFeatureConfig.NO_FEATURE_CONFIG, IFeatureConfig.NO_FEATURE_CONFIG}, new float[]{0.2F, 0.4F}, BOPBiomeFeatures.TWIGLET_TREE, IFeatureConfig.NO_FEATURE_CONFIG), Placement.COUNT_EXTRA_HEIGHTMAP, new AtSurfaceWithExtraConfig(5, 0.3F, 1))); + this.addFeature(GenerationStage.Decoration.VEGETAL_DECORATION, Biome.createDecoratedFeature(Feature.RANDOM_SELECTOR, new MultipleRandomFeatureConfig(new Feature[]{BOPBiomeFeatures.SPRUCE_TWIGLET_TREE, BOPBiomeFeatures.MAPLE_TWIGLET_TREE, Feature.PINE_TREE}, new IFeatureConfig[]{IFeatureConfig.NO_FEATURE_CONFIG, IFeatureConfig.NO_FEATURE_CONFIG, IFeatureConfig.NO_FEATURE_CONFIG}, new float[]{0.4F, 0.6F, 0.1F}, BOPBiomeFeatures.TWIGLET_TREE, IFeatureConfig.NO_FEATURE_CONFIG), Placement.COUNT_EXTRA_HEIGHTMAP, new AtSurfaceWithExtraConfig(5, 0.4F, 1))); this.addFeature(GenerationStage.Decoration.VEGETAL_DECORATION, Biome.createDecoratedFeature(new StandardGrassFeature(NoFeatureConfig::deserialize), IFeatureConfig.NO_FEATURE_CONFIG, Placement.COUNT_HEIGHTMAP_DOUBLE, new FrequencyConfig(8))); this.addFeature(GenerationStage.Decoration.VEGETAL_DECORATION, Biome.createDecoratedFeature(Feature.SWEET_BERRY_BUSH, IFeatureConfig.NO_FEATURE_CONFIG, Placement.COUNT_HEIGHTMAP_DOUBLE, new FrequencyConfig(50))); this.addFeature(GenerationStage.Decoration.VEGETAL_DECORATION, Biome.createDecoratedFeature(Feature.BUSH, new BushConfig(BOPBlocks.reed.getDefaultState()), Placement.COUNT_HEIGHTMAP_DOUBLE, new FrequencyConfig(35))); diff --git a/src/main/java/biomesoplenty/common/biome/overworld/TundraBiome.java b/src/main/java/biomesoplenty/common/biome/overworld/TundraBiome.java index 6cb9b8860..9a91adc7d 100644 --- a/src/main/java/biomesoplenty/common/biome/overworld/TundraBiome.java +++ b/src/main/java/biomesoplenty/common/biome/overworld/TundraBiome.java @@ -60,6 +60,7 @@ public class TundraBiome extends BiomeBOP // Vegetation this.addFeature(GenerationStage.Decoration.LOCAL_MODIFICATIONS, Biome.createDecoratedFeature(Feature.FOREST_ROCK, new BlockBlobConfig(Blocks.COBBLESTONE.getDefaultState(), 0), Placement.FOREST_ROCK, new FrequencyConfig(1))); + this.addFeature(GenerationStage.Decoration.VEGETAL_DECORATION, Biome.createDecoratedFeature(BOPBiomeFeatures.SCATTERED_ROCKS, IFeatureConfig.NO_FEATURE_CONFIG, Placement.COUNT_HEIGHTMAP_DOUBLE, new FrequencyConfig(5))); this.addFeature(GenerationStage.Decoration.VEGETAL_DECORATION, Biome.createDecoratedFeature(Feature.RANDOM_SELECTOR, new MultipleRandomFeatureConfig(new Feature[]{BOPBiomeFeatures.DEAD_TWIGLET_TREE}, new IFeatureConfig[]{IFeatureConfig.NO_FEATURE_CONFIG}, new float[]{0.1F}, BOPBiomeFeatures.MAPLE_TWIGLET_TREE, IFeatureConfig.NO_FEATURE_CONFIG), Placement.COUNT_EXTRA_HEIGHTMAP, new AtSurfaceWithExtraConfig(1, 0.3F, 1))); this.addFeature(GenerationStage.Decoration.VEGETAL_DECORATION, Biome.createDecoratedFeature(new StandardGrassFeature(NoFeatureConfig::deserialize), IFeatureConfig.NO_FEATURE_CONFIG, Placement.COUNT_HEIGHTMAP_DOUBLE, new FrequencyConfig(4))); this.addFeature(GenerationStage.Decoration.VEGETAL_DECORATION, Biome.createDecoratedFeature(Feature.BUSH, new BushConfig(BOPBlocks.reed.getDefaultState()), Placement.COUNT_HEIGHTMAP_DOUBLE, new FrequencyConfig(4))); diff --git a/src/main/java/biomesoplenty/common/block/AshBlock.java b/src/main/java/biomesoplenty/common/block/AshBlock.java index e94eba2cc..9732ee7f5 100644 --- a/src/main/java/biomesoplenty/common/block/AshBlock.java +++ b/src/main/java/biomesoplenty/common/block/AshBlock.java @@ -35,12 +35,6 @@ public class AshBlock extends Block { return SHAPE; } - - @Override - public void onEntityCollision(BlockState state, World worldIn, BlockPos pos, Entity entityIn) - { - entityIn.setMotion(entityIn.getMotion().mul(0.75D, 1.0D, 0.75D)); - } @Override @OnlyIn(Dist.CLIENT) diff --git a/src/main/java/biomesoplenty/common/block/BrambleBlock.java b/src/main/java/biomesoplenty/common/block/BrambleBlock.java index 52579ae6e..f869a8e7b 100644 --- a/src/main/java/biomesoplenty/common/block/BrambleBlock.java +++ b/src/main/java/biomesoplenty/common/block/BrambleBlock.java @@ -11,6 +11,8 @@ import net.minecraft.block.Block; import net.minecraft.block.BlockState; import net.minecraft.block.SixWayBlock; import net.minecraft.entity.Entity; +import net.minecraft.entity.LivingEntity; +import net.minecraft.entity.player.PlayerEntity; import net.minecraft.item.BlockItemUseContext; import net.minecraft.pathfinding.PathType; import net.minecraft.state.StateContainer; @@ -62,8 +64,13 @@ public class BrambleBlock extends SixWayBlock } @Override - public void onEntityCollision(BlockState state, World worldIn, BlockPos pos, Entity entityIn) { - entityIn.attackEntityFrom(DamageSource.CACTUS, 1.0F); + public void onEntityCollision(BlockState state, World worldIn, BlockPos pos, Entity entityIn) + { + if (entityIn instanceof PlayerEntity) + { + PlayerEntity playerEntity = (PlayerEntity) entityIn; + playerEntity.attackEntityFrom(DamageSource.CACTUS, 1.0F); + } } @Override diff --git a/src/main/java/biomesoplenty/common/block/FleshBlock.java b/src/main/java/biomesoplenty/common/block/FleshBlock.java index e33edb080..6cdf63d3a 100644 --- a/src/main/java/biomesoplenty/common/block/FleshBlock.java +++ b/src/main/java/biomesoplenty/common/block/FleshBlock.java @@ -34,6 +34,6 @@ public class FleshBlock extends Block @Override public void onEntityCollision(BlockState state, World worldIn, BlockPos pos, Entity entityIn) { - entityIn.setMotion(entityIn.getMotion().mul(0.9D, 1.0D, 0.9D)); + entityIn.setMotion(entityIn.getMotion().mul(0.95D, 1.0D, 0.95D)); } } diff --git a/src/main/java/biomesoplenty/common/world/WorldTypeBOP.java b/src/main/java/biomesoplenty/common/world/WorldTypeBOP.java index 2f90b4f85..64aa49479 100644 --- a/src/main/java/biomesoplenty/common/world/WorldTypeBOP.java +++ b/src/main/java/biomesoplenty/common/world/WorldTypeBOP.java @@ -43,7 +43,7 @@ public class WorldTypeBOP extends WorldType NetherGenSettings nethergensettings = ChunkGeneratorType.CAVES.createSettings(); nethergensettings.setDefaultBlock(Blocks.NETHERRACK.getDefaultState()); nethergensettings.setDefaultFluid(Blocks.LAVA.getDefaultState()); - return ChunkGeneratorType.CAVES.create(world, BiomeProviderType.FIXED.create(BiomeProviderType.FIXED.createSettings().setBiome(BOPBiomes.undergarden.get())), nethergensettings); + return ChunkGeneratorType.CAVES.create(world, BiomeProviderType.FIXED.create(BiomeProviderType.FIXED.createSettings().setBiome(BOPBiomes.visceral_heap.get())), nethergensettings); } else if (world.getDimension().getType() == DimensionType.THE_END) { diff --git a/src/main/java/biomesoplenty/common/world/gen/feature/AshSplatterFeature.java b/src/main/java/biomesoplenty/common/world/gen/feature/AshSplatterFeature.java new file mode 100644 index 000000000..e4cd2dfb7 --- /dev/null +++ b/src/main/java/biomesoplenty/common/world/gen/feature/AshSplatterFeature.java @@ -0,0 +1,56 @@ +package biomesoplenty.common.world.gen.feature; + +import biomesoplenty.api.block.BOPBlocks; +import com.mojang.datafixers.Dynamic; +import net.minecraft.block.BlockState; +import net.minecraft.block.Blocks; +import net.minecraft.tags.FluidTags; +import net.minecraft.util.math.BlockPos; +import net.minecraft.world.IWorld; +import net.minecraft.world.gen.ChunkGenerator; +import net.minecraft.world.gen.GenerationSettings; +import net.minecraft.world.gen.feature.Feature; +import net.minecraft.world.gen.feature.NoFeatureConfig; + +import java.util.Random; +import java.util.function.Function; + +public class AshSplatterFeature extends Feature { + public AshSplatterFeature(Function, ? extends NoFeatureConfig> deserializer) { + super(deserializer); + } + + @Override + public boolean place(IWorld worldIn, ChunkGenerator p_212245_2_, Random rand, BlockPos pos, NoFeatureConfig config) + { + int i = 0; + int j = rand.nextInt(8 - 2) + 2; + + for (int k = pos.getX() - j; k <= pos.getX() + j; ++k) + { + for (int l = pos.getZ() - j; l <= pos.getZ() + j; ++l) + { + int i1 = k - pos.getX(); + int j1 = l - pos.getZ(); + if (i1 * i1 + j1 * j1 <= j * j) + { + for (int k1 = pos.getY() - 2; k1 <= pos.getY() + 2; ++k1) + { + BlockPos blockpos = new BlockPos(k, k1, l); + BlockState blockstate = worldIn.getBlockState(blockpos); + BlockState blockstate1 = worldIn.getBlockState(blockpos.up()); + + if (blockstate.getBlock() == Blocks.NETHERRACK && blockstate1.isAir(worldIn, blockpos.up())) + { + worldIn.setBlockState(blockpos, BOPBlocks.ash_block.getDefaultState(), 2); + ++i; + break; + } + } + } + } + } + + return i > 0; + } +} \ No newline at end of file diff --git a/src/main/java/biomesoplenty/common/world/gen/feature/BOPBiomeFeatures.java b/src/main/java/biomesoplenty/common/world/gen/feature/BOPBiomeFeatures.java index 2cd2e0f6a..a444ec9d5 100644 --- a/src/main/java/biomesoplenty/common/world/gen/feature/BOPBiomeFeatures.java +++ b/src/main/java/biomesoplenty/common/world/gen/feature/BOPBiomeFeatures.java @@ -35,7 +35,6 @@ public class BOPBiomeFeatures public static final AbstractTreeFeature SILK_TREE = new BasicTreeFeature.Builder().log(BOPBlocks.dead_log.getDefaultState()).leaves(BOPBlocks.dead_leaves.getDefaultState()).altLeaves(Blocks.COBWEB.getDefaultState()).create(); public static final AbstractTreeFeature FULL_SILK_TREE = new BasicTreeFeature.Builder().log(BOPBlocks.dead_log.getDefaultState()).leaves(Blocks.COBWEB.getDefaultState()).create(); public static final AbstractTreeFeature MAGIC_TREE = new BasicTreeFeature.Builder().log(BOPBlocks.magic_log.getDefaultState()).leaves(BOPBlocks.magic_leaves.getDefaultState()).create(); - //Big Trees public static final AbstractTreeFeature BIG_OAK_TREE = new BigTreeFeature.Builder().create(); @@ -117,10 +116,15 @@ public class BOPBiomeFeatures public static final Feature SHORT_BAMBOO = new ShortBambooFeature(NoFeatureConfig::deserialize); public static final Feature SCRUB = new ScrubFeature(NoFeatureConfig::deserialize); public static final Feature HEATH = new HeathFeature(NoFeatureConfig::deserialize); + public static final Feature SCATTERED_ROCKS = new ScatteredRocksFeature(NoFeatureConfig::deserialize); public static final Feature DEAD_CORAL_SPLATTER = new DeadCoralSplatterFeature(NoFeatureConfig::deserialize); public static final Feature DEAD_CORAL_SPIKES = new DeadCoralSpikesFeature(NoFeatureConfig::deserialize); public static final Feature NETHER_VINES = new NetherVinesFeature(NoFeatureConfig::deserialize); - + public static final Feature FLESH_SPLATTER = new FleshSplatterFeature(NoFeatureConfig::deserialize); + public static final Feature BONE_SPINE = new BoneSpineFeature(NoFeatureConfig::deserialize); + public static final AbstractTreeFeature NETHERWART_BUBBLE = new BushTreeFeature.Builder().placeOn((world, pos) -> world.getBlockState(pos).getBlock() == BOPBlocks.flesh).log(Blocks.NETHER_WART_BLOCK.getDefaultState()).leaves(Blocks.NETHER_WART_BLOCK.getDefaultState()).maxHeight(2).create(); + public static final Feature ASH_SPLATTER = new AshSplatterFeature(NoFeatureConfig::deserialize); + //Flowers public static final FlowersFeature CHAPARRAL_FLOWERS = new ChaparralFlowersFeature(NoFeatureConfig::deserialize); public static final FlowersFeature CHERRY_BLOSSOM_GROVE_FLOWERS = new CherryBlossomGroveFlowersFeature(NoFeatureConfig::deserialize); @@ -157,7 +161,7 @@ public class BOPBiomeFeatures public static final SurfaceBuilder PODZOL_SURFACE_BUILDER = new PodzolSurfaceBuilder(SurfaceBuilderConfig::deserialize); public static final SurfaceBuilder VOLCANO_SURFACE_BUILDER = new VolcanoSurfaceBuilder(SurfaceBuilderConfig::deserialize); public static final SurfaceBuilder VOLCANO_EDGE_SURFACE_BUILDER = new VolcanoEdgeSurfaceBuilder(SurfaceBuilderConfig::deserialize); - + public static final SurfaceBuilderConfig ASH_SURFACE = new SurfaceBuilderConfig(BOPBlocks.ash_block.getDefaultState(), BOPBlocks.ash_block.getDefaultState(), Blocks.GRAVEL.getDefaultState()); public static final SurfaceBuilderConfig GRANITE_SURFACE = new SurfaceBuilderConfig(Blocks.GRANITE.getDefaultState(), Blocks.GRANITE.getDefaultState(), Blocks.GRAVEL.getDefaultState()); public static final SurfaceBuilderConfig MAGMA_SURFACE = new SurfaceBuilderConfig(Blocks.MAGMA_BLOCK.getDefaultState(), Blocks.MAGMA_BLOCK.getDefaultState(), BOPBlocks.ash_block.getDefaultState()); diff --git a/src/main/java/biomesoplenty/common/world/gen/feature/BoneSpineFeature.java b/src/main/java/biomesoplenty/common/world/gen/feature/BoneSpineFeature.java new file mode 100644 index 000000000..5a18dfc35 --- /dev/null +++ b/src/main/java/biomesoplenty/common/world/gen/feature/BoneSpineFeature.java @@ -0,0 +1,110 @@ +package biomesoplenty.common.world.gen.feature; + +import biomesoplenty.api.block.BOPBlocks; +import biomesoplenty.common.util.block.IBlockPosQuery; +import com.mojang.datafixers.Dynamic; +import net.minecraft.block.BlockState; +import net.minecraft.block.Blocks; +import net.minecraft.block.LeavesBlock; +import net.minecraft.block.RotatedPillarBlock; +import net.minecraft.util.Direction; +import net.minecraft.util.math.BlockPos; +import net.minecraft.world.IWorld; +import net.minecraft.world.gen.ChunkGenerator; +import net.minecraft.world.gen.GenerationSettings; +import net.minecraft.world.gen.feature.Feature; +import net.minecraft.world.gen.feature.NoFeatureConfig; + +import java.util.Random; +import java.util.function.Function; + +public class BoneSpineFeature extends Feature +{ + protected IBlockPosQuery placeOn = (world, pos) -> world.getBlockState(pos).getBlock() == BOPBlocks.flesh; + protected IBlockPosQuery replace = (world, pos) -> world.getBlockState(pos).isAir(world, pos); + private int maxHeight = 8; + + public BoneSpineFeature(Function, ? extends NoFeatureConfig> deserializer) + { + super(deserializer); + } + + @Override + public boolean place(IWorld world, ChunkGenerator p_212245_2_, Random p_212245_3_, BlockPos startPos, NoFeatureConfig p_212245_5_) + { + while (startPos.getY() > 1 && this.replace.matches(world, startPos)) {startPos = startPos.down();} + + if (!this.placeOn.matches(world, startPos)) + { + // Abandon if we can't place the tree on this block + return false; + } + + if (!this.checkSpace(world, startPos.up())) + { + // Abandon if there isn't enough room + return false; + } + + BlockPos pos = startPos.up(); + + int height = 2 + p_212245_3_.nextInt(2); + + boolean spine = false; + if (p_212245_3_.nextInt(4) == 0) + { + spine = true; + height = 2 + p_212245_3_.nextInt(maxHeight + 1); + } + + for (int y = 0; y < height; y++) + { + this.setBlock(world, pos.add(0, y, 0), Blocks.BONE_BLOCK.getDefaultState()); + + if (spine == true && y % 2 == 1) + { + this.setBlock(world, pos.add(1, y, 0), Blocks.BONE_BLOCK.getDefaultState().with(RotatedPillarBlock.AXIS, Direction.Axis.X)); + this.setBlock(world, pos.add(-1, y, 0), Blocks.BONE_BLOCK.getDefaultState().with(RotatedPillarBlock.AXIS, Direction.Axis.X)); + this.setBlock(world, pos.add(0, y, 1), Blocks.BONE_BLOCK.getDefaultState().with(RotatedPillarBlock.AXIS, Direction.Axis.Z)); + this.setBlock(world, pos.add(0, y, -1), Blocks.BONE_BLOCK.getDefaultState().with(RotatedPillarBlock.AXIS, Direction.Axis.Z)); + } + } + + this.setBlock(world, pos.add(0, height, 0), Blocks.BONE_BLOCK.getDefaultState()); + if (height % 2 == 0) + { + this.setBlock(world, pos.add(0, height + 1, 0), Blocks.BONE_BLOCK.getDefaultState()); + } + + return true; + } + + public boolean setBlock(IWorld world, BlockPos pos, BlockState state) + { + if (this.replace.matches(world, pos)) + { + this.setBlockState(world, pos, state); + return true; + } + return false; + } + + public boolean checkSpace(IWorld world, BlockPos pos) + { + for (int y = 0; y <= maxHeight + 1; y++) + { + for (int x = -2; x <= 2; x++) + { + for (int z = -2; z <= 2; z++) + { + BlockPos pos1 = pos.add(x, y, z); + if (pos1.getY() >= 255 || !this.replace.matches(world, pos1)) + { + return false; + } + } + } + } + return true; + } +} \ No newline at end of file diff --git a/src/main/java/biomesoplenty/common/world/gen/feature/FleshSplatterFeature.java b/src/main/java/biomesoplenty/common/world/gen/feature/FleshSplatterFeature.java new file mode 100644 index 000000000..1ba27df1c --- /dev/null +++ b/src/main/java/biomesoplenty/common/world/gen/feature/FleshSplatterFeature.java @@ -0,0 +1,57 @@ +package biomesoplenty.common.world.gen.feature; + +import biomesoplenty.api.block.BOPBlocks; +import com.mojang.datafixers.Dynamic; +import net.minecraft.block.BlockState; +import net.minecraft.block.Blocks; +import net.minecraft.util.math.BlockPos; +import net.minecraft.world.IWorld; +import net.minecraft.world.gen.ChunkGenerator; +import net.minecraft.world.gen.GenerationSettings; +import net.minecraft.world.gen.feature.Feature; +import net.minecraft.world.gen.feature.NoFeatureConfig; + +import java.util.Random; +import java.util.function.Function; + +public class FleshSplatterFeature extends Feature +{ + public FleshSplatterFeature(Function, ? extends NoFeatureConfig> deserializer) + { + super(deserializer); + } + + @Override + public boolean place(IWorld worldIn, ChunkGenerator p_212245_2_, Random rand, BlockPos pos, NoFeatureConfig config) + { + int i = 0; + int j = rand.nextInt(8 - 2) + 2; + + for (int k = pos.getX() - j; k <= pos.getX() + j; ++k) + { + for (int l = pos.getZ() - j; l <= pos.getZ() + j; ++l) + { + int i1 = k - pos.getX(); + int j1 = l - pos.getZ(); + if (i1 * i1 + j1 * j1 <= j * j) + { + for (int k1 = pos.getY() - 2; k1 <= pos.getY() + 2; ++k1) + { + BlockPos blockpos = new BlockPos(k, k1, l); + BlockState blockstate = worldIn.getBlockState(blockpos); + BlockState blockstate1 = worldIn.getBlockState(blockpos.up()); + + if (blockstate.getBlock() == Blocks.NETHERRACK && blockstate1.isAir(worldIn, blockpos.up())) + { + worldIn.setBlockState(blockpos, BOPBlocks.flesh.getDefaultState(), 2); + ++i; + break; + } + } + } + } + } + + return i > 0; + } +} \ No newline at end of file diff --git a/src/main/java/biomesoplenty/common/world/gen/feature/ScatteredRocksFeature.java b/src/main/java/biomesoplenty/common/world/gen/feature/ScatteredRocksFeature.java new file mode 100644 index 000000000..cad20ffa0 --- /dev/null +++ b/src/main/java/biomesoplenty/common/world/gen/feature/ScatteredRocksFeature.java @@ -0,0 +1,50 @@ +package biomesoplenty.common.world.gen.feature; + +import biomesoplenty.api.block.BOPBlocks; +import com.mojang.datafixers.Dynamic; +import net.minecraft.block.Blocks; +import net.minecraft.block.LeavesBlock; +import net.minecraft.util.math.BlockPos; +import net.minecraft.world.IWorld; +import net.minecraft.world.gen.ChunkGenerator; +import net.minecraft.world.gen.GenerationSettings; +import net.minecraft.world.gen.feature.Feature; +import net.minecraft.world.gen.feature.NoFeatureConfig; + +import java.util.Random; +import java.util.function.Function; + +public class ScatteredRocksFeature extends Feature +{ + public ScatteredRocksFeature(Function, ? extends NoFeatureConfig> deserializer) + { + super(deserializer); + } + + @Override + public boolean place(IWorld p_212245_1_, ChunkGenerator p_212245_2_, Random p_212245_3_, BlockPos p_212245_4_, NoFeatureConfig p_212245_5_) + { + int i = 0; + + for(int j = 0; j < 32; ++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).canBeReplacedByLeaves(p_212245_1_, blockpos) && p_212245_1_.getBlockState(blockpos.down()).getBlock() == Blocks.GRASS_BLOCK) + { + + if (p_212245_3_.nextInt(3) == 0) + { + p_212245_1_.setBlockState(blockpos, Blocks.MOSSY_COBBLESTONE.getDefaultState(), 2); + } + else + { + p_212245_1_.setBlockState(blockpos, Blocks.COBBLESTONE.getDefaultState(), 2); + } + + ++i; + } + } + + return i > 0; + } +} \ No newline at end of file diff --git a/src/main/java/biomesoplenty/init/ModBiomes.java b/src/main/java/biomesoplenty/init/ModBiomes.java index 124b51ac2..4c559226b 100644 --- a/src/main/java/biomesoplenty/init/ModBiomes.java +++ b/src/main/java/biomesoplenty/init/ModBiomes.java @@ -15,7 +15,9 @@ import java.util.Optional; import biomesoplenty.common.biome.end.CoralDeadlandsBiome; import biomesoplenty.common.biome.end.EtherealGardenBiome; +import biomesoplenty.common.biome.nether.InfernalAshlandsBiome; import biomesoplenty.common.biome.nether.UndergardenBiome; +import biomesoplenty.common.biome.nether.VisceralHeapBiome; import com.google.common.collect.HashMultimap; import com.google.common.collect.Lists; import com.google.common.collect.Multimap; @@ -174,7 +176,9 @@ public class ModBiomes xeric_shrubland = registerBiome(new XericShrublandBiome(), "xeric_shrubland"); //Nether Biomes + infernal_ashlands = registerBiome(new InfernalAshlandsBiome(), "infernal_ashlands"); undergarden = registerBiome(new UndergardenBiome(), "undergarden"); + visceral_heap = registerBiome(new VisceralHeapBiome(), "visceral_heap"); //End Biomes coral_deadlands = registerBiome(new CoralDeadlandsBiome(), "coral_deadlands"); @@ -268,7 +272,9 @@ public class ModBiomes registerBiomeToDictionary(xeric_shrubland, Type.SANDY, Type.SAVANNA, Type.LUSH, Type.HOT, Type.DRY, Type.SPARSE); //Nether Biomes + registerBiomeToDictionary(infernal_ashlands, Type.NETHER, Type.HOT); registerBiomeToDictionary(undergarden, Type.NETHER, Type.HOT); + registerBiomeToDictionary(visceral_heap, Type.NETHER, Type.HOT); //End Biomes registerBiomeToDictionary(coral_deadlands, Type.END); diff --git a/src/main/java/biomesoplenty/init/ModBlocks.java b/src/main/java/biomesoplenty/init/ModBlocks.java index 71293b46c..e0c9c8b2e 100644 --- a/src/main/java/biomesoplenty/init/ModBlocks.java +++ b/src/main/java/biomesoplenty/init/ModBlocks.java @@ -49,7 +49,7 @@ public class ModBlocks dried_sand = registerBlock(new DriedSandBlock(Block.Properties.create(Material.EARTH, MaterialColor.WOOD).hardnessAndResistance(1.0F).harvestLevel(0).harvestTool(ToolType.PICKAXE).sound(new SoundType(1.0F, 0.5F, SoundEvents.BLOCK_GRAVEL_BREAK, SoundEvents.BLOCK_GRAVEL_STEP, SoundEvents.BLOCK_GRAVEL_PLACE, SoundEvents.BLOCK_GRAVEL_HIT, SoundEvents.BLOCK_GRAVEL_FALL))), "dried_sand"); ash_block = registerBlock(new AshBlock(Block.Properties.create(Material.SAND, MaterialColor.BLACK_TERRACOTTA).hardnessAndResistance(0.4F).harvestLevel(0).harvestTool(ToolType.SHOVEL).sound(SoundType.SAND)), "ash_block"); - flesh = registerBlock(new FleshBlock(Block.Properties.create(Material.SPONGE, MaterialColor.RED_TERRACOTTA).hardnessAndResistance(0.4F).sound(SoundType.SLIME).harvestLevel(0).harvestTool(ToolType.AXE)), "flesh"); + flesh = registerBlock(new FleshBlock(Block.Properties.create(Material.SPONGE, MaterialColor.RED_TERRACOTTA).hardnessAndResistance(0.4F).harvestLevel(0).harvestTool(ToolType.AXE).sound(new SoundType(1.0F, 0.5F, SoundEvents.BLOCK_CORAL_BLOCK_BREAK, SoundEvents.BLOCK_CORAL_BLOCK_STEP, SoundEvents.BLOCK_CORAL_BLOCK_PLACE, SoundEvents.BLOCK_CORAL_BLOCK_HIT, SoundEvents.BLOCK_CORAL_BLOCK_FALL))), "flesh"); //Trees origin_sapling = registerBlock(new SaplingBlockBOP(new OriginTree(), Block.Properties.create(Material.PLANTS).doesNotBlockMovement().tickRandomly().zeroHardnessAndResistance().sound(SoundType.PLANT)), "origin_sapling"); diff --git a/src/main/resources/assets/biomesoplenty/lang/en_us.json b/src/main/resources/assets/biomesoplenty/lang/en_us.json index 9c5591839..5f9a9a9d5 100644 --- a/src/main/resources/assets/biomesoplenty/lang/en_us.json +++ b/src/main/resources/assets/biomesoplenty/lang/en_us.json @@ -27,6 +27,7 @@ "biome.biomesoplenty.gravel_beach": "Gravel Beach", "biome.biomesoplenty.grove": "Grove", "biome.biomesoplenty.highland": "Highland", + "biome.biomesoplenty.infernal_ashlands": "Infernal Ashlands", "biome.biomesoplenty.lavender_field": "Lavender Field", "biome.biomesoplenty.lush_grassland": "Lush Grassland", "biome.biomesoplenty.lush_swamp": "Lush Swamp", @@ -63,6 +64,7 @@ "biome.biomesoplenty.tropics": "Tropics", "biome.biomesoplenty.tundra": "Tundra", "biome.biomesoplenty.undergarden": "Undergarden", + "biome.biomesoplenty.visceral_heap": "Visceral Heap", "biome.biomesoplenty.volcano": "Volcano", "biome.biomesoplenty.volcano_edge": "Volcano Edge", "biome.biomesoplenty.wasteland": "Wasteland",