From 1d62a282fd3094ffc2d9f8e54436137a08669765 Mon Sep 17 00:00:00 2001 From: Forstride Date: Fri, 5 Feb 2016 19:59:22 -0500 Subject: [PATCH] Tweaked the Steppe biome --- .../biome/overworld/BiomeGenSteppe.java | 29 ++++++++++++++++++- 1 file changed, 28 insertions(+), 1 deletion(-) diff --git a/src/main/java/biomesoplenty/common/biome/overworld/BiomeGenSteppe.java b/src/main/java/biomesoplenty/common/biome/overworld/BiomeGenSteppe.java index e4e9f660c..67aa962a2 100644 --- a/src/main/java/biomesoplenty/common/biome/overworld/BiomeGenSteppe.java +++ b/src/main/java/biomesoplenty/common/biome/overworld/BiomeGenSteppe.java @@ -8,10 +8,15 @@ package biomesoplenty.common.biome.overworld; +import java.util.Random; + import net.minecraft.block.BlockTallGrass; +import net.minecraft.block.state.IBlockState; import net.minecraft.entity.passive.EntityHorse; import net.minecraft.init.Blocks; import net.minecraft.util.BlockPos; +import net.minecraft.world.World; +import net.minecraft.world.chunk.ChunkPrimer; import biomesoplenty.api.biome.BOPBiome; import biomesoplenty.api.biome.generation.GeneratorStage; import biomesoplenty.api.biome.generation.GeneratorWeighted; @@ -23,6 +28,7 @@ import biomesoplenty.common.enums.BOPClimates; import biomesoplenty.common.enums.BOPGems; import biomesoplenty.common.enums.BOPPlants; import biomesoplenty.common.util.biome.GeneratorUtils.ScatterYMethod; +import biomesoplenty.common.util.config.BOPConfig.IConfigObj; import biomesoplenty.common.world.BOPWorldSettings; import biomesoplenty.common.world.feature.GeneratorFlora; import biomesoplenty.common.world.feature.GeneratorGrass; @@ -32,12 +38,17 @@ import biomesoplenty.common.world.feature.GeneratorWaterside; public class BiomeGenSteppe extends BOPBiome { + public IBlockState usualTopBlock; + public IBlockState alternateTopBlock; + public BiomeGenSteppe() { // terrain this.topBlock = BOPBlocks.grass.getDefaultState().withProperty(BlockBOPGrass.VARIANT, BlockBOPGrass.BOPGrassType.SANDY); this.fillerBlock = BOPBlocks.dirt.getDefaultState().withProperty(BlockBOPDirt.VARIANT, BlockBOPDirt.BOPDirtType.SANDY); - + this.usualTopBlock = this.topBlock; + this.alternateTopBlock = BOPBlocks.dried_sand.getDefaultState(); + this.terrainSettings.avgHeight(70).heightVariation(6, 20).octaves(0, 1, 2, 2, 1, 0).sidewaysNoise(0.1D); this.setColor(13413215); @@ -70,6 +81,15 @@ public class BiomeGenSteppe extends BOPBiome this.addGenerator("ruby", GeneratorStage.SAND, (new GeneratorOreSingle.Builder()).amountPerChunk(12).with(BOPGems.RUBY).create()); } + @Override + public void configure(IConfigObj conf) + { + super.configure(conf); + + this.usualTopBlock = this.topBlock; + this.alternateTopBlock = conf.getBlockState("alternateTopBlock", this.alternateTopBlock); + } + @Override public void applySettings(BOPWorldSettings settings) { @@ -87,6 +107,13 @@ public class BiomeGenSteppe extends BOPBiome if (!settings.generateBopGrasses) {grassGen.removeGenerator("shortgrass"); grassGen.removeGenerator("mediumgrass"); grassGen.removeGenerator("wheatgrass"); grassGen.removeGenerator("dampgrass"); this.removeGenerator("desertgrass");} } + @Override + public void genTerrainBlocks(World world, Random rand, ChunkPrimer primer, int x, int z, double noise) + { + this.topBlock = (noise + rand.nextDouble() * 1.0D > 1.8D) ? this.alternateTopBlock : this.usualTopBlock; + super.genTerrainBlocks(world, rand, primer, x, z, noise); + } + @Override public int getGrassColorAtPos(BlockPos pos) {