From 67f02abc1538da8a762b2efc8ae44eee18522663 Mon Sep 17 00:00:00 2001 From: Forstride Date: Fri, 12 Feb 2016 19:58:55 -0500 Subject: [PATCH] Re-added Glacier as a sub-biome of the Ice Plains --- .../biomesoplenty/api/biome/BOPBiomes.java | 1 + .../biome/overworld/BiomeGenGlacier.java | 69 +++++++++++++++++++ .../biomesoplenty/common/init/ModBiomes.java | 5 ++ 3 files changed, 75 insertions(+) create mode 100644 src/main/java/biomesoplenty/common/biome/overworld/BiomeGenGlacier.java diff --git a/src/main/java/biomesoplenty/api/biome/BOPBiomes.java b/src/main/java/biomesoplenty/api/biome/BOPBiomes.java index 6e304b1e8..f16d070ab 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 glacier = Optional.absent(); public static Optional oasis = Optional.absent(); public static Optional coral_reef = Optional.absent(); public static Optional kelp_forest = Optional.absent(); diff --git a/src/main/java/biomesoplenty/common/biome/overworld/BiomeGenGlacier.java b/src/main/java/biomesoplenty/common/biome/overworld/BiomeGenGlacier.java new file mode 100644 index 000000000..1e739425b --- /dev/null +++ b/src/main/java/biomesoplenty/common/biome/overworld/BiomeGenGlacier.java @@ -0,0 +1,69 @@ +/******************************************************************************* + * 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; +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.BlockBOPDirt; +import biomesoplenty.common.block.BlockBOPDoublePlant; +import biomesoplenty.common.block.BlockBOPGrass; +import biomesoplenty.common.block.BlockBOPCoral; +import biomesoplenty.common.entities.EntitySnail; +import biomesoplenty.common.enums.BOPClimates; +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.*; + +public class BiomeGenGlacier extends BOPBiome +{ + + public BiomeGenGlacier() + { + + // terrain + this.terrainSettings.avgHeight(88).heightVariation(8, 10).octaves(0, 1, 1, 3, 1, 0); + + this.setTemperatureRainfall(-0.5F, 0.2F); + this.setColor(11582425); + + this.topBlock = Blocks.ice.getDefaultState(); + this.fillerBlock = BOPBlocks.hard_ice.getDefaultState(); + + this.avgDirtDepth = 16; + + this.canSpawnInBiome = false; + this.canGenerateVillages = false; + this.canGenerateRivers = false; + + this.spawnableCreatureList.clear(); + + clearWeights(); + + // 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("malachite");} + } + +} diff --git a/src/main/java/biomesoplenty/common/init/ModBiomes.java b/src/main/java/biomesoplenty/common/init/ModBiomes.java index 75a175e2c..d356e6dcc 100644 --- a/src/main/java/biomesoplenty/common/init/ModBiomes.java +++ b/src/main/java/biomesoplenty/common/init/ModBiomes.java @@ -41,6 +41,7 @@ import static biomesoplenty.api.biome.BOPBiomes.forest_hills_extension; import static biomesoplenty.api.biome.BOPBiomes.frozen_desert; import static biomesoplenty.api.biome.BOPBiomes.fungi_forest; import static biomesoplenty.api.biome.BOPBiomes.garden; +import static biomesoplenty.api.biome.BOPBiomes.glacier; import static biomesoplenty.api.biome.BOPBiomes.grassland; import static biomesoplenty.api.biome.BOPBiomes.gravel_beach; import static biomesoplenty.api.biome.BOPBiomes.grove; @@ -138,6 +139,7 @@ import biomesoplenty.common.biome.overworld.BiomeGenFen; import biomesoplenty.common.biome.overworld.BiomeGenFlowerField; import biomesoplenty.common.biome.overworld.BiomeGenFungiForest; import biomesoplenty.common.biome.overworld.BiomeGenGarden; +import biomesoplenty.common.biome.overworld.BiomeGenGlacier; import biomesoplenty.common.biome.overworld.BiomeGenGrassland; import biomesoplenty.common.biome.overworld.BiomeGenGravelBeach; import biomesoplenty.common.biome.overworld.BiomeGenGrove; @@ -416,11 +418,13 @@ 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"); + glacier = registerBOPBiome(new BiomeGenGlacier(), "Glacier"); oasis = registerBOPBiome(new BiomeGenOasis(), "Oasis"); coral_reef = registerBOPBiome(new BiomeGenCoralReef(), "Coral Reef"); kelp_forest = registerBOPBiome(new BiomeGenKelpForest(), "Kelp Forest"); setSubBiome(canyon, canyon_ravine); + setSubBiome(Optional.of(BiomeGenBase.icePlains), BOPBiomes.glacier); setSubBiome(Optional.of(BiomeGenBase.desert), BOPBiomes.oasis); setSubBiome(Optional.of(BiomeGenBase.ocean), BOPBiomes.coral_reef); setSubBiome(Optional.of(BiomeGenBase.ocean), BOPBiomes.kelp_forest); @@ -532,6 +536,7 @@ public class ModBiomes implements BOPBiomes.IBiomeRegistry // edge-biomes, sub-biomes and mutated-biomes registerBiomeToDictionary(BOPBiomes.mountain_foothills, Type.HILLS, Type.MOUNTAIN, Type.FOREST, Type.DRY, Type.SPARSE); registerBiomeToDictionary(BOPBiomes.canyon_ravine, Type.MOUNTAIN, Type.DRY, Type.HILLS, Type.HOT, Type.SPARSE); + registerBiomeToDictionary(BOPBiomes.glacier, Type.SNOWY, Type.WASTELAND, Type.COLD); 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);