From a1d0345d3bdf84933cea7644bc508461ab2c9ffe Mon Sep 17 00:00:00 2001 From: Matt Caughey Date: Tue, 13 May 2014 15:25:38 -0400 Subject: [PATCH] Added the Alps Forest and Meadow Forest sub biomes --- .../biomesoplenty/api/content/BOPCBiomes.java | 2 + .../common/biomes/overworld/BiomeGenAlps.java | 2 +- .../subbiomes/BiomeGenAlpsForest.java | 73 +++++++++++++ .../subbiomes/BiomeGenMeadowForest.java | 100 ++++++++++++++++++ .../biomesoplenty/common/core/BOPBiomes.java | 8 +- .../world/layer/GenLayerRiverMixBOP.java | 2 +- 6 files changed, 184 insertions(+), 3 deletions(-) create mode 100644 src/main/java/biomesoplenty/common/biomes/overworld/subbiomes/BiomeGenAlpsForest.java create mode 100644 src/main/java/biomesoplenty/common/biomes/overworld/subbiomes/BiomeGenMeadowForest.java diff --git a/src/main/java/biomesoplenty/api/content/BOPCBiomes.java b/src/main/java/biomesoplenty/api/content/BOPCBiomes.java index 91d4f7bc4..986677612 100644 --- a/src/main/java/biomesoplenty/api/content/BOPCBiomes.java +++ b/src/main/java/biomesoplenty/api/content/BOPCBiomes.java @@ -70,6 +70,8 @@ public class BOPCBiomes public static BiomeGenBase quagmire; public static BiomeGenBase tropics; public static BiomeGenBase volcano; + public static BiomeGenBase meadowForest; + public static BiomeGenBase alpsForest; //Ocean Biomes public static BiomeGenBase kelpForest; diff --git a/src/main/java/biomesoplenty/common/biomes/overworld/BiomeGenAlps.java b/src/main/java/biomesoplenty/common/biomes/overworld/BiomeGenAlps.java index 3b7d92e60..96f0392b9 100644 --- a/src/main/java/biomesoplenty/common/biomes/overworld/BiomeGenAlps.java +++ b/src/main/java/biomesoplenty/common/biomes/overworld/BiomeGenAlps.java @@ -10,7 +10,7 @@ import java.util.Random; public class BiomeGenAlps extends BOPBiome { - private static final Height biomeHeight = new Height(0.5F, 1.5F); + private static final Height biomeHeight = new Height(8.0F, 0.025F); public BiomeGenAlps(int id) { diff --git a/src/main/java/biomesoplenty/common/biomes/overworld/subbiomes/BiomeGenAlpsForest.java b/src/main/java/biomesoplenty/common/biomes/overworld/subbiomes/BiomeGenAlpsForest.java new file mode 100644 index 000000000..806c70960 --- /dev/null +++ b/src/main/java/biomesoplenty/common/biomes/overworld/subbiomes/BiomeGenAlpsForest.java @@ -0,0 +1,73 @@ +package biomesoplenty.common.biomes.overworld.subbiomes; + +import java.util.Random; + +import net.minecraft.block.Block; +import net.minecraft.init.Blocks; +import net.minecraft.world.World; +import net.minecraft.world.biome.BiomeGenBase.Height; +import net.minecraft.world.gen.feature.WorldGenAbstractTree; +import biomesoplenty.api.BOPBlockHelper; +import biomesoplenty.common.biomes.BOPSubBiome; +import biomesoplenty.common.world.features.WorldGenBOPTallGrass; +import biomesoplenty.common.world.features.trees.WorldGenBOPTaiga2; + +public class BiomeGenAlpsForest extends BOPSubBiome +{ + private static final Height biomeHeight = new Height(0.6F, 1.2F); + + public BiomeGenAlpsForest(int id) + { + super(id); + + this.zoom = 0.25D; + this.threshold = 0.25D; + + this.setHeight(biomeHeight); + this.setColor(8034682); + this.setEnableSnow(); + this.setTemperatureRainfall(0.0F, 0.5F); + + this.theBiomeDecorator.treesPerChunk = 12; + this.theBiomeDecorator.flowersPerChunk = -999; + this.theBiomeDecorator.grassPerChunk = 5; + this.theBiomeDecorator.sandPerChunk = -999; + this.theBiomeDecorator.sandPerChunk2 = -999; + + this.bopWorldFeatures.setFeature("bopGrassPerChunk", 5); + + this.bopWorldFeatures.weightedGrassGen.put(new WorldGenBOPTallGrass(Blocks.tallgrass, 1), 1D); + this.bopWorldFeatures.weightedGrassGen.put(new WorldGenBOPTallGrass(BOPBlockHelper.get("foliage"), 1), 0.5D); + this.bopWorldFeatures.weightedGrassGen.put(new WorldGenBOPTallGrass(BOPBlockHelper.get("foliage"), 2), 0.5D); + this.bopWorldFeatures.weightedGrassGen.put(new WorldGenBOPTallGrass(BOPBlockHelper.get("foliage"), 10), 0.5D); + this.bopWorldFeatures.weightedGrassGen.put(new WorldGenBOPTallGrass(BOPBlockHelper.get("foliage"), 11), 0.5D); + } + + @Override + //TODO: getRandomWorldGenForTrees() + public WorldGenAbstractTree func_150567_a(Random random) + { + return new WorldGenBOPTaiga2(Blocks.log, Blocks.leaves, 1, 1, false, 6, 4, 0); + } + + @Override + public void decorate(World world, Random random, int chunkX, int chunkZ) + { + super.decorate(world, random, chunkX, chunkZ); + int var5 = 12 + random.nextInt(6); + + for (int var6 = 0; var6 < var5; ++var6) + { + int x = chunkX + random.nextInt(16); + int y = random.nextInt(28) + 4; + int z = chunkZ + random.nextInt(16); + + Block block = world.getBlock(x, y, z); + + if (block != null && block.isReplaceableOreGen(world, x, y, z, Blocks.stone)) + { + world.setBlock(x, y, z, BOPBlockHelper.get("gemOre"), 8, 2); + } + } + } +} diff --git a/src/main/java/biomesoplenty/common/biomes/overworld/subbiomes/BiomeGenMeadowForest.java b/src/main/java/biomesoplenty/common/biomes/overworld/subbiomes/BiomeGenMeadowForest.java new file mode 100644 index 000000000..a285e8547 --- /dev/null +++ b/src/main/java/biomesoplenty/common/biomes/overworld/subbiomes/BiomeGenMeadowForest.java @@ -0,0 +1,100 @@ +package biomesoplenty.common.biomes.overworld.subbiomes; + +import java.util.Random; + +import net.minecraft.block.Block; +import net.minecraft.entity.passive.EntityHorse; +import net.minecraft.init.Blocks; +import net.minecraft.world.World; +import net.minecraft.world.biome.BiomeGenBase.SpawnListEntry; +import net.minecraft.world.gen.feature.WorldGenAbstractTree; +import biomesoplenty.api.BOPBlockHelper; +import biomesoplenty.common.biomes.BOPSubBiome; +import biomesoplenty.common.world.features.WorldGenBOPDoubleFlora; +import biomesoplenty.common.world.features.WorldGenBOPFlora; +import biomesoplenty.common.world.features.WorldGenBOPTallGrass; +import biomesoplenty.common.world.features.trees.WorldGenBOPShrub; +import biomesoplenty.common.world.features.trees.WorldGenBOPTaiga2; + +public class BiomeGenMeadowForest extends BOPSubBiome +{ + public BiomeGenMeadowForest(int id) + { + super(id); + + this.zoom = 0.25D; + this.threshold = 0.25D; + + //TODO: setColor() + this.setColor(5543515); + this.setTemperatureRainfall(0.7F, 0.7F); + + this.spawnableCreatureList.add(new SpawnListEntry(EntityHorse.class, 5, 2, 6)); + + this.theBiomeDecorator.treesPerChunk = 8; + this.theBiomeDecorator.grassPerChunk = 10; + this.theBiomeDecorator.sandPerChunk = -999; + this.theBiomeDecorator.sandPerChunk2 = -999; + this.theBiomeDecorator.mushroomsPerChunk = 2; + this.theBiomeDecorator.flowersPerChunk = 5; + + this.bopWorldFeatures.setFeature("bopFlowersPerChunk", 7); + this.bopWorldFeatures.setFeature("wildCarrotsPerChunk", 1); + this.bopWorldFeatures.setFeature("shrubsPerChunk", 2); + this.bopWorldFeatures.setFeature("cloverPatchesPerChunk", 5); + this.bopWorldFeatures.setFeature("seaweedPerChunk", 5); + this.bopWorldFeatures.setFeature("generatePumpkins", false); + this.bopWorldFeatures.setFeature("algaePerChunk", 2); + + this.bopWorldFeatures.setFeature("bopGrassPerChunk", 5); + + this.bopWorldFeatures.weightedFlowerGen.put(new WorldGenBOPFlora(BOPBlockHelper.get("flowers"), 0), 10); + this.bopWorldFeatures.weightedFlowerGen.put(new WorldGenBOPFlora(BOPBlockHelper.get("flowers"), 4), 8); + + this.bopWorldFeatures.weightedGrassGen.put(new WorldGenBOPTallGrass(BOPBlockHelper.get("foliage"), 10), 0.5D); + this.bopWorldFeatures.weightedGrassGen.put(new WorldGenBOPTallGrass(BOPBlockHelper.get("foliage"), 11), 0.5D); + this.bopWorldFeatures.weightedGrassGen.put(new WorldGenBOPTallGrass(Blocks.tallgrass, 1), 1D); + } + + @Override + //TODO: getRandomWorldGenForTrees() + public WorldGenAbstractTree func_150567_a(Random random) + { + return new WorldGenBOPTaiga2(Blocks.log, Blocks.leaves, 1, 1, false, 6, 4, 0); + } + + @Override + public void decorate(World world, Random random, int chunkX, int chunkZ) + { + super.decorate(world, random, chunkX, chunkZ); + int var5 = 12 + random.nextInt(6); + + for (int var6 = 0; var6 < var5; ++var6) + { + int x = chunkX + random.nextInt(16); + int y = random.nextInt(28) + 4; + int z = chunkZ + random.nextInt(16); + + Block block = world.getBlock(x, y, z); + + if (block != null && block.isReplaceableOreGen(world, x, y, z, Blocks.stone)) + { + world.setBlock(x, y, z, BOPBlockHelper.get("gemOre"), 4, 2); + } + } + } + + @Override + //TODO: getBiomeGrassColor() + public int getBiomeGrassColor(int p_150558_1_, int p_150558_2_, int p_150558_3_) + { + return 6533741; + } + + @Override + //TODO: getBiomeFoliageColor() + public int getBiomeFoliageColor(int x, int y, int z) + { + return 6533741; + } +} diff --git a/src/main/java/biomesoplenty/common/core/BOPBiomes.java b/src/main/java/biomesoplenty/common/core/BOPBiomes.java index b6cb68aa0..d9a73a91b 100644 --- a/src/main/java/biomesoplenty/common/core/BOPBiomes.java +++ b/src/main/java/biomesoplenty/common/core/BOPBiomes.java @@ -1,6 +1,7 @@ package biomesoplenty.common.core; import static biomesoplenty.api.content.BOPCBiomes.alps; +import static biomesoplenty.api.content.BOPCBiomes.alpsForest; import static biomesoplenty.api.content.BOPCBiomes.arctic; import static biomesoplenty.api.content.BOPCBiomes.bambooForest; import static biomesoplenty.api.content.BOPCBiomes.bayou; @@ -36,6 +37,7 @@ import static biomesoplenty.api.content.BOPCBiomes.lushSwamp; import static biomesoplenty.api.content.BOPCBiomes.mapleWoods; import static biomesoplenty.api.content.BOPCBiomes.marsh; import static biomesoplenty.api.content.BOPCBiomes.meadow; +import static biomesoplenty.api.content.BOPCBiomes.meadowForest; import static biomesoplenty.api.content.BOPCBiomes.moor; import static biomesoplenty.api.content.BOPCBiomes.mountain; import static biomesoplenty.api.content.BOPCBiomes.mysticGrove; @@ -147,7 +149,9 @@ import biomesoplenty.common.biomes.overworld.BiomeGenTundra; import biomesoplenty.common.biomes.overworld.BiomeGenWasteland; import biomesoplenty.common.biomes.overworld.BiomeGenWetland; import biomesoplenty.common.biomes.overworld.BiomeGenWoodland; +import biomesoplenty.common.biomes.overworld.subbiomes.BiomeGenAlpsForest; import biomesoplenty.common.biomes.overworld.subbiomes.BiomeGenGlacier; +import biomesoplenty.common.biomes.overworld.subbiomes.BiomeGenMeadowForest; import biomesoplenty.common.biomes.overworld.subbiomes.BiomeGenOasis; import biomesoplenty.common.biomes.overworld.subbiomes.BiomeGenQuagmire; import biomesoplenty.common.biomes.overworld.subbiomes.BiomeGenScrubland; @@ -197,7 +201,7 @@ public class BOPBiomes private static void registerBiomes() { - alps = registerOverworldBiome(BiomeGenAlps.class, "Alps", TemperatureType.ICY, 5); + onlyBiome = alps = registerOverworldBiome(BiomeGenAlps.class, "Alps", TemperatureType.ICY, 5); arctic = registerOverworldBiome(BiomeGenArctic.class, "Arctic", TemperatureType.ICY, 10); bambooForest = registerOverworldBiome(BiomeGenBambooForest.class, "Bamboo Forest", TemperatureType.HOT, 5); bayou = registerOverworldBiome(BiomeGenBayou.class, "Bayou", TemperatureType.WARM, 10); @@ -260,6 +264,8 @@ public class BOPBiomes oasis = registerOverworldSubBiome(BiomeGenOasis.class, "Oasis", 10, BiomeGenBase.desert.biomeID); quagmire = registerOverworldSubBiome(BiomeGenQuagmire.class, "Quagmire", 10, sludgepit.biomeID); silkglades = registerOverworldSubBiome(BiomeGenSilkglades.class, "Silkglades", 10, sludgepit.biomeID); + meadowForest = registerOverworldSubBiome(BiomeGenMeadowForest.class, "Meadow Forest", 10, meadow.biomeID); + alpsForest = registerOverworldSubBiome(BiomeGenAlpsForest.class, "Alps Forest", 10, alps.biomeID); //Ocean Biomes volcano = registerOverworldSubBiome(BiomeGenVolcano.class, "Volcano", 10, BiomeGenBase.ocean.biomeID, BiomeGenBase.deepOcean.biomeID); diff --git a/src/main/java/biomesoplenty/common/world/layer/GenLayerRiverMixBOP.java b/src/main/java/biomesoplenty/common/world/layer/GenLayerRiverMixBOP.java index 85c59da3a..bf7572107 100644 --- a/src/main/java/biomesoplenty/common/world/layer/GenLayerRiverMixBOP.java +++ b/src/main/java/biomesoplenty/common/world/layer/GenLayerRiverMixBOP.java @@ -41,7 +41,7 @@ public class GenLayerRiverMixBOP extends GenLayerRiverMix { if (riverBiomeIds[i1] == BiomeGenBase.river.biomeID) { - if (inputBiomeIds[i1] == BiomeGenBase.icePlains.biomeID || inputBiomeIds[i1] == BOPCBiomes.alps.biomeID || inputBiomeIds[i1] == BOPCBiomes.arctic.biomeID || inputBiomeIds[i1] == BOPCBiomes.glacier.biomeID || inputBiomeIds[i1] == BOPCBiomes.frostForest.biomeID || inputBiomeIds[i1] == BOPCBiomes.snowyConiferousForest.biomeID) + if (inputBiomeIds[i1] == BiomeGenBase.icePlains.biomeID || inputBiomeIds[i1] == BOPCBiomes.alps.biomeID || inputBiomeIds[i1] == BOPCBiomes.alpsForest.biomeID || inputBiomeIds[i1] == BOPCBiomes.arctic.biomeID || inputBiomeIds[i1] == BOPCBiomes.glacier.biomeID || inputBiomeIds[i1] == BOPCBiomes.frostForest.biomeID || inputBiomeIds[i1] == BOPCBiomes.snowyConiferousForest.biomeID) { outputBiomeIds[i1] = BiomeGenBase.frozenRiver.biomeID; }