From 197f584c21f7976b58272800ddb5dc545d06f3e6 Mon Sep 17 00:00:00 2001 From: Adubbz Date: Tue, 7 Apr 2015 23:48:31 +1000 Subject: [PATCH] Added the crag --- .../biomesoplenty/api/biome/BOPBiomes.java | 1 + .../common/biome/overworld/BiomeGenCrag.java | 49 +++++++++++++++++++ .../config/MiscConfigurationHandler.java | 5 ++ .../biomesoplenty/common/init/ModBiomes.java | 2 + 4 files changed, 57 insertions(+) create mode 100644 src/main/java/biomesoplenty/common/biome/overworld/BiomeGenCrag.java diff --git a/src/main/java/biomesoplenty/api/biome/BOPBiomes.java b/src/main/java/biomesoplenty/api/biome/BOPBiomes.java index 035163bfe..31bf1affb 100644 --- a/src/main/java/biomesoplenty/api/biome/BOPBiomes.java +++ b/src/main/java/biomesoplenty/api/biome/BOPBiomes.java @@ -16,4 +16,5 @@ public class BOPBiomes { public static Optional alps = Optional.absent(); public static Optional arctic = Optional.absent(); + public static Optional crag = Optional.absent(); } diff --git a/src/main/java/biomesoplenty/common/biome/overworld/BiomeGenCrag.java b/src/main/java/biomesoplenty/common/biome/overworld/BiomeGenCrag.java new file mode 100644 index 000000000..41a851556 --- /dev/null +++ b/src/main/java/biomesoplenty/common/biome/overworld/BiomeGenCrag.java @@ -0,0 +1,49 @@ +/******************************************************************************* + * Copyright 2015, 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.init.Blocks; +import net.minecraftforge.common.BiomeManager.BiomeType; +import biomesoplenty.api.biome.BOPBiome; +import biomesoplenty.api.biome.generation.GeneratorStage; +import biomesoplenty.api.block.BOPBlocks; +import biomesoplenty.common.config.MiscConfigurationHandler; +import biomesoplenty.common.world.feature.GeneratorOreSingle; + +public class BiomeGenCrag extends BOPBiome +{ + private static final Height biomeHeight = new Height(2.0F, 3.0F); + + public BiomeGenCrag() + { + this.setHeight(biomeHeight); + this.setColor(5209457); + this.setTemperatureRainfall(2.0F, 0.0F); + + this.addWeight(BiomeType.COOL, 3); + + this.spawnableCreatureList.clear(); + this.spawnableWaterCreatureList.clear(); + + this.topBlock = BOPBlocks.crag_rock.getDefaultState(); + this.fillerBlock = BOPBlocks.crag_rock.getDefaultState(); + this.waterColorMultiplier = 944693; + + this.addGenerator("emeralds", GeneratorStage.SAND, new GeneratorOreSingle(Blocks.emerald_ore.getDefaultState(), 12, 4, 32)); + } + + @Override + public int getSkyColorByTemp(float temperature) + { + if (MiscConfigurationHandler.skyColors) + return 4944498; + + return super.getSkyColorByTemp(temperature); + } +} diff --git a/src/main/java/biomesoplenty/common/config/MiscConfigurationHandler.java b/src/main/java/biomesoplenty/common/config/MiscConfigurationHandler.java index b8f1fc006..5ac52aa43 100644 --- a/src/main/java/biomesoplenty/common/config/MiscConfigurationHandler.java +++ b/src/main/java/biomesoplenty/common/config/MiscConfigurationHandler.java @@ -17,6 +17,9 @@ public class MiscConfigurationHandler { public static Configuration config; + //TODO: Remove this in favour of making it configurable per biome + public static boolean skyColors; + public static boolean useBoPWorldTypeDefault; public static boolean overrideTitlePanorama; @@ -28,6 +31,8 @@ public class MiscConfigurationHandler { config.load(); + skyColors = config.getBoolean("Enable Sky Colors", "Enhancements", true, "Use the built-in sky colours defined for various biomes."); + //TODO: Make this default to true once all biomes have been implemented useBoPWorldTypeDefault = config.getBoolean("Default to BoP World Type", "GUI Settings", false, "Use the Biomes O' Plenty World Type by default when selecting a world."); overrideTitlePanorama = config.getBoolean("Enable Biomes O\' Plenty Main Menu Panorama", "GUI Settings", true, "Override the main menu panorama and use ours instead (It\'s nicer!)"); diff --git a/src/main/java/biomesoplenty/common/init/ModBiomes.java b/src/main/java/biomesoplenty/common/init/ModBiomes.java index f1d0a1b03..dba641ede 100644 --- a/src/main/java/biomesoplenty/common/init/ModBiomes.java +++ b/src/main/java/biomesoplenty/common/init/ModBiomes.java @@ -19,6 +19,7 @@ import org.apache.commons.io.FileUtils; import biomesoplenty.common.biome.overworld.BiomeGenAlps; import biomesoplenty.common.biome.overworld.BiomeGenArctic; +import biomesoplenty.common.biome.overworld.BiomeGenCrag; import biomesoplenty.common.command.BOPCommand; import biomesoplenty.common.util.config.JsonBiome; import biomesoplenty.common.world.WorldTypeBOP; @@ -45,6 +46,7 @@ public class ModBiomes { alps = registerBiome(new BiomeGenAlps().setBiomeName("Alps"), "alps"); arctic = registerBiome(new BiomeGenArctic().setBiomeName("Arctic"), "arctic"); + crag = registerBiome(new BiomeGenCrag().setBiomeName("Crag"), "crag"); } private static void registerExternalBiomes()