diff --git a/src/main/java/biomesoplenty/api/biome/BOPBiomes.java b/src/main/java/biomesoplenty/api/biome/BOPBiomes.java index fdaee9666..487006bfb 100644 --- a/src/main/java/biomesoplenty/api/biome/BOPBiomes.java +++ b/src/main/java/biomesoplenty/api/biome/BOPBiomes.java @@ -79,6 +79,8 @@ public class BOPBiomes public static Optional mountain_foothills = Optional.absent(); public static Optional canyon_ravine = Optional.absent(); public static Optional coral_reef = Optional.absent(); + public static Optional kelp_forest = Optional.absent(); + public static Optional tropical_island = Optional.absent(); //Biome extensions public static IExtendedBiome end_extension; diff --git a/src/main/java/biomesoplenty/common/biome/overworld/BiomeGenCoralReef.java b/src/main/java/biomesoplenty/common/biome/overworld/BiomeGenCoralReef.java index 7663e0698..7288ad38e 100644 --- a/src/main/java/biomesoplenty/common/biome/overworld/BiomeGenCoralReef.java +++ b/src/main/java/biomesoplenty/common/biome/overworld/BiomeGenCoralReef.java @@ -42,9 +42,6 @@ public class BiomeGenCoralReef extends BOPBiome this.addGenerator("blue_coral", GeneratorStage.LILYPAD, (new GeneratorFlora.Builder()).amountPerChunk(15.0F).replace(Blocks.water).with(BOPBlocks.coral.getDefaultState().withProperty(BlockBOPCoral.VARIANT, BlockBOPCoral.CoralType.BLUE)).scatterYMethod(ScatterYMethod.AT_GROUND).create()); this.addGenerator("glowing_coral", GeneratorStage.LILYPAD, (new GeneratorFlora.Builder()).amountPerChunk(15.0F).replace(Blocks.water).with(BOPBlocks.coral.getDefaultState().withProperty(BlockBOPCoral.VARIANT, BlockBOPCoral.CoralType.GLOWING)).scatterYMethod(ScatterYMethod.AT_GROUND).create()); this.addGenerator("algae", GeneratorStage.LILYPAD, (new GeneratorFlora.Builder()).amountPerChunk(3.0F).replace(Blocks.water).with(BOPBlocks.coral.getDefaultState().withProperty(BlockBOPCoral.VARIANT, BlockBOPCoral.CoralType.ALGAE)).scatterYMethod(ScatterYMethod.AT_GROUND).create()); - - // kelp - this.addGenerator("kelp", GeneratorStage.LILYPAD, (new GeneratorColumns.Builder()).replace(BlockQueries.waterCovered).placeOn(BlockQueries.groundBlocks).with(BOPBlocks.seaweed.getDefaultState()).scatterYMethod(ScatterYMethod.AT_GROUND).create()); // gem this.addGenerator("sapphire", GeneratorStage.SAND, (new GeneratorOreSingle.Builder()).amountPerChunk(12).with(BOPGems.SAPPHIRE).create()); diff --git a/src/main/java/biomesoplenty/common/biome/overworld/BiomeGenKelpForest.java b/src/main/java/biomesoplenty/common/biome/overworld/BiomeGenKelpForest.java new file mode 100644 index 000000000..56db822b9 --- /dev/null +++ b/src/main/java/biomesoplenty/common/biome/overworld/BiomeGenKelpForest.java @@ -0,0 +1,59 @@ +/******************************************************************************* + * 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 biomesoplenty.api.biome.BOPBiome; +import biomesoplenty.api.biome.generation.GeneratorStage; +import biomesoplenty.api.block.BOPBlocks; +import biomesoplenty.api.block.BlockQueries; +import biomesoplenty.common.block.BlockBOPCoral; +import biomesoplenty.common.enums.BOPGems; +import biomesoplenty.common.util.biome.GeneratorUtils.ScatterYMethod; +import biomesoplenty.common.world.BOPWorldSettings; +import biomesoplenty.common.world.feature.GeneratorColumns; +import biomesoplenty.common.world.feature.GeneratorFlora; +import biomesoplenty.common.world.feature.GeneratorOreSingle; +import net.minecraft.init.Blocks; + +public class BiomeGenKelpForest extends BOPBiome +{ + public BiomeGenKelpForest() + { + // terrain + this.terrainSettings.avgHeight(40).heightVariation(5, 10); + + this.setColor(27468); + + this.canSpawnInBiome = false; + this.canGenerateVillages = false; + this.canGenerateRivers = false; + + clearWeights(); + + // algae + this.addGenerator("algae", GeneratorStage.LILYPAD, (new GeneratorFlora.Builder()).amountPerChunk(3.0F).replace(Blocks.water).with(BOPBlocks.coral.getDefaultState().withProperty(BlockBOPCoral.VARIANT, BlockBOPCoral.CoralType.ALGAE)).scatterYMethod(ScatterYMethod.AT_GROUND).create()); + + // kelp + this.addGenerator("kelp", GeneratorStage.LILYPAD, (new GeneratorColumns.Builder()).amountPerChunk(5.0F).replace(BlockQueries.waterCovered).placeOn(BlockQueries.groundBlocks).with(BOPBlocks.seaweed.getDefaultState()).scatterYMethod(ScatterYMethod.AT_GROUND).create()); + this.addGenerator("kelp_tall", GeneratorStage.LILYPAD, (new GeneratorColumns.Builder()).amountPerChunk(6.0F).replace(BlockQueries.waterCovered).placeOn(BlockQueries.groundBlocks).with(BOPBlocks.seaweed.getDefaultState()).minHeight(10).maxHeight(20).scatterYMethod(ScatterYMethod.AT_GROUND).create()); + + // gem + this.addGenerator("sapphire", GeneratorStage.SAND, (new GeneratorOreSingle.Builder()).amountPerChunk(12).with(BOPGems.SAPPHIRE).create()); + } + + @Override + public void applySettings(BOPWorldSettings settings) + { + if (!settings.generateBopGems) {this.removeGenerator("sapphire");} + + if (!settings.generateBopFoliage) {this.removeGenerator("caveweed"); this.removeGenerator("bushes"); this.removeGenerator("koru"); this.removeGenerator("shrubs"); this.removeGenerator("leaf_piles"); this.removeGenerator("dead_leaf_piles"); this.removeGenerator("clover_patches"); this.removeGenerator("sprouts");} + + if (!settings.generateBopPlants) {this.removeGenerator("cattail"); this.removeGenerator("double_cattail"); this.removeGenerator("river_cane"); this.removeGenerator("tiny_cacti"); this.removeGenerator("roots"); this.removeGenerator("rafflesia"); this.removeGenerator("desert_sprouts");} + } +} diff --git a/src/main/java/biomesoplenty/common/biome/overworld/BiomeGenTropicalIsland.java b/src/main/java/biomesoplenty/common/biome/overworld/BiomeGenTropicalIsland.java new file mode 100644 index 000000000..81287d2f8 --- /dev/null +++ b/src/main/java/biomesoplenty/common/biome/overworld/BiomeGenTropicalIsland.java @@ -0,0 +1,89 @@ +/******************************************************************************* + * 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 biomesoplenty.api.biome.BOPBiome; +import biomesoplenty.api.biome.generation.GeneratorStage; +import biomesoplenty.api.biome.generation.GeneratorWeighted; +import biomesoplenty.api.block.BOPBlocks; +import biomesoplenty.api.block.BlockQueries; +import biomesoplenty.common.block.BlockBOPCoral; +import biomesoplenty.common.enums.BOPFlowers; +import biomesoplenty.common.enums.BOPGems; +import biomesoplenty.common.enums.BOPPlants; +import biomesoplenty.common.util.biome.GeneratorUtils.ScatterYMethod; +import biomesoplenty.common.world.BOPWorldSettings; +import biomesoplenty.common.world.feature.GeneratorColumns; +import biomesoplenty.common.world.feature.GeneratorDoubleFlora; +import biomesoplenty.common.world.feature.GeneratorFlora; +import biomesoplenty.common.world.feature.GeneratorGrass; +import biomesoplenty.common.world.feature.GeneratorOreSingle; +import net.minecraft.block.BlockDoublePlant; +import net.minecraft.block.BlockFlower; +import net.minecraft.block.BlockTallGrass; +import net.minecraft.init.Blocks; + +public class BiomeGenTropicalIsland extends BOPBiome +{ + public BiomeGenTropicalIsland() + { + // terrain + this.terrainSettings.avgHeight(70).heightVariation(5, 20); + + this.setColor(2211330); + + this.canSpawnInBiome = false; + this.canGenerateVillages = false; + this.canGenerateRivers = false; + + clearWeights(); + + // grasses + GeneratorWeighted grassGenerator = new GeneratorWeighted(3.0F); + this.addGenerator("grass", GeneratorStage.GRASS, grassGenerator); + grassGenerator.add("shortgrass", 1, (new GeneratorGrass.Builder()).with(BOPPlants.SHORTGRASS).create()); + grassGenerator.add("mediumgrass", 1, (new GeneratorGrass.Builder()).with(BOPPlants.MEDIUMGRASS).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("leaf_piles", GeneratorStage.FLOWERS,(new GeneratorFlora.Builder()).amountPerChunk(0.1F).with(BOPPlants.LEAFPILE).create()); + this.addGenerator("sprouts", GeneratorStage.FLOWERS,(new GeneratorFlora.Builder()).amountPerChunk(0.1F).with(BOPPlants.SPROUT).create()); + this.addGenerator("shrubs", GeneratorStage.FLOWERS,(new GeneratorFlora.Builder()).amountPerChunk(0.1F).with(BOPPlants.SHRUB).create()); + this.addGenerator("melons", GeneratorStage.FLOWERS, (new GeneratorFlora.Builder()).amountPerChunk(0.015625F).placeOn(this.topBlock).with(Blocks.melon_block.getDefaultState()).create()); + + // flowers + GeneratorWeighted flowerGenerator = new GeneratorWeighted(1.5F); + this.addGenerator("flowers", GeneratorStage.GRASS, flowerGenerator); + flowerGenerator.add("hibiscus", 6, (new GeneratorFlora.Builder().with(BOPFlowers.PINK_HIBISCUS).create())); + flowerGenerator.add("blue_hydrangeas", 2, (new GeneratorFlora.Builder().with(BOPFlowers.BLUE_HYDRANGEA).create())); + flowerGenerator.add("white_anemones", 1, (new GeneratorFlora.Builder().with(BOPFlowers.WHITE_ANEMONE).create())); + flowerGenerator.add("dandelion", 1, (new GeneratorFlora.Builder().with(BlockFlower.EnumFlowerType.DANDELION).create())); + flowerGenerator.add("poppy", 1, (new GeneratorFlora.Builder().with(BlockFlower.EnumFlowerType.POPPY).create())); + + // gem + this.addGenerator("topaz", GeneratorStage.SAND, (new GeneratorOreSingle.Builder()).amountPerChunk(12).with(BOPGems.TOPAZ).create()); + } + + @Override + public void applySettings(BOPWorldSettings settings) + { + if (!settings.generateBopGems) {this.removeGenerator("topaz");} + + if (!settings.generateBopFoliage) {this.removeGenerator("caveweed"); this.removeGenerator("bushes"); this.removeGenerator("koru"); this.removeGenerator("shrubs"); this.removeGenerator("leaf_piles"); this.removeGenerator("dead_leaf_piles"); this.removeGenerator("clover_patches"); this.removeGenerator("sprouts");} + + if (!settings.generateBopPlants) {this.removeGenerator("cattail"); this.removeGenerator("double_cattail"); this.removeGenerator("river_cane"); this.removeGenerator("tiny_cacti"); this.removeGenerator("roots"); this.removeGenerator("rafflesia"); this.removeGenerator("desert_sprouts");} + + GeneratorWeighted flowerGen = (GeneratorWeighted)this.getGenerator("flowers"); + if (!settings.generateBopFlowers) {flowerGen.removeGenerator("bluebells"); flowerGen.removeGenerator("clover"); flowerGen.removeGenerator("swampflower"); flowerGen.removeGenerator("deathbloom"); flowerGen.removeGenerator("glowflower"); flowerGen.removeGenerator("blue_hydrangeas"); flowerGen.removeGenerator("pink_daffodil"); flowerGen.removeGenerator("white_anemones"); flowerGen.removeGenerator("orange_cosmos"); flowerGen.removeGenerator("wildflowers"); flowerGen.removeGenerator("violet"); flowerGen.removeGenerator("hibiscus"); flowerGen.removeGenerator("goldenrods"); flowerGen.removeGenerator("icy_irises"); flowerGen.removeGenerator("wilted_lily"); flowerGen.removeGenerator("lily_of_the_valley"); flowerGen.removeGenerator("bromeliad"); this.removeGenerator("bromeliad");} + + GeneratorWeighted grassGen = (GeneratorWeighted)this.getGenerator("grass"); + if (!settings.generateBopGrasses) {grassGen.removeGenerator("shortgrass"); grassGen.removeGenerator("mediumgrass"); grassGen.removeGenerator("wheatgrass"); grassGen.removeGenerator("dampgrass");} + } +} diff --git a/src/main/java/biomesoplenty/common/init/ModBiomes.java b/src/main/java/biomesoplenty/common/init/ModBiomes.java index 22c2aade2..0bd5a66d4 100644 --- a/src/main/java/biomesoplenty/common/init/ModBiomes.java +++ b/src/main/java/biomesoplenty/common/init/ModBiomes.java @@ -42,6 +42,7 @@ import static biomesoplenty.api.biome.BOPBiomes.heathland; import static biomesoplenty.api.biome.BOPBiomes.highland; import static biomesoplenty.api.biome.BOPBiomes.ice_plains_extension; import static biomesoplenty.api.biome.BOPBiomes.jungle_extension; +import static biomesoplenty.api.biome.BOPBiomes.kelp_forest; import static biomesoplenty.api.biome.BOPBiomes.land_of_lakes; import static biomesoplenty.api.biome.BOPBiomes.lavender_fields; import static biomesoplenty.api.biome.BOPBiomes.lush_desert; @@ -74,6 +75,7 @@ import static biomesoplenty.api.biome.BOPBiomes.steppe; import static biomesoplenty.api.biome.BOPBiomes.swampland_extension; import static biomesoplenty.api.biome.BOPBiomes.taiga_extension; import static biomesoplenty.api.biome.BOPBiomes.temperate_rainforest; +import static biomesoplenty.api.biome.BOPBiomes.tropical_island; import static biomesoplenty.api.biome.BOPBiomes.tropical_rainforest; import static biomesoplenty.api.biome.BOPBiomes.tundra; import static biomesoplenty.api.biome.BOPBiomes.wasteland; @@ -123,6 +125,7 @@ import biomesoplenty.common.biome.overworld.BiomeGenGrassland; import biomesoplenty.common.biome.overworld.BiomeGenGrove; import biomesoplenty.common.biome.overworld.BiomeGenHeathland; import biomesoplenty.common.biome.overworld.BiomeGenHighland; +import biomesoplenty.common.biome.overworld.BiomeGenKelpForest; import biomesoplenty.common.biome.overworld.BiomeGenLandOfLakes; import biomesoplenty.common.biome.overworld.BiomeGenLavenderFields; import biomesoplenty.common.biome.overworld.BiomeGenLushDesert; @@ -148,6 +151,7 @@ import biomesoplenty.common.biome.overworld.BiomeGenShrubland; import biomesoplenty.common.biome.overworld.BiomeGenSnowyConiferousForest; import biomesoplenty.common.biome.overworld.BiomeGenSteppe; import biomesoplenty.common.biome.overworld.BiomeGenTemperateRainforest; +import biomesoplenty.common.biome.overworld.BiomeGenTropicalIsland; import biomesoplenty.common.biome.overworld.BiomeGenTropicalRainforest; import biomesoplenty.common.biome.overworld.BiomeGenTundra; import biomesoplenty.common.biome.overworld.BiomeGenWasteland; @@ -387,9 +391,12 @@ public class ModBiomes implements BOPBiomes.IBiomeRegistry mountain_foothills = registerBOPBiome(new BiomeGenMountain(BiomeGenMountain.MountainType.FOOTHILLS), "Mountain Foothills"); canyon_ravine = registerBOPBiome(new BiomeGenCanyon(BiomeGenCanyon.CanyonType.RAVINE), "Canyon Ravine"); coral_reef = registerBOPBiome(new BiomeGenCoralReef(), "Coral Reef"); + kelp_forest = registerBOPBiome(new BiomeGenKelpForest(), "Kelp Forest"); + tropical_island = registerBOPBiome(new BiomeGenTropicalIsland(), "Tropical Island"); setSubBiome(canyon, canyon_ravine); setSubBiome(Optional.of(BiomeGenBase.ocean), BOPBiomes.coral_reef); + setSubBiome(Optional.of(BiomeGenBase.ocean), BOPBiomes.kelp_forest); } @@ -458,6 +465,8 @@ public class ModBiomes implements BOPBiomes.IBiomeRegistry registerBiomeToDictionary(BOPBiomes.mountain_foothills, Type.HILLS, Type.MOUNTAIN); registerBiomeToDictionary(BOPBiomes.canyon_ravine, Type.SANDY, Type.HILLS, Type.DRY, Type.HOT); registerBiomeToDictionary(BOPBiomes.coral_reef, Type.WATER, Type.OCEAN); + registerBiomeToDictionary(BOPBiomes.kelp_forest, Type.WATER, Type.OCEAN); + registerBiomeToDictionary(BOPBiomes.tropical_island, Type.WATER, Type.OCEAN, Type.JUNGLE, Type.LUSH); }