From 91e57c1591595e4bbf807b1bcc8938073d756373 Mon Sep 17 00:00:00 2001 From: Matt Caughey Date: Sun, 17 Jan 2016 21:11:20 -0500 Subject: [PATCH] Re-added Maple Woods biome --- .../biomesoplenty/api/biome/BOPBiomes.java | 1 + .../biome/overworld/BiomeGenMapleWoods.java | 83 +++++++++++++++++++ .../overworld/BiomeGenSeasonalForest.java | 2 +- .../biomesoplenty/common/init/ModBiomes.java | 4 + 4 files changed, 89 insertions(+), 1 deletion(-) create mode 100644 src/main/java/biomesoplenty/common/biome/overworld/BiomeGenMapleWoods.java diff --git a/src/main/java/biomesoplenty/api/biome/BOPBiomes.java b/src/main/java/biomesoplenty/api/biome/BOPBiomes.java index 106ae7bb5..53367e293 100644 --- a/src/main/java/biomesoplenty/api/biome/BOPBiomes.java +++ b/src/main/java/biomesoplenty/api/biome/BOPBiomes.java @@ -47,6 +47,7 @@ public class BOPBiomes public static Optional highland = Optional.absent(); public static Optional jade_cliffs = Optional.absent(); public static Optional lavender_fields = Optional.absent(); + public static Optional maple_woods = Optional.absent(); public static Optional marsh = Optional.absent(); public static Optional moor = Optional.absent(); public static Optional mountain = Optional.absent(); diff --git a/src/main/java/biomesoplenty/common/biome/overworld/BiomeGenMapleWoods.java b/src/main/java/biomesoplenty/common/biome/overworld/BiomeGenMapleWoods.java new file mode 100644 index 000000000..acf578363 --- /dev/null +++ b/src/main/java/biomesoplenty/common/biome/overworld/BiomeGenMapleWoods.java @@ -0,0 +1,83 @@ +package biomesoplenty.common.biome.overworld; + +import net.minecraft.block.BlockDoublePlant; +import net.minecraft.block.BlockPlanks; +import net.minecraft.block.BlockTallGrass; +import net.minecraft.entity.passive.EntityWolf; +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.common.block.BlockBOPDoublePlant; +import biomesoplenty.common.block.BlockBOPLilypad; +import biomesoplenty.common.enums.BOPClimates; +import biomesoplenty.common.enums.BOPFlowers; +import biomesoplenty.common.enums.BOPGems; +import biomesoplenty.common.enums.BOPPlants; +import biomesoplenty.common.enums.BOPTrees; +import biomesoplenty.common.world.BOPWorldSettings; +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 biomesoplenty.common.world.feature.GeneratorWaterside; +import biomesoplenty.common.world.feature.tree.GeneratorBasicTree; +import biomesoplenty.common.world.feature.tree.GeneratorBush; +import biomesoplenty.common.world.feature.tree.GeneratorTaigaTree; + +public class BiomeGenMapleWoods extends BOPBiome +{ + public BiomeGenMapleWoods() + { + // terrain + this.terrainSettings.avgHeight(70).heightVariation(10, 25); + + this.setColor(0x6AA369); + this.setTemperatureRainfall(0.2F, 0.8F); + this.addWeight(BOPClimates.COOL_TEMPERATE, 10); + + + this.spawnableCreatureList.add(new SpawnListEntry(EntityWolf.class, 5, 4, 4)); + + // gravel + this.addGenerator("gravel", GeneratorStage.SAND_PASS2, (new GeneratorWaterside.Builder()).amountPerChunk(6).maxRadius(7).with(Blocks.gravel.getDefaultState()).create()); + + // trees & logs + GeneratorWeighted treeGenerator = new GeneratorWeighted(20); + this.addGenerator("trees", GeneratorStage.TREE, treeGenerator); + treeGenerator.add("maple", 4, (new GeneratorBasicTree.Builder()).log(BlockPlanks.EnumType.OAK).leaves(BOPTrees.MAPLE).minHeight(5).maxHeight(10).create()); + treeGenerator.add("spruce", 4, (new GeneratorTaigaTree.Builder()).minHeight(10).maxHeight(19).create()); // TODO: implement pine cones + + // 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()); + + // flowers + GeneratorWeighted flowerGenerator = new GeneratorWeighted(0.1F); + this.addGenerator("flowers", GeneratorStage.GRASS, flowerGenerator); + flowerGenerator.add("violet", 1, (new GeneratorFlora.Builder().with(BOPFlowers.VIOLET).create())); + + // other plants + this.addGenerator("shrubs", GeneratorStage.FLOWERS,(new GeneratorFlora.Builder()).amountPerChunk(1.0F).with(BOPPlants.SHRUB).create()); + this.addGenerator("dead_leaf_piles", GeneratorStage.FLOWERS,(new GeneratorFlora.Builder()).amountPerChunk(8.0F).with(BOPPlants.DEADLEAFPILE).create()); + this.addGenerator("poison_ivy", GeneratorStage.FLOWERS,(new GeneratorFlora.Builder()).amountPerChunk(0.2F).with(BOPPlants.POISONIVY).create()); + + // water plants + this.addGenerator("duckweed", GeneratorStage.LILYPAD, (new GeneratorFlora.Builder()).amountPerChunk(1.0F).with(BlockBOPLilypad.LilypadType.DUCKWEED).generationAttempts(32).create()); + this.addGenerator("water_reeds", GeneratorStage.LILYPAD, (new GeneratorFlora.Builder()).amountPerChunk(2.0F).with(BOPPlants.REED).generationAttempts(32).create()); + + // gem + this.addGenerator("tanzanite", GeneratorStage.SAND, (new GeneratorOreSingle.Builder()).amountPerChunk(12).with(BOPGems.TANZANITE).create()); + + } + + @Override + public void applySettings(BOPWorldSettings settings) + { + if (!settings.generateBopGems) {this.removeGenerator("tanzanite");} + } +} diff --git a/src/main/java/biomesoplenty/common/biome/overworld/BiomeGenSeasonalForest.java b/src/main/java/biomesoplenty/common/biome/overworld/BiomeGenSeasonalForest.java index d6fe60cd0..56d385e1b 100644 --- a/src/main/java/biomesoplenty/common/biome/overworld/BiomeGenSeasonalForest.java +++ b/src/main/java/biomesoplenty/common/biome/overworld/BiomeGenSeasonalForest.java @@ -44,7 +44,7 @@ public class BiomeGenSeasonalForest extends BOPBiome treeGenerator.add("large_oak", 1, (new GeneratorBigTree.Builder()).log(BlockPlanks.EnumType.OAK).leaves(BlockPlanks.EnumType.OAK).create()); treeGenerator.add("oak", 1, (new GeneratorBasicTree.Builder()).minHeight(8).maxHeight(12).create()); treeGenerator.add("yellow_autumn", 4, (new GeneratorBasicTree.Builder()).log(BlockPlanks.EnumType.BIRCH).leaves(BOPTrees.YELLOW_AUTUMN).minHeight(5).maxHeight(8).create()); - treeGenerator.add("red_autumn", 4, (new GeneratorBasicTree.Builder()).log(BlockPlanks.EnumType.OAK).leaves(BOPTrees.MAPLE).minHeight(5).maxHeight(8).create()); + treeGenerator.add("maple", 4, (new GeneratorBasicTree.Builder()).log(BlockPlanks.EnumType.OAK).leaves(BOPTrees.MAPLE).minHeight(5).maxHeight(8).create()); treeGenerator.add("orange_autumn", 5, (new GeneratorBasicTree.Builder()).log(BlockPlanks.EnumType.DARK_OAK).leaves(BOPTrees.ORANGE_AUTUMN).minHeight(5).maxHeight(8).create()); treeGenerator.add("dying_tree", 2, (new GeneratorBigTree.Builder()).minHeight(5).maxHeight(12).foliageHeight(2).leaves(BOPTrees.DEAD).create()); diff --git a/src/main/java/biomesoplenty/common/init/ModBiomes.java b/src/main/java/biomesoplenty/common/init/ModBiomes.java index d03caef3a..1b399e413 100644 --- a/src/main/java/biomesoplenty/common/init/ModBiomes.java +++ b/src/main/java/biomesoplenty/common/init/ModBiomes.java @@ -47,6 +47,7 @@ import static biomesoplenty.api.biome.BOPBiomes.ice_plains_extension; import static biomesoplenty.api.biome.BOPBiomes.jade_cliffs; import static biomesoplenty.api.biome.BOPBiomes.jungle_extension; import static biomesoplenty.api.biome.BOPBiomes.lavender_fields; +import static biomesoplenty.api.biome.BOPBiomes.maple_woods; import static biomesoplenty.api.biome.BOPBiomes.marsh; import static biomesoplenty.api.biome.BOPBiomes.mesa_extension; import static biomesoplenty.api.biome.BOPBiomes.moor; @@ -119,6 +120,7 @@ import biomesoplenty.common.biome.overworld.BiomeGenHeathland; import biomesoplenty.common.biome.overworld.BiomeGenHighland; import biomesoplenty.common.biome.overworld.BiomeGenJadeCliffs; import biomesoplenty.common.biome.overworld.BiomeGenLavenderFields; +import biomesoplenty.common.biome.overworld.BiomeGenMapleWoods; import biomesoplenty.common.biome.overworld.BiomeGenMarsh; import biomesoplenty.common.biome.overworld.BiomeGenMoor; import biomesoplenty.common.biome.overworld.BiomeGenMountain; @@ -333,6 +335,7 @@ public class ModBiomes implements BOPBiomes.IBiomeRegistry highland = registerBOPBiome(new BiomeGenHighland(), "Highland"); jade_cliffs = registerBOPBiome(new BiomeGenJadeCliffs(), "Jade Cliffs"); lavender_fields = registerBOPBiome(new BiomeGenLavenderFields(), "Lavender Fields"); + maple_woods = registerBOPBiome(new BiomeGenMapleWoods(), "Maple Woods"); marsh = registerBOPBiome(new BiomeGenMarsh(), "Marsh"); moor = registerBOPBiome(new BiomeGenMoor(), "Moor"); mountain = registerBOPBiome(new BiomeGenMountain(BiomeGenMountain.MountainType.PEAKS), "Mountain"); @@ -397,6 +400,7 @@ public class ModBiomes implements BOPBiomes.IBiomeRegistry registerBiomeToDictionary(BOPBiomes.highland, Type.HILLS, Type.MOUNTAIN, Type.SPARSE); registerBiomeToDictionary(BOPBiomes.jade_cliffs, Type.FOREST, Type.MOUNTAIN, Type.DENSE); registerBiomeToDictionary(BOPBiomes.lavender_fields, Type.MAGICAL, Type.PLAINS, Type.LUSH, Type.SPARSE); + registerBiomeToDictionary(BOPBiomes.maple_woods, Type.FOREST, Type.DENSE, Type.CONIFEROUS, Type.COLD); registerBiomeToDictionary(BOPBiomes.marsh, Type.SWAMP, Type.WATER, Type.WET, Type.SPARSE, Type.LUSH); registerBiomeToDictionary(BOPBiomes.moor, Type.HILLS, Type.SWAMP, Type.SPARSE, Type.WET); registerBiomeToDictionary(BOPBiomes.mountain, Type.MOUNTAIN, Type.FOREST, Type.DRY);