From 8f6cda25cd0a133d3c0f9818cf42d3cfea2121d3 Mon Sep 17 00:00:00 2001 From: Forstride Date: Wed, 3 Feb 2016 17:03:30 -0500 Subject: [PATCH] Re-added Coral Reef, tweaked Crag biome --- .../biomesoplenty/api/biome/BOPBiomes.java | 1 + .../biome/overworld/BiomeGenCoralReef.java | 64 +++++++++++++++++++ .../common/biome/overworld/BiomeGenCrag.java | 2 + .../biomesoplenty/common/init/ModBiomes.java | 5 ++ 4 files changed, 72 insertions(+) create mode 100644 src/main/java/biomesoplenty/common/biome/overworld/BiomeGenCoralReef.java diff --git a/src/main/java/biomesoplenty/api/biome/BOPBiomes.java b/src/main/java/biomesoplenty/api/biome/BOPBiomes.java index 90fe664d8..3aa1b271d 100644 --- a/src/main/java/biomesoplenty/api/biome/BOPBiomes.java +++ b/src/main/java/biomesoplenty/api/biome/BOPBiomes.java @@ -79,6 +79,7 @@ public class BOPBiomes // edge-biomes, sub-biomes and mutated-biomes public static Optional mountain_foothills = Optional.absent(); public static Optional canyon_ravine = Optional.absent(); + public static Optional coral_reef = 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 new file mode 100644 index 000000000..bad09135e --- /dev/null +++ b/src/main/java/biomesoplenty/common/biome/overworld/BiomeGenCoralReef.java @@ -0,0 +1,64 @@ +/******************************************************************************* + * 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.init.Blocks; +import net.minecraft.util.BlockPos; +import net.minecraft.world.biome.BiomeGenBase.SpawnListEntry; +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.entities.EntityButterfly; +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.enums.BOPWoods; +import biomesoplenty.common.util.biome.GeneratorUtils.ScatterYMethod; +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.tree.GeneratorBasicTree; +import biomesoplenty.common.world.feature.tree.GeneratorBigTree; + +public class BiomeGenCoralReef extends BOPBiome +{ + public BiomeGenCoralReef() + { + // terrain + this.terrainSettings.avgHeight(50).heightVariation(5, 10); + + this.setColor(18285); + + this.canSpawnInBiome = false; + + clearWeights(); + + // coral + this.addGenerator("pink_coral", GeneratorStage.LILYPAD, (new GeneratorFlora.Builder()).amountPerChunk(15.0F).replace(Blocks.water).with(BOPBlocks.coral.getDefaultState().withProperty(BlockBOPCoral.VARIANT, BlockBOPCoral.CoralType.PINK)).scatterYMethod(ScatterYMethod.AT_GROUND).create()); + this.addGenerator("orange_coral", GeneratorStage.LILYPAD, (new GeneratorFlora.Builder()).amountPerChunk(15.0F).replace(Blocks.water).with(BOPBlocks.coral.getDefaultState().withProperty(BlockBOPCoral.VARIANT, BlockBOPCoral.CoralType.ORANGE)).scatterYMethod(ScatterYMethod.AT_GROUND).create()); + 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()); + + // 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");} + } +} diff --git a/src/main/java/biomesoplenty/common/biome/overworld/BiomeGenCrag.java b/src/main/java/biomesoplenty/common/biome/overworld/BiomeGenCrag.java index 5d2ac6268..94d1dfe8e 100644 --- a/src/main/java/biomesoplenty/common/biome/overworld/BiomeGenCrag.java +++ b/src/main/java/biomesoplenty/common/biome/overworld/BiomeGenCrag.java @@ -40,6 +40,8 @@ public class BiomeGenCrag extends BOPBiome this.waterColorMultiplier = 944693; this.skyColor = 4944498; + this.avgDirtDepth = 8; + // gem this.addGenerator("emeralds", GeneratorStage.SAND, (new GeneratorOreSingle.Builder()).amountPerChunk(12).with(Blocks.emerald_ore.getDefaultState()).create()); diff --git a/src/main/java/biomesoplenty/common/init/ModBiomes.java b/src/main/java/biomesoplenty/common/init/ModBiomes.java index 3ae96e50d..313862e18 100644 --- a/src/main/java/biomesoplenty/common/init/ModBiomes.java +++ b/src/main/java/biomesoplenty/common/init/ModBiomes.java @@ -21,6 +21,7 @@ import static biomesoplenty.api.biome.BOPBiomes.chaparral; import static biomesoplenty.api.biome.BOPBiomes.cherry_blossom_grove; import static biomesoplenty.api.biome.BOPBiomes.cold_desert; import static biomesoplenty.api.biome.BOPBiomes.coniferous_forest; +import static biomesoplenty.api.biome.BOPBiomes.coral_reef; import static biomesoplenty.api.biome.BOPBiomes.crag; import static biomesoplenty.api.biome.BOPBiomes.dead_forest; import static biomesoplenty.api.biome.BOPBiomes.dead_swamp; @@ -109,6 +110,7 @@ import biomesoplenty.common.biome.overworld.BiomeGenChaparral; import biomesoplenty.common.biome.overworld.BiomeGenCherryBlossomGrove; import biomesoplenty.common.biome.overworld.BiomeGenColdDesert; import biomesoplenty.common.biome.overworld.BiomeGenConiferousForest; +import biomesoplenty.common.biome.overworld.BiomeGenCoralReef; import biomesoplenty.common.biome.overworld.BiomeGenCrag; import biomesoplenty.common.biome.overworld.BiomeGenDeadForest; import biomesoplenty.common.biome.overworld.BiomeGenDeadSwamp; @@ -387,8 +389,10 @@ 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"); setSubBiome(canyon, canyon_ravine); + setSubBiome(BiomeGenBase.ocean, BOPBiomes.coral_reef.get()); } @@ -457,6 +461,7 @@ public class ModBiomes implements BOPBiomes.IBiomeRegistry // edge-biomes, sub-biomes and mutated-biomes 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); }