From 25b423cd1d9374bca8fa7954a055494fe28f6631 Mon Sep 17 00:00:00 2001 From: Forstride Date: Sat, 19 Mar 2016 22:29:47 -0400 Subject: [PATCH] Added Mangrove biome base --- .../biomesoplenty/api/biome/BOPBiomes.java | 1 + .../biome/overworld/BiomeGenFlowerIsland.java | 2 +- .../biome/overworld/BiomeGenMangrove.java | 61 +++++++++++++++++++ .../biomesoplenty/common/init/ModBiomes.java | 5 ++ 4 files changed, 68 insertions(+), 1 deletion(-) create mode 100644 src/main/java/biomesoplenty/common/biome/overworld/BiomeGenMangrove.java diff --git a/src/main/java/biomesoplenty/api/biome/BOPBiomes.java b/src/main/java/biomesoplenty/api/biome/BOPBiomes.java index af9cfa7ee..d6cc50079 100644 --- a/src/main/java/biomesoplenty/api/biome/BOPBiomes.java +++ b/src/main/java/biomesoplenty/api/biome/BOPBiomes.java @@ -84,6 +84,7 @@ public class BOPBiomes public static Optional oasis = Optional.absent(); public static Optional coral_reef = Optional.absent(); public static Optional kelp_forest = Optional.absent(); + public static Optional mangrove = Optional.absent(); public static Optional origin_island = Optional.absent(); public static Optional tropical_island = Optional.absent(); public static Optional volcanic_island = Optional.absent(); diff --git a/src/main/java/biomesoplenty/common/biome/overworld/BiomeGenFlowerIsland.java b/src/main/java/biomesoplenty/common/biome/overworld/BiomeGenFlowerIsland.java index 7b1e76d24..61b71d8bb 100644 --- a/src/main/java/biomesoplenty/common/biome/overworld/BiomeGenFlowerIsland.java +++ b/src/main/java/biomesoplenty/common/biome/overworld/BiomeGenFlowerIsland.java @@ -41,7 +41,7 @@ public class BiomeGenFlowerIsland extends BOPBiome public BiomeGenFlowerIsland() { - super("Flower Island", new PropsBuilder("flower_island").withGuiColour(0x74D374).withTemperature(0.6F).withRainfall(0.8F)); + super("flower_island", new PropsBuilder("Flower Island").withGuiColour(0x74D374).withTemperature(0.6F).withRainfall(0.8F)); // terrain this.terrainSettings.avgHeight(70).heightVariation(10, 15).octaves(0, 0, 1, 1, 2, 2); diff --git a/src/main/java/biomesoplenty/common/biome/overworld/BiomeGenMangrove.java b/src/main/java/biomesoplenty/common/biome/overworld/BiomeGenMangrove.java new file mode 100644 index 000000000..a34937faa --- /dev/null +++ b/src/main/java/biomesoplenty/common/biome/overworld/BiomeGenMangrove.java @@ -0,0 +1,61 @@ +/******************************************************************************* + * 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.common.entities.EntityButterfly; +import biomesoplenty.common.enums.BOPFlowers; +import biomesoplenty.common.enums.BOPGems; +import biomesoplenty.common.enums.BOPPlants; +import biomesoplenty.common.world.BOPWorldSettings; +import biomesoplenty.common.world.feature.GeneratorFlora; +import biomesoplenty.common.world.feature.GeneratorGrass; +import biomesoplenty.common.world.feature.GeneratorOreSingle; +import net.minecraft.block.BlockFlower; +import net.minecraft.block.BlockTallGrass; +import net.minecraft.init.Blocks; + +public class BiomeGenMangrove extends BOPBiome +{ + public BiomeGenMangrove() + { + super("mangrove", new PropsBuilder("Mangrove").withTemperature(0.8F).withRainfall(0.8F).withGuiColour(7251289)); + + // terrain + this.terrainSettings.avgHeight(62).heightVariation(2, 2).octaves(0, 1, 2, 2, 1, 0); + + this.topBlock = Blocks.sand.getDefaultState(); + this.fillerBlock = Blocks.sand.getDefaultState(); + + this.canSpawnInBiome = false; + this.canGenerateVillages = false; + this.canGenerateRivers = false; + + this.spawnableCreatureList.clear(); + + this.beachBiomeLocation = null; + + clearWeights(); + + // 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("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/init/ModBiomes.java b/src/main/java/biomesoplenty/common/init/ModBiomes.java index 5c4ae60a5..6265e534b 100644 --- a/src/main/java/biomesoplenty/common/init/ModBiomes.java +++ b/src/main/java/biomesoplenty/common/init/ModBiomes.java @@ -53,6 +53,7 @@ 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; import static biomesoplenty.api.biome.BOPBiomes.lush_swamp; +import static biomesoplenty.api.biome.BOPBiomes.mangrove; import static biomesoplenty.api.biome.BOPBiomes.maple_woods; import static biomesoplenty.api.biome.BOPBiomes.marsh; import static biomesoplenty.api.biome.BOPBiomes.meadow; @@ -146,6 +147,7 @@ import biomesoplenty.common.biome.overworld.BiomeGenLandOfLakes; import biomesoplenty.common.biome.overworld.BiomeGenLavenderFields; import biomesoplenty.common.biome.overworld.BiomeGenLushDesert; import biomesoplenty.common.biome.overworld.BiomeGenLushSwamp; +import biomesoplenty.common.biome.overworld.BiomeGenMangrove; import biomesoplenty.common.biome.overworld.BiomeGenMapleWoods; import biomesoplenty.common.biome.overworld.BiomeGenMarsh; import biomesoplenty.common.biome.overworld.BiomeGenMeadow; @@ -392,6 +394,7 @@ public class ModBiomes implements BOPBiomes.IBiomeRegistry // island biomes + mangrove = registerBOPBiome(new BiomeGenMangrove()); origin_island = registerBOPBiome(new BiomeGenOriginIsland()); tropical_island = registerBOPBiome(new BiomeGenTropicalIsland()); volcanic_island = registerBOPBiome(new BiomeGenVolcanicIsland()); @@ -401,6 +404,7 @@ public class ModBiomes implements BOPBiomes.IBiomeRegistry addIslandBiome(tropical_island, 3); addIslandBiome(volcanic_island, 5); addIslandBiome(flower_island, 7); + addIslandBiome(mangrove, 10); } public static void initExtendedBiomes() @@ -500,6 +504,7 @@ public class ModBiomes implements BOPBiomes.IBiomeRegistry registerBiomeToDictionary(BOPBiomes.oasis, Type.SANDY, Type.LUSH, Type.JUNGLE, Type.HOT, Type.WET, Type.SPARSE); registerBiomeToDictionary(BOPBiomes.coral_reef, Type.WATER, Type.OCEAN); registerBiomeToDictionary(BOPBiomes.kelp_forest, Type.WATER, Type.OCEAN); + registerBiomeToDictionary(BOPBiomes.mangrove, Type.WATER, Type.OCEAN, Type.FOREST, Type.LUSH, Type.WET, Type.DENSE); registerBiomeToDictionary(BOPBiomes.tropical_island, Type.WATER, Type.OCEAN, Type.JUNGLE, Type.LUSH, Type.WET, Type.DENSE); registerBiomeToDictionary(BOPBiomes.volcanic_island, Type.WATER, Type.OCEAN, Type.DEAD, Type.WASTELAND, Type.MOUNTAIN, Type.HOT, Type.DRY); registerBiomeToDictionary(BOPBiomes.flower_island, Type.WATER, Type.OCEAN, Type.PLAINS, Type.LUSH, Type.DENSE, Type.MAGICAL);