diff --git a/src/main/java/biomesoplenty/api/biome/BOPBiomes.java b/src/main/java/biomesoplenty/api/biome/BOPBiomes.java index 07abd8e98..ba057b4d4 100644 --- a/src/main/java/biomesoplenty/api/biome/BOPBiomes.java +++ b/src/main/java/biomesoplenty/api/biome/BOPBiomes.java @@ -53,6 +53,7 @@ public class BOPBiomes public static Optional origin_valley = Optional.absent(); public static Optional outback = Optional.absent(); public static Optional prairie = Optional.absent(); + public static Optional quagmire = Optional.absent(); public static Optional sacred_springs = Optional.absent(); public static Optional shrubland = Optional.absent(); public static Optional steppe = Optional.absent(); diff --git a/src/main/java/biomesoplenty/common/biome/overworld/BiomeGenQuagmire.java b/src/main/java/biomesoplenty/common/biome/overworld/BiomeGenQuagmire.java new file mode 100644 index 000000000..a4b850dd2 --- /dev/null +++ b/src/main/java/biomesoplenty/common/biome/overworld/BiomeGenQuagmire.java @@ -0,0 +1,111 @@ +/******************************************************************************* + * Copyright 2015-2016, the Biomes O' Plenty Team + * + * This work is licensed under a Creative Commons Attribution-NonCommercial-NoDerivatives 4.0 International Public License. + * + * To view a copy of this license, visit http://creativecommons.org/licenses/by-nc-nd/4.0/. + ******************************************************************************/ + +package biomesoplenty.common.biome.overworld; + +import net.minecraft.block.BlockTallGrass; +import net.minecraft.entity.monster.EntitySlime; +import net.minecraft.init.Blocks; +import net.minecraft.util.BlockPos; +import biomesoplenty.api.biome.BOPBiome; +import biomesoplenty.api.biome.generation.GeneratorStage; +import biomesoplenty.api.biome.generation.GeneratorWeighted; +import biomesoplenty.api.block.BOPBlocks; +import biomesoplenty.common.block.BlockBOPCoral; +import biomesoplenty.common.block.BlockBOPLilypad; +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.block.BlockQuery; +import biomesoplenty.common.util.block.BlockQuery.IBlockPosQuery; +import biomesoplenty.common.world.BOPWorldSettings; +import biomesoplenty.common.world.feature.GeneratorFlora; +import biomesoplenty.common.world.feature.GeneratorGrass; +import biomesoplenty.common.world.feature.GeneratorOreSingle; +import biomesoplenty.common.world.feature.GeneratorSplatter; + +public class BiomeGenQuagmire extends BOPBiome +{ + + public BiomeGenQuagmire() + { + // terrain + this.terrainSettings.avgHeight(63).heightVariation(5, 10).octaves(1, 1, 1, 1, 0, 0).sidewaysNoise(0.0F); + + this.setColor(0x503A2B); + this.setTemperatureRainfall(0.8F, 0.9F); + this.topBlock = BOPBlocks.mud.getDefaultState(); + this.fillerBlock = BOPBlocks.mud.getDefaultState(); + this.waterColorMultiplier = 0xCC5100; + this.skyColor = 0xBDC4BE; + this.seaFloorBlock = BOPBlocks.mud.getDefaultState(); + + this.addWeight(BOPClimates.COLD_SWAMP, 5); + + this.spawnableWaterCreatureList.clear(); + this.spawnableMonsterList.add(new SpawnListEntry(EntitySlime.class, 10, 1, 3)); + + // splatter top blocks + IBlockPosQuery emptyMud = BlockQuery.buildAnd().withAirAbove().states(this.topBlock).create(); + this.addGenerator("grass_splatter", GeneratorStage.SAND, (new GeneratorSplatter.Builder()).amountPerChunk(1.0F).generationAttempts(128).replace(emptyMud).with(Blocks.grass.getDefaultState()).create()); + + // grasses + GeneratorWeighted grassGenerator = new GeneratorWeighted(5.0F); + this.addGenerator("grass", GeneratorStage.GRASS, grassGenerator); + grassGenerator.add("wheatgrass", 1, (new GeneratorGrass.Builder()).with(BOPPlants.WHEATGRASS).create()); + grassGenerator.add("dampgrass", 1, (new GeneratorGrass.Builder()).with(BOPPlants.DAMPGRASS).create()); + grassGenerator.add("tallgrass", 2, (new GeneratorGrass.Builder()).with(BlockTallGrass.EnumType.GRASS).create()); + + // other plants + this.addGenerator("koru", GeneratorStage.FLOWERS,(new GeneratorFlora.Builder()).amountPerChunk(0.3F).with(BOPPlants.KORU).create()); + + // water plants + this.addGenerator("duckweed", GeneratorStage.LILYPAD, (new GeneratorFlora.Builder()).amountPerChunk(0.5F).with(BlockBOPLilypad.LilypadType.DUCKWEED).create()); + this.addGenerator("lily", GeneratorStage.LILYPAD, (new GeneratorFlora.Builder()).amountPerChunk(0.1F).with(Blocks.waterlily.getDefaultState()).create()); + this.addGenerator("medium_lily", GeneratorStage.LILYPAD, (new GeneratorFlora.Builder()).amountPerChunk(0.1F).with(BlockBOPLilypad.LilypadType.MEDIUM).create()); + this.addGenerator("small_lily", GeneratorStage.LILYPAD, (new GeneratorFlora.Builder()).amountPerChunk(0.2F).with(BlockBOPLilypad.LilypadType.SMALL).create()); + this.addGenerator("tiny_lily", GeneratorStage.LILYPAD, (new GeneratorFlora.Builder()).amountPerChunk(0.3F).with(BlockBOPLilypad.LilypadType.TINY).create()); + this.addGenerator("algae", GeneratorStage.LILYPAD, (new GeneratorFlora.Builder()).amountPerChunk(0.1F).replace(Blocks.water).with(BOPBlocks.coral.getDefaultState().withProperty(BlockBOPCoral.VARIANT, BlockBOPCoral.CoralType.ALGAE)).scatterYMethod(ScatterYMethod.AT_GROUND).create()); + this.addGenerator("water_reeds", GeneratorStage.LILYPAD, (new GeneratorFlora.Builder()).amountPerChunk(0.4F).with(BOPPlants.REED).generationAttempts(32).create()); + + // gem + this.addGenerator("malachite", GeneratorStage.SAND, (new GeneratorOreSingle.Builder()).amountPerChunk(12).with(BOPGems.MALACHITE).create()); + + } + + @Override + public void applySettings(BOPWorldSettings settings) + { + if (!settings.generateBopGems) {this.removeGenerator("malachite");} + } + + @Override + public int getGrassColorAtPos(BlockPos pos) + { + return 0x9E8B69; + } + + @Override + public int getFoliageColorAtPos(BlockPos pos) + { + return 0x9E8B69; + } + + // TODO: These 2 are copied from 1.7 - but are they used ever? + public int getFogColour(BlockPos pos) + { + return 0xCACECD; + } + public float getFogDensity(BlockPos pos) + { + return 0.99F; + } + + +} diff --git a/src/main/java/biomesoplenty/common/init/ModBiomes.java b/src/main/java/biomesoplenty/common/init/ModBiomes.java index 66424f018..8e45768f0 100644 --- a/src/main/java/biomesoplenty/common/init/ModBiomes.java +++ b/src/main/java/biomesoplenty/common/init/ModBiomes.java @@ -56,6 +56,7 @@ import static biomesoplenty.api.biome.BOPBiomes.origin_valley; import static biomesoplenty.api.biome.BOPBiomes.outback; import static biomesoplenty.api.biome.BOPBiomes.plains_extension; import static biomesoplenty.api.biome.BOPBiomes.prairie; +import static biomesoplenty.api.biome.BOPBiomes.quagmire; import static biomesoplenty.api.biome.BOPBiomes.roofed_forest_extension; import static biomesoplenty.api.biome.BOPBiomes.sacred_springs; import static biomesoplenty.api.biome.BOPBiomes.savanna_extension; @@ -121,6 +122,7 @@ import biomesoplenty.common.biome.overworld.BiomeGenMountain; import biomesoplenty.common.biome.overworld.BiomeGenOriginValley; import biomesoplenty.common.biome.overworld.BiomeGenOutback; import biomesoplenty.common.biome.overworld.BiomeGenPrairie; +import biomesoplenty.common.biome.overworld.BiomeGenQuagmire; import biomesoplenty.common.biome.overworld.BiomeGenSacredSprings; import biomesoplenty.common.biome.overworld.BiomeGenShrubland; import biomesoplenty.common.biome.overworld.BiomeGenSteppe; @@ -331,6 +333,7 @@ public class ModBiomes implements BOPBiomes.IBiomeRegistry origin_valley = registerBOPBiome(new BiomeGenOriginValley(), "Origin Valley"); outback = registerBOPBiome(new BiomeGenOutback(), "Outback"); prairie = registerBOPBiome(new BiomeGenPrairie(), "Prairie"); + quagmire = registerBOPBiome(new BiomeGenQuagmire(), "Quagmire"); sacred_springs = registerBOPBiome(new BiomeGenSacredSprings(), "Sacred Springs"); shrubland = registerBOPBiome(new BiomeGenShrubland(), "Shrubland"); steppe = registerBOPBiome(new BiomeGenSteppe(), "Steppe"); @@ -391,6 +394,7 @@ public class ModBiomes implements BOPBiomes.IBiomeRegistry registerBiomeToDictionary(BOPBiomes.origin_valley, Type.MAGICAL, Type.SPARSE); registerBiomeToDictionary(BOPBiomes.outback, Type.SANDY, Type.PLAINS, Type.SAVANNA, Type.DRY, Type.HOT); registerBiomeToDictionary(BOPBiomes.prairie, Type.PLAINS, Type.DRY, Type.SPARSE); + registerBiomeToDictionary(BOPBiomes.quagmire, Type.SWAMP, Type.WATER, Type.DEAD, Type.WET, Type.WASTELAND); registerBiomeToDictionary(BOPBiomes.shrubland, Type.PLAINS, Type.SPARSE, Type.DRY); registerBiomeToDictionary(BOPBiomes.steppe, Type.PLAINS, Type.SANDY, Type.DRY, Type.HOT, Type.SAVANNA, Type.SPARSE, Type.DEAD); registerBiomeToDictionary(BOPBiomes.thicket, Type.PLAINS, Type.FOREST, Type.DRY, Type.DEAD, Type.DENSE);