More work on Nether biomes, tweaks to the Tundra and Bog biomes

This commit is contained in:
Forstride 2019-08-04 00:26:18 -04:00
parent f303021c7b
commit ec0977da4d
17 changed files with 408 additions and 15 deletions

View file

@ -74,7 +74,9 @@ public class BOPBiomes
public static Optional<Biome> woodland = Optional.empty();
public static Optional<Biome> xeric_shrubland = Optional.empty();
public static Optional<Biome> infernal_ashlands = Optional.empty();
public static Optional<Biome> undergarden = Optional.empty();
public static Optional<Biome> visceral_heap = Optional.empty();
public static Optional<Biome> coral_deadlands = Optional.empty();
public static Optional<Biome> ethereal_garden = Optional.empty();

View file

@ -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));
}
}

View file

@ -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));
}
}

View file

@ -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)));

View file

@ -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)));

View file

@ -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)

View file

@ -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

View file

@ -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));
}
}

View file

@ -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)
{

View file

@ -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<NoFeatureConfig> {
public AshSplatterFeature(Function<Dynamic<?>, ? extends NoFeatureConfig> deserializer) {
super(deserializer);
}
@Override
public boolean place(IWorld worldIn, ChunkGenerator<? extends GenerationSettings> 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;
}
}

View file

@ -35,7 +35,6 @@ public class BOPBiomeFeatures
public static final AbstractTreeFeature<NoFeatureConfig> SILK_TREE = new BasicTreeFeature.Builder().log(BOPBlocks.dead_log.getDefaultState()).leaves(BOPBlocks.dead_leaves.getDefaultState()).altLeaves(Blocks.COBWEB.getDefaultState()).create();
public static final AbstractTreeFeature<NoFeatureConfig> FULL_SILK_TREE = new BasicTreeFeature.Builder().log(BOPBlocks.dead_log.getDefaultState()).leaves(Blocks.COBWEB.getDefaultState()).create();
public static final AbstractTreeFeature<NoFeatureConfig> MAGIC_TREE = new BasicTreeFeature.Builder().log(BOPBlocks.magic_log.getDefaultState()).leaves(BOPBlocks.magic_leaves.getDefaultState()).create();
//Big Trees
public static final AbstractTreeFeature<NoFeatureConfig> BIG_OAK_TREE = new BigTreeFeature.Builder().create();
@ -117,10 +116,15 @@ public class BOPBiomeFeatures
public static final Feature<NoFeatureConfig> SHORT_BAMBOO = new ShortBambooFeature(NoFeatureConfig::deserialize);
public static final Feature<NoFeatureConfig> SCRUB = new ScrubFeature(NoFeatureConfig::deserialize);
public static final Feature<NoFeatureConfig> HEATH = new HeathFeature(NoFeatureConfig::deserialize);
public static final Feature<NoFeatureConfig> SCATTERED_ROCKS = new ScatteredRocksFeature(NoFeatureConfig::deserialize);
public static final Feature<NoFeatureConfig> DEAD_CORAL_SPLATTER = new DeadCoralSplatterFeature(NoFeatureConfig::deserialize);
public static final Feature<NoFeatureConfig> DEAD_CORAL_SPIKES = new DeadCoralSpikesFeature(NoFeatureConfig::deserialize);
public static final Feature<NoFeatureConfig> NETHER_VINES = new NetherVinesFeature(NoFeatureConfig::deserialize);
public static final Feature<NoFeatureConfig> FLESH_SPLATTER = new FleshSplatterFeature(NoFeatureConfig::deserialize);
public static final Feature<NoFeatureConfig> BONE_SPINE = new BoneSpineFeature(NoFeatureConfig::deserialize);
public static final AbstractTreeFeature<NoFeatureConfig> 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<NoFeatureConfig> 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<SurfaceBuilderConfig> PODZOL_SURFACE_BUILDER = new PodzolSurfaceBuilder(SurfaceBuilderConfig::deserialize);
public static final SurfaceBuilder<SurfaceBuilderConfig> VOLCANO_SURFACE_BUILDER = new VolcanoSurfaceBuilder(SurfaceBuilderConfig::deserialize);
public static final SurfaceBuilder<SurfaceBuilderConfig> 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());

View file

@ -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<NoFeatureConfig>
{
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<Dynamic<?>, ? extends NoFeatureConfig> deserializer)
{
super(deserializer);
}
@Override
public boolean place(IWorld world, ChunkGenerator<? extends GenerationSettings> 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;
}
}

View file

@ -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<NoFeatureConfig>
{
public FleshSplatterFeature(Function<Dynamic<?>, ? extends NoFeatureConfig> deserializer)
{
super(deserializer);
}
@Override
public boolean place(IWorld worldIn, ChunkGenerator<? extends GenerationSettings> 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;
}
}

View file

@ -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<NoFeatureConfig>
{
public ScatteredRocksFeature(Function<Dynamic<?>, ? extends NoFeatureConfig> deserializer)
{
super(deserializer);
}
@Override
public boolean place(IWorld p_212245_1_, ChunkGenerator<? extends GenerationSettings> 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;
}
}

View file

@ -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);

View file

@ -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");

View file

@ -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",