From 0b12d2628a69ef4d6662d2564014b6d995a49e9e Mon Sep 17 00:00:00 2001 From: Adubbz Date: Mon, 6 Jan 2014 00:03:01 +1100 Subject: [PATCH] Readded the Mountain biome --- .../common/biomes/BiomeGenMountain.java | 78 ++++++++------ .../common/biomes/BiomeGenMysticGrove.java | 100 +++++++----------- .../common/biomes/BiomeGenOminousWoods.java | 2 +- .../common/biomes/BiomeGenPrairie.java | 3 - .../common/blocks/BlockBOPSapling.java | 2 +- .../biomesoplenty/common/core/BOPBiomes.java | 9 +- .../world/WorldGenFieldAssociation.java | 1 + .../world/decoration/BOPWorldFeatures.java | 1 + .../features/trees/WorldGenBOPSwampTree.java | 8 +- 9 files changed, 105 insertions(+), 99 deletions(-) diff --git a/src/main/java/biomesoplenty/common/biomes/BiomeGenMountain.java b/src/main/java/biomesoplenty/common/biomes/BiomeGenMountain.java index 5043c306c..961124d16 100644 --- a/src/main/java/biomesoplenty/common/biomes/BiomeGenMountain.java +++ b/src/main/java/biomesoplenty/common/biomes/BiomeGenMountain.java @@ -1,54 +1,72 @@ package biomesoplenty.common.biomes; -import net.minecraft.world.biome.BiomeGenBase; +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 net.minecraft.world.gen.feature.WorldGenTallGrass; +import net.minecraft.world.gen.feature.WorldGenerator; +import biomesoplenty.api.BOPBlockHelper; +import biomesoplenty.common.world.features.trees.WorldGenPineTree; public class BiomeGenMountain extends BOPBiome { + private static final Height biomeHeight = new Height(1.0F, 1.5F); - public BiomeGenMountain(int par1) + public BiomeGenMountain(int id) { - super(par1); - /* - theBiomeDecorator = new BiomeDecoratorBOP(this); - customBiomeDecorator = (BiomeDecoratorBOP)theBiomeDecorator; - customBiomeDecorator.treesPerChunk = 2; - customBiomeDecorator.grassPerChunk = 3; - customBiomeDecorator.wheatGrassPerChunk = 1; - customBiomeDecorator.berryBushesPerChunk = 3; - customBiomeDecorator.shrubsPerChunk = 10; - customBiomeDecorator.waterReedsPerChunk = 4; - */ + super(id); + + //TODO: setHeight() + this.func_150570_a(biomeHeight); + //TODO: setColor() + this.setColor(8430421); + this.setTemperatureRainfall(0.5F, 0.1F); + + this.theBiomeDecorator.treesPerChunk = 2; + this.theBiomeDecorator.grassPerChunk = 3; + + this.bopWorldFeatures.perChunk.berryBushesPerChunk = 3; + this.bopWorldFeatures.perChunk.shrubsPerChunk = 10; + this.bopWorldFeatures.perChunk.waterReedsPerChunk = 4; } - /** - * Gets a WorldGen appropriate for this biome. - */ - /* @Override - public WorldGenerator getRandomWorldGenForTrees(Random par1Random) + //TODO: getRandomWorldGenForTrees() + public WorldGenAbstractTree func_150567_a(Random random) { - return par1Random.nextInt(4) == 0 ? new WorldGenPineTree() : worldGeneratorTrees; + return random.nextInt(4) == 0 ? new WorldGenPineTree() : worldGeneratorTrees; } @Override - public void decorate(World par1World, Random par2Random, int par3, int par4) + public WorldGenerator getRandomWorldGenForGrass(Random random) { - super.decorate(par1World, par2Random, par3, par4); - int var5 = 3 + par2Random.nextInt(6); + return random.nextInt(4) == 0 ? (random.nextInt(2) == 0 ? new WorldGenTallGrass(BOPBlockHelper.get("foliage"), 10) : new WorldGenTallGrass(BOPBlockHelper.get("foliage"), 11)) : new WorldGenTallGrass(Blocks.tallgrass, 1); + } + + @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 var7 = par3 + par2Random.nextInt(16); - int var8 = par2Random.nextInt(28) + 4; - int var9 = par4 + par2Random.nextInt(16); - int var10 = par1World.getBlockId(var7, var8, var9); + int x = chunkX + random.nextInt(16); + int y = random.nextInt(28) + 4; + int z = chunkZ + random.nextInt(16); + + //TODO: getBlock() + Block block = world.func_147439_a(x, y, z); - Block block = Block.blocksList[var10]; - if (block != null && block.isGenMineableReplaceable(par1World, var7, var8, var9, Block.stone.blockID)) + if (block != null && block.isReplaceableOreGen(world, x, y, z, Blocks.stone)) { - par1World.setBlock(var7, var8, var9, Block.oreEmerald.blockID, 0, 2); + //TODO: setBlock() + world.func_147465_d(x, y, z, BOPBlockHelper.get("gemOre"), 0, 2); } } } - */ } diff --git a/src/main/java/biomesoplenty/common/biomes/BiomeGenMysticGrove.java b/src/main/java/biomesoplenty/common/biomes/BiomeGenMysticGrove.java index 4d5c0f88c..775111f03 100644 --- a/src/main/java/biomesoplenty/common/biomes/BiomeGenMysticGrove.java +++ b/src/main/java/biomesoplenty/common/biomes/BiomeGenMysticGrove.java @@ -1,92 +1,74 @@ package biomesoplenty.common.biomes; -import net.minecraft.world.biome.BiomeGenBase; +import java.util.Random; + +import net.minecraft.entity.monster.EntityWitch; +import net.minecraft.init.Blocks; +import net.minecraft.world.gen.feature.WorldGenTallGrass; +import net.minecraft.world.gen.feature.WorldGenerator; +import biomesoplenty.api.BOPBlockHelper; +import biomesoplenty.common.world.features.trees.WorldGenOriginalTree; public class BiomeGenMysticGrove extends BOPBiome { - @SuppressWarnings("unchecked") - public BiomeGenMysticGrove(int par1) + public BiomeGenMysticGrove(int id) { - super(par1); - /* - theBiomeDecorator = new BiomeDecoratorBOP(this); - customBiomeDecorator = (BiomeDecoratorBOP)theBiomeDecorator; - if (BOPConfigurationMain.realisticTrees) - { - customBiomeDecorator.treesPerChunk = 1; - } - else - { - customBiomeDecorator.treesPerChunk = 9; - } + super(id); - customBiomeDecorator.grassPerChunk = 15; - customBiomeDecorator.wheatGrassPerChunk = 3; + this.spawnableMonsterList.clear(); + this.spawnableCreatureList.clear(); + this.spawnableWaterCreatureList.clear(); + this.spawnableMonsterList.add(new SpawnListEntry(EntityWitch.class, 10, 4, 4)); + + this.waterColorMultiplier = 16715898; + + this.theBiomeDecorator.treesPerChunk = 9; + this.theBiomeDecorator.grassPerChunk = 15; + this.theBiomeDecorator.sandPerChunk = -999; + this.theBiomeDecorator.sandPerChunk2 = -999; + + /*customBiomeDecorator.rosesPerChunk = 8; customBiomeDecorator.flowersPerChunk = 8; customBiomeDecorator.pinkFlowersPerChunk = 9; customBiomeDecorator.glowFlowersPerChunk = 10; - customBiomeDecorator.rosesPerChunk = 8; - customBiomeDecorator.sandPerChunk = -999; - customBiomeDecorator.sandPerChunk2 = -999; customBiomeDecorator.sproutsPerChunk = 1; customBiomeDecorator.hydrangeasPerChunk = 6; customBiomeDecorator.blueMilksPerChunk = 1; customBiomeDecorator.lilyflowersPerChunk = 3; - customBiomeDecorator.poisonWaterPerChunk = 1; - customBiomeDecorator.cloverPatchesPerChunk = 10; - customBiomeDecorator.shrubsPerChunk = 4; - waterColorMultiplier = 16715898; - spawnableMonsterList.clear(); - spawnableCreatureList.clear(); - spawnableWaterCreatureList.clear(); - spawnableMonsterList.add(new SpawnListEntry(EntityWitch.class, 10, 4, 4)); - */ + customBiomeDecorator.poisonWaterPerChunk = 1;*/ + + this.bopWorldFeatures.perChunk.cloverPatchesPerChunk = 10; + this.bopWorldFeatures.perChunk.shrubsPerChunk = 4; + } - /** - * Gets a WorldGen appropriate for this biome. - */ - /* - @Override + /*@Override public WorldGenerator getRandomWorldGenForTrees(Random par1Random) { - return par1Random.nextInt(4) == 0 ? new WorldGenMystic2(false) : (par1Random.nextInt(3) == 0 ? new WorldGenJacaranda(false) : ((par1Random.nextInt(3) == 0 ? this.worldGeneratorBigTree : ((par1Random.nextInt(8) == 0 ? new WorldGenSwampTall() : this.worldGeneratorTrees))))); - } - */ + return par1Random.nextInt(4) == 0 ? new WorldGenMystic2(false) : (par1Random.nextInt(3) == 0 ? new WorldGenOriginalTree(BOPBlockHelper.get("logs4"), BOPBlockHelper.get("leaves4"), 2, 1) : ((par1Random.nextInt(3) == 0 ? this.worldGeneratorBigTree : ((par1Random.nextInt(8) == 0 ? new WorldGenSwampTree(Blocks.log, Blocks.leaves, 0, 0, 6, 8) : this.worldGeneratorTrees))))); + }*/ - /** - * Gets a WorldGen appropriate for this biome. - */ - /* - @Override - public WorldGenerator getRandomWorldGenForGrass(Random par1Random) - { - return (par1Random.nextInt(5) == 0 ? new WorldGenTallGrass(Blocks.foliage.get().blockID, 1) : (par1Random.nextInt(3) == 0 ? new WorldGenTallGrass(Blocks.foliage.get().blockID, 2) : new WorldGenTallGrass(Block.tallGrass.blockID, 1))); - } - */ - /** - * Provides the basic grass color based on the biome temperature and rainfall - */ - /* @Override - public int getBiomeGrassColor() + public WorldGenerator getRandomWorldGenForGrass(Random random) { + return (random.nextInt(5) == 0 ? new WorldGenTallGrass(BOPBlockHelper.get("foliage"), 1) : (random.nextInt(3) == 0 ? new WorldGenTallGrass(BOPBlockHelper.get("foliage"), 2) : (random.nextInt(2) == 0 ? new WorldGenTallGrass(BOPBlockHelper.get("foliage"), 10) : (random.nextInt(2) == 0 ? new WorldGenTallGrass(BOPBlockHelper.get("foliage"), 11) : new WorldGenTallGrass(Blocks.tallgrass, 1))))); + } + + @Override + //TODO: getBiomeGrassColor() + public int func_150558_b(int p_150558_1_, int p_150558_2_, int p_150558_3_) + { return 6934491; } - */ - /** - * Provides the basic foliage color based on the biome temperature and rainfall - */ - /* @Override - public int getBiomeFoliageColor() + //TODO: getBiomeFoliageColor() + public int func_150571_c(int x, int y, int z) { return 7397529; } - */ /** * Fog Color diff --git a/src/main/java/biomesoplenty/common/biomes/BiomeGenOminousWoods.java b/src/main/java/biomesoplenty/common/biomes/BiomeGenOminousWoods.java index 19d5a171d..8b2517cfe 100644 --- a/src/main/java/biomesoplenty/common/biomes/BiomeGenOminousWoods.java +++ b/src/main/java/biomesoplenty/common/biomes/BiomeGenOminousWoods.java @@ -59,7 +59,7 @@ public class BiomeGenOminousWoods extends BOPBiome //TODO: getRandomWorldGenForTrees() public WorldGenAbstractTree func_150567_a(Random random) { - return random.nextInt(2) == 0 ? new WorldGenBOPTaiga2(BOPBlockHelper.get("logs1"), BOPBlockHelper.get("leaves1"), 2, 3, false, 14, 6) : (random.nextInt(6) == 0 ? new WorldGenDeadTree1(false, Blocks.dirt, Blocks.grass, BOPBlockHelper.get("holyGrass"), BOPBlockHelper.get("driedDirt"), BOPBlockHelper.get("redRock")) : new WorldGenBOPSwampTree(BOPBlockHelper.get("logs1"), BOPBlockHelper.get("leaves1"), 2, 3)); + return random.nextInt(2) == 0 ? new WorldGenBOPTaiga2(BOPBlockHelper.get("logs1"), BOPBlockHelper.get("leaves1"), 2, 3, false, 14, 6) : (random.nextInt(6) == 0 ? new WorldGenDeadTree1(false, Blocks.dirt, Blocks.grass, BOPBlockHelper.get("holyGrass"), BOPBlockHelper.get("driedDirt"), BOPBlockHelper.get("redRock")) : new WorldGenBOPSwampTree(BOPBlockHelper.get("logs1"), BOPBlockHelper.get("leaves1"), 2, 3, 5, 4)); } @Override diff --git a/src/main/java/biomesoplenty/common/biomes/BiomeGenPrairie.java b/src/main/java/biomesoplenty/common/biomes/BiomeGenPrairie.java index 503ca2bde..bd32816b2 100644 --- a/src/main/java/biomesoplenty/common/biomes/BiomeGenPrairie.java +++ b/src/main/java/biomesoplenty/common/biomes/BiomeGenPrairie.java @@ -9,8 +9,6 @@ public class BiomeGenPrairie extends BOPBiome { super(par1); /* - theBiomeDecorator = new BiomeDecoratorBOP(this); - customBiomeDecorator = (BiomeDecoratorBOP)theBiomeDecorator; customBiomeDecorator.treesPerChunk = 1; customBiomeDecorator.grassPerChunk = 999; customBiomeDecorator.whiteFlowersPerChunk = 20; @@ -18,7 +16,6 @@ public class BiomeGenPrairie extends BOPBiome customBiomeDecorator.portobellosPerChunk = 2; customBiomeDecorator.berryBushesPerChunk = 2; customBiomeDecorator.wheatGrassPerChunk = 25; - customBiomeDecorator.carrotsPerChunk = 1; customBiomeDecorator.shrubsPerChunk = 3; customBiomeDecorator.waterReedsPerChunk = 4; spawnableCreatureList.add(new SpawnListEntry(EntityHorse.class, 5, 2, 6)); diff --git a/src/main/java/biomesoplenty/common/blocks/BlockBOPSapling.java b/src/main/java/biomesoplenty/common/blocks/BlockBOPSapling.java index 38d6458fc..cbffda530 100644 --- a/src/main/java/biomesoplenty/common/blocks/BlockBOPSapling.java +++ b/src/main/java/biomesoplenty/common/blocks/BlockBOPSapling.java @@ -160,7 +160,7 @@ public class BlockBOPSapling extends BlockSapling rnd = random.nextInt(8); if (rnd == 0) { - obj = new WorldGenBOPSwampTree(BOPBlockHelper.get("logs1"), BOPBlockHelper.get("leaves1"), 2, 3); + obj = new WorldGenBOPSwampTree(BOPBlockHelper.get("logs1"), BOPBlockHelper.get("leaves1"), 2, 3, 5, 4); } else { obj = new WorldGenBOPTaiga2(BOPBlockHelper.get("logs1"), BOPBlockHelper.get("leaves1"), 2, 3, false, 14, 6); } diff --git a/src/main/java/biomesoplenty/common/core/BOPBiomes.java b/src/main/java/biomesoplenty/common/core/BOPBiomes.java index 345dc79a6..e2baadea0 100644 --- a/src/main/java/biomesoplenty/common/core/BOPBiomes.java +++ b/src/main/java/biomesoplenty/common/core/BOPBiomes.java @@ -14,6 +14,7 @@ import biomesoplenty.common.biomes.BiomeGenFrostForest; import biomesoplenty.common.biomes.BiomeGenHighland; import biomesoplenty.common.biomes.BiomeGenJadeCliffs; import biomesoplenty.common.biomes.BiomeGenLavenderFields; +import biomesoplenty.common.biomes.BiomeGenMountain; import biomesoplenty.common.biomes.BiomeGenOminousWoods; import biomesoplenty.common.biomes.BiomeGenPasture; import biomesoplenty.common.biomes.BiomeGenRainforest; @@ -92,15 +93,15 @@ public class BOPBiomes registerBiome(new BOPBiomeListEntry(new BiomeGenMapleWoods(BOPConfigurationIDs.mapleWoodsID).setBiomeName("Maple Woods"), BOPBiomeTemperatureType.COOL)); registerBiome(new BOPBiomeListEntry(new BiomeGenMarsh(BOPConfigurationIDs.marshID).setBiomeName("Marsh"), BOPBiomeTemperatureType.WARM)); registerBiome(new BOPBiomeListEntry(new BiomeGenMeadow(BOPConfigurationIDs.meadowID).setBiomeName("Meadow"), BOPBiomeTemperatureType.COOL)); - registerBiome(new BOPBiomeListEntry(new BiomeGenMoor(BOPConfigurationIDs.moorID).setBiomeName("Moor"), BOPBiomeTemperatureType.COOL)); + registerBiome(new BOPBiomeListEntry(new BiomeGenMoor(BOPConfigurationIDs.moorID).setBiomeName("Moor"), BOPBiomeTemperatureType.COOL));*/ registerBiome(new BOPBiomeListEntry(new BiomeGenMountain(BOPConfigurationIDs.mountainID).setBiomeName("Mountain"), BOPBiomeTemperatureType.WARM)); - registerBiome(new BOPBiomeListEntry(new BiomeGenMysticGrove(BOPConfigurationIDs.mysticGroveID).setBiomeName("Mystic Grove"), BOPBiomeTemperatureType.WARM));*/ + //registerBiome(new BOPBiomeListEntry(new BiomeGenMysticGrove(BOPConfigurationIDs.mysticGroveID).setBiomeName("Mystic Grove"), BOPBiomeTemperatureType.WARM)); registerBiome(new BOPBiomeListEntry(new BiomeGenOminousWoods(BOPConfigurationIDs.ominousWoodsID).setBiomeName("Ominous Woods"), BOPBiomeTemperatureType.COOL)); //registerBiome(new BOPBiomeListEntry(new BiomeGenOriginValley(BOPConfigurationIDs.originValleyID).setBiomeName("Origin Valley"), BOPBiomeTemperatureType.WARM)); /*registerBiome(new BOPBiomeListEntry(new BiomeGenOutback(BOPConfigurationIDs.outbackID).setBiomeName("Outback"), BOPBiomeTemperatureType.HOT));*/ registerBiome(new BOPBiomeListEntry(new BiomeGenPasture(BOPConfigurationIDs.pastureID).setBiomeName("Pasture"), BOPBiomeTemperatureType.WARM)); - /*registerBiome(new BOPBiomeListEntry(new BiomeGenPrairie(BOPConfigurationIDs.prairieID).setBiomeName("Prairie"), BOPBiomeTemperatureType.WARM)); - registerBiome(new BOPBiomeListEntry(new BiomeGenQuagmire(BOPConfigurationIDs.quagmireID).setBiomeName("Quagmire"), BOPBiomeTemperatureType.WARM));*/ + //registerBiome(new BOPBiomeListEntry(new BiomeGenPrairie(BOPConfigurationIDs.prairieID).setBiomeName("Prairie"), BOPBiomeTemperatureType.WARM)); + /*registerBiome(new BOPBiomeListEntry(new BiomeGenQuagmire(BOPConfigurationIDs.quagmireID).setBiomeName("Quagmire"), BOPBiomeTemperatureType.WARM));*/ registerBiome(new BOPBiomeListEntry(new BiomeGenRainforest(BOPConfigurationIDs.rainforestID).setBiomeName("Rainforest"), BOPBiomeTemperatureType.HOT)); /*registerBiome(new BOPBiomeListEntry(new BiomeGenRedwoodForest(BOPConfigurationIDs.redwoodForestID).setBiomeName("Redwood Forest"), BOPBiomeTemperatureType.WARM));*/ registerBiome(new BOPBiomeListEntry(new BiomeGenSacredSprings(BOPConfigurationIDs.sacredSpringsID).setBiomeName("Sacred Springs"), BOPBiomeTemperatureType.WARM)); diff --git a/src/main/java/biomesoplenty/common/world/WorldGenFieldAssociation.java b/src/main/java/biomesoplenty/common/world/WorldGenFieldAssociation.java index 37e5b4119..0c9c58dd5 100644 --- a/src/main/java/biomesoplenty/common/world/WorldGenFieldAssociation.java +++ b/src/main/java/biomesoplenty/common/world/WorldGenFieldAssociation.java @@ -36,6 +36,7 @@ public class WorldGenFieldAssociation associateField("waterReedsPerChunk", new WorldGenWaterReeds()); associateField("wildCarrotsPerChunk", new WorldGenBOPFlora(BOPBlockHelper.get("plants"), 11)); associateField("poisonIvyPerChunk", new WorldGenBOPFlora(BOPBlockHelper.get("foliage"), 7)); + associateField("berryBushesPerChunk", new WorldGenBOPFlora(BOPBlockHelper.get("foliage"), 8)); WorldGenDoublePlant doubleTallGrass = new WorldGenDoublePlant(); //TODO: setMetadata() ? diff --git a/src/main/java/biomesoplenty/common/world/decoration/BOPWorldFeatures.java b/src/main/java/biomesoplenty/common/world/decoration/BOPWorldFeatures.java index 21418e20f..aca7c3f1c 100644 --- a/src/main/java/biomesoplenty/common/world/decoration/BOPWorldFeatures.java +++ b/src/main/java/biomesoplenty/common/world/decoration/BOPWorldFeatures.java @@ -22,6 +22,7 @@ public class BOPWorldFeatures public int wildCarrotsPerChunk = 0; public int doubleTallGrassPerChunk = 0; public int poisonIvyPerChunk = 0; + public int berryBushesPerChunk = 0; public int bopFlowersPerChunk = 0; } diff --git a/src/main/java/biomesoplenty/common/world/features/trees/WorldGenBOPSwampTree.java b/src/main/java/biomesoplenty/common/world/features/trees/WorldGenBOPSwampTree.java index e38f3dcad..622f0326a 100644 --- a/src/main/java/biomesoplenty/common/world/features/trees/WorldGenBOPSwampTree.java +++ b/src/main/java/biomesoplenty/common/world/features/trees/WorldGenBOPSwampTree.java @@ -18,7 +18,10 @@ public class WorldGenBOPSwampTree extends WorldGenAbstractTree private int woodMeta; private int leavesMeta; - public WorldGenBOPSwampTree(Block wood, Block leaves, int woodMeta, int leavesMeta) + private int minTreeHeight; + private int randomTreeHeight; + + public WorldGenBOPSwampTree(Block wood, Block leaves, int woodMeta, int leavesMeta, int minTreeHeight, int randomTreeHeight) { super(false); @@ -27,6 +30,9 @@ public class WorldGenBOPSwampTree extends WorldGenAbstractTree this.woodMeta = woodMeta; this.leavesMeta = leavesMeta; + + this.minTreeHeight = minTreeHeight; + this.randomTreeHeight = randomTreeHeight; } @Override