From e9f70274d2a56b21d473665ae95606bb025a3d1b Mon Sep 17 00:00:00 2001 From: Adubbz Date: Sun, 12 Jan 2014 15:10:54 +1100 Subject: [PATCH] Readded the Volcano, Tropics, Temperate Rainforest and Sludgepit --- .../common/biomes/BiomeGenSludgepit.java | 227 ++++----- .../biomes/BiomeGenTemperateRainforest.java | 220 ++++---- .../biomes/BiomeGenTropicalRainforest.java | 2 +- .../common/biomes/BiomeGenTropics.java | 168 ++++--- .../common/biomes/BiomeGenVolcano.java | 82 ++- .../common/biomes/BiomeGenWasteland.java | 131 ++--- .../biomesoplenty/common/core/BOPBiomes.java | 14 +- .../world/decoration/BOPWorldFeatures.java | 2 + .../world/features/WorldGenLavaSpout.java | 71 +++ .../world/features/WorldGenSplotches.java | 295 +++++------ .../features/trees/WorldGenBOPTaiga2.java | 6 + .../features/trees/WorldGenBogTree1.java | 473 ++++++++++++++++++ .../features/trees/WorldGenBogTree2.java | 457 +++++++++++++++++ .../features/trees/WorldGenPalmTree1.java | 113 +++++ .../{ => trees}/WorldGenRainforestTree1.java | 2 +- .../features/trees/WorldGenTropicsShrub.java | 120 +++++ .../generation/WorldGenFieldAssociation.java | 3 + 17 files changed, 1795 insertions(+), 591 deletions(-) create mode 100644 src/main/java/biomesoplenty/common/world/features/WorldGenLavaSpout.java create mode 100644 src/main/java/biomesoplenty/common/world/features/trees/WorldGenBogTree1.java create mode 100644 src/main/java/biomesoplenty/common/world/features/trees/WorldGenBogTree2.java create mode 100644 src/main/java/biomesoplenty/common/world/features/trees/WorldGenPalmTree1.java rename src/main/java/biomesoplenty/common/world/features/{ => trees}/WorldGenRainforestTree1.java (99%) create mode 100644 src/main/java/biomesoplenty/common/world/features/trees/WorldGenTropicsShrub.java diff --git a/src/main/java/biomesoplenty/common/biomes/BiomeGenSludgepit.java b/src/main/java/biomesoplenty/common/biomes/BiomeGenSludgepit.java index ae70555a8..873a168b1 100644 --- a/src/main/java/biomesoplenty/common/biomes/BiomeGenSludgepit.java +++ b/src/main/java/biomesoplenty/common/biomes/BiomeGenSludgepit.java @@ -1,143 +1,134 @@ package biomesoplenty.common.biomes; -import net.minecraft.world.biome.BiomeGenBase; +import java.util.HashMap; +import java.util.Random; + +import net.minecraft.block.Block; +import net.minecraft.entity.monster.EntitySlime; +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.WorldGenerator; +import biomesoplenty.api.BOPBlockHelper; +import biomesoplenty.common.configuration.BOPConfigurationMisc; +import biomesoplenty.common.world.features.WorldGenBOPTallGrass; +import biomesoplenty.common.world.features.trees.WorldGenBogTree1; +import biomesoplenty.common.world.features.trees.WorldGenBogTree2; public class BiomeGenSludgepit extends BOPBiome { + private static final Height biomeHeight = new Height(0.1F, 0.3F); + + public BiomeGenSludgepit(int id) + { + super(id); + + //TODO: setHeight() + this.func_150570_a(biomeHeight); + //TODO: setColor() + this.setColor(7627817); + this.setTemperatureRainfall(0.8F, 0.9F); + + this.spawnableCreatureList.clear(); + this.spawnableWaterCreatureList.clear(); + + this.spawnableCreatureList.add(new SpawnListEntry(EntitySlime.class, 1, 1, 1)); + + this.waterColorMultiplier = 11506176; + + this.theBiomeDecorator.treesPerChunk = 30; + this.theBiomeDecorator.grassPerChunk = 30; + this.theBiomeDecorator.mushroomsPerChunk = 8; + this.theBiomeDecorator.flowersPerChunk = -999; + this.theBiomeDecorator.sandPerChunk = -999; + this.theBiomeDecorator.sandPerChunk2 = -999; + this.theBiomeDecorator.deadBushPerChunk = 5; + + this.bopWorldFeatures.mudPerChunk = 5; + this.bopWorldFeatures.algaePerChunk = 2; + //TODO: FEATURE customBiomeDecorator.poisonWaterPerChunk = 5; + this.bopWorldFeatures.waterReedsPerChunk = 6; + this.bopWorldFeatures.koruPerChunk = 1; + } + + @Override + //TODO: getRandomWorldGenForTrees() + public WorldGenAbstractTree func_150567_a(Random random) + { + return random.nextInt(3) == 0 ? new WorldGenBogTree2(Blocks.log, Blocks.leaves, 0, 0, false, 7, 4) : + new WorldGenBogTree1(Blocks.log, Blocks.leaves, 0, 0, false, 7, 5); + } + + @Override + public HashMap getWeightedWorldGenForGrass() + { + HashMap grassMap = new HashMap(); + + grassMap.put(new WorldGenBOPTallGrass(BOPBlockHelper.get("foliage"), 10), 0.5D); + grassMap.put(new WorldGenBOPTallGrass(BOPBlockHelper.get("foliage"), 11), 0.5D); + grassMap.put(new WorldGenBOPTallGrass(Blocks.tallgrass, 0), 0.5D); + grassMap.put(new WorldGenBOPTallGrass(Blocks.tallgrass, 2), 1D); + + return grassMap; + } + + @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); + + //TODO: getBlock() + Block block = world.func_147439_a(x, y, z); + + if (block != null && block.isReplaceableOreGen(world, x, y, z, Blocks.stone)) + { + //TODO: setBlock() + world.func_147465_d(x, y, z, BOPBlockHelper.get("gemOre"), 10, 2); + } + } + } - @SuppressWarnings("unchecked") - public BiomeGenSludgepit(int par1) - { - super(par1); - /* - spawnableCreatureList.clear(); - spawnableWaterCreatureList.clear(); - theBiomeDecorator = new BiomeDecoratorBOP(this); - customBiomeDecorator = (BiomeDecoratorBOP)theBiomeDecorator; - customBiomeDecorator.treesPerChunk = 30; - customBiomeDecorator.grassPerChunk = 30; - customBiomeDecorator.wheatGrassPerChunk = 10; - customBiomeDecorator.mushroomsPerChunk = 8; - customBiomeDecorator.flowersPerChunk = -999; - customBiomeDecorator.sandPerChunk = -999; - customBiomeDecorator.sandPerChunk2 = -999; - customBiomeDecorator.mudPerChunk = 5; - customBiomeDecorator.mudPerChunk2 = 5; - customBiomeDecorator.deadBushPerChunk = 5; - customBiomeDecorator.algaePerChunk = 2; - customBiomeDecorator.poisonWaterPerChunk = 5; - customBiomeDecorator.waterReedsPerChunk = 6; - customBiomeDecorator.koruPerChunk = 1; - spawnableCreatureList.add(new SpawnListEntry(EntitySlime.class, 1, 1, 1)); - waterColorMultiplier = 11506176; - */ - } - - /* @Override - public void decorate(World par1World, Random par2Random, int par3, int par4) - { - super.decorate(par1World, par2Random, par3, par4); - int var5 = 12 + par2Random.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); - - Block block = Block.blocksList[var10]; - if (block != null && block.isGenMineableReplaceable(par1World, var7, var8, var9, Block.stone.blockID)) - { - par1World.setBlock(var7, var8, var9, Blocks.amethystOre.get().blockID, 10, 2); - } - } - } - */ - - /** - * Gets a WorldGen appropriate for this biome. - */ - /* - @Override - public WorldGenerator getRandomWorldGenForTrees(Random par1Random) - { - return par1Random.nextInt(3) == 0 ? new WorldGenBog2() : new WorldGenBog1(); - } - */ - - /** - * Gets a WorldGen appropriate for this biome. - */ - /* - @Override - public WorldGenerator getRandomWorldGenForGrass(Random par1Random) - { - return par1Random.nextInt(9) == 0 ? new WorldGenTallGrass(Block.tallGrass.blockID, 0) : new WorldGenTallGrass(Blocks.foliage.get().blockID, 2); - } - */ - - /** - * Provides the basic grass color based on the biome temperature and rainfall - */ - /* - @Override - public int getBiomeGrassColor() - { + //TODO: getBiomeGrassColor() + public int func_150558_b(int x, int y, int z) + { return 7627817; } - */ - /** - * 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 9539892; } - @Override + @Override + public int getSkyColorByTemp(float par1) + { + if (BOPConfigurationMisc.skyColors) return 7039816; + else return super.getSkyColorByTemp(par1); + + } + + /*@Override public int getFogColour() { return 10463856; } - + @Override public float getFogCloseness() { // TODO Auto-generated method stub return 0.6F; } - */ - - /** - * takes temperature, returns color - */ - /* - @Override - public int getSkyColorByTemp(float par1) - { - if (BOPConfigurationMisc.skyColors) - return 7039816; - else - { - par1 /= 3.0F; - - if (par1 < -1.0F) - { - par1 = -1.0F; - } - - if (par1 > 1.0F) - { - par1 = 1.0F; - } - - return Color.getHSBColor(0.62222224F - par1 * 0.05F, 0.5F + par1 * 0.1F, 1.0F).getRGB(); - } - } - */ + */ } diff --git a/src/main/java/biomesoplenty/common/biomes/BiomeGenTemperateRainforest.java b/src/main/java/biomesoplenty/common/biomes/BiomeGenTemperateRainforest.java index 413e9f946..6e3e96652 100644 --- a/src/main/java/biomesoplenty/common/biomes/BiomeGenTemperateRainforest.java +++ b/src/main/java/biomesoplenty/common/biomes/BiomeGenTemperateRainforest.java @@ -1,108 +1,130 @@ package biomesoplenty.common.biomes; -import net.minecraft.world.biome.BiomeGenBase; +import java.util.HashMap; +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.WorldGenShrub; +import net.minecraft.world.gen.feature.WorldGenerator; +import biomesoplenty.api.BOPBlockHelper; +import biomesoplenty.common.configuration.BOPConfigurationMisc; +import biomesoplenty.common.world.features.WorldGenBOPTallGrass; +import biomesoplenty.common.world.features.WorldGenMoss; +import biomesoplenty.common.world.features.trees.WorldGenBOPSwampTree; +import biomesoplenty.common.world.features.trees.WorldGenBOPTaiga2; +import biomesoplenty.common.world.features.trees.WorldGenBOPTaiga3; public class BiomeGenTemperateRainforest extends BOPBiome { + private static final Height biomeHeight = new Height(0.2F, 0.6F); - public BiomeGenTemperateRainforest(int par1) + public BiomeGenTemperateRainforest(int id) { - super(par1); - /* - theBiomeDecorator = new BiomeDecoratorBOP(this); - customBiomeDecorator = (BiomeDecoratorBOP)theBiomeDecorator; - customBiomeDecorator.treesPerChunk = 22; - customBiomeDecorator.grassPerChunk = 25; - customBiomeDecorator.wheatGrassPerChunk = 10; - customBiomeDecorator.generatePumpkins = false; - customBiomeDecorator.mushroomsPerChunk = 4; - customBiomeDecorator.blueMilksPerChunk = 3; - customBiomeDecorator.poisonIvyPerChunk = 1; - customBiomeDecorator.carrotsPerChunk = 1; - customBiomeDecorator.gravelPerChunk = 4; - customBiomeDecorator.gravelPerChunk2 = 4; - customBiomeDecorator.sandPerChunk = -999; - customBiomeDecorator.sandPerChunk2 = -999; - customBiomeDecorator.shrubsPerChunk = 10; - customBiomeDecorator.waterReedsPerChunk = 2; - */ - } - - /** - * Gets a WorldGen appropriate for this biome. - */ - /* - @Override - public WorldGenerator getRandomWorldGenForTrees(Random par1Random) - { - //return (WorldGenerator)(par1Random.nextInt(3) == 0 ? new WorldGenGrandFir1() : (par1Random.nextInt(4) == 0 ? new WorldGenAlaskanCedar2() : (par1Random.nextInt(8) == 0 ? new WorldGenAlaskanCedar1() : (par1Random.nextInt(2) == 0 ? new WorldGenShrub(0,0) : new WorldGenGrandFir2())))); - return par1Random.nextInt(10) == 0 ? new WorldGenWillow() : (par1Random.nextInt(6) == 0 ? new WorldGenSequoia(false) : (par1Random.nextInt(2) == 0 ? new WorldGenTemperate(false) : new WorldGenShrub(0, 0))); - } - */ - - /** - * Gets a WorldGen appropriate for this biome. - */ - /* - @Override - public WorldGenerator getRandomWorldGenForGrass(Random par1Random) - { - return (par1Random.nextInt(6) == 0 ? new WorldGenTallGrass(Block.tallGrass.blockID, 1) : (par1Random.nextInt(2) == 0 ? new WorldGenTallGrass(Block.tallGrass.blockID, 2) : (par1Random.nextInt(4) == 0 ? new WorldGenTallGrass(Blocks.foliage.get().blockID, 2) : new WorldGenTallGrass(Blocks.foliage.get().blockID, 1)))); + super(id); + + //TODO: setHeight() + this.func_150570_a(biomeHeight); + //TODO: setColor() + this.setColor(12311907); + this.setTemperatureRainfall(0.7F, 0.8F); + + this.theBiomeDecorator.treesPerChunk = 22; + this.theBiomeDecorator.grassPerChunk = 25; + this.theBiomeDecorator.mushroomsPerChunk = 4; + this.theBiomeDecorator.sandPerChunk = -999; + this.theBiomeDecorator.sandPerChunk2 = -999; + + this.bopWorldFeatures.generatePumpkins = false; + this.bopWorldFeatures.blueMilksPerChunk = 3; + this.bopWorldFeatures.poisonIvyPerChunk = 1; + this.bopWorldFeatures.wildCarrotsPerChunk = 1; + this.bopWorldFeatures.shrubsPerChunk = 10; + this.bopWorldFeatures.waterReedsPerChunk = 2; } @Override - public void decorate(World par1World, Random par2Random, int par3, int par4) - { - super.decorate(par1World, par2Random, par3, par4); - int var5 = 3 + par2Random.nextInt(6); - WorldGenMoss var999 = new WorldGenMoss(); - - for (int var66 = 0; var66 < 20; ++var66) - { - int var77 = par3 + par2Random.nextInt(16) + 8; - byte var88 = 58; - int var99 = par4 + par2Random.nextInt(16) + 8; - var999.generate(par1World, par2Random, var77, var88, var99); - } - - 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); - - Block block = Block.blocksList[var10]; - if (block != null && block.isGenMineableReplaceable(par1World, var7, var8, var9, Block.stone.blockID)) - { - par1World.setBlock(var7, var8, var9, Block.oreEmerald.blockID, 0, 2); - } - } + //TODO: getRandomWorldGenForTrees() + public WorldGenAbstractTree func_150567_a(Random random) + { + return random.nextInt(10) == 0 ? new WorldGenBOPSwampTree(BOPBlockHelper.get("logs3"), BOPBlockHelper.get("colorizedLeaves2"), 1, 0, 6, 9, BOPBlockHelper.get("colorizedLeaves2"), 0) : + (random.nextInt(6) == 0 ? new WorldGenBOPTaiga3(Blocks.log, Blocks.leaves, 0, 0, false, 35, 10, 0) : + (random.nextInt(2) == 0 ? new WorldGenBOPTaiga2(Blocks.log, Blocks.leaves, 0, 0, false, 10, 25, 8) : + new WorldGenShrub(0, 0))); } - */ + + @Override + public HashMap getWeightedWorldGenForGrass() + { + HashMap grassMap = new HashMap(); + + grassMap.put(new WorldGenBOPTallGrass(BOPBlockHelper.get("foliage"), 1), 1D); + grassMap.put(new WorldGenBOPTallGrass(BOPBlockHelper.get("foliage"), 2), 0.5D); + grassMap.put(new WorldGenBOPTallGrass(BOPBlockHelper.get("foliage"), 10), 0.5D); + grassMap.put(new WorldGenBOPTallGrass(BOPBlockHelper.get("foliage"), 11), 0.5D); + grassMap.put(new WorldGenBOPTallGrass(Blocks.tallgrass, 1), 0.5D); + grassMap.put(new WorldGenBOPTallGrass(Blocks.tallgrass, 2), 0.5D); + + return grassMap; + } + + @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 i = 0; i < var5; ++i) + { + 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); + + if (block != null && block.isReplaceableOreGen(world, x, y, z, Blocks.stone)) + { + //TODO: setBlock() + world.func_147465_d(x, y, z, BOPBlockHelper.get("gemOre"), 0, 2); + } + } + + for (int i = 0; i < 20; i++) + { + int x = chunkX + random.nextInt(16) + 8; + short y = 58; + int z = chunkZ + random.nextInt(16) + 8; + + new WorldGenMoss().generate(world, random, x, y, z); + } + } - /** - * Provides the basic grass color based on the biome temperature and rainfall - */ - /* @Override - public int getBiomeGrassColor() - { + //TODO: getBiomeGrassColor() + public int func_150558_b(int x, int y, int z) + { return 11981671; } - */ - /** - * 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 12311907; } - @Override + @Override + public int getSkyColorByTemp(float par1) + { + if (BOPConfigurationMisc.skyColors) return 11061213; + else return super.getSkyColorByTemp(par1); + } + + /*@Override public int getFogColour() { return 13753294; @@ -115,32 +137,4 @@ public class BiomeGenTemperateRainforest extends BOPBiome return 0.8F; } */ - - /** - * takes temperature, returns color - */ - /* - @Override - public int getSkyColorByTemp(float par1) - { - if (BOPConfigurationMisc.skyColors) - return 11061213; - else - { - par1 /= 3.0F; - - if (par1 < -1.0F) - { - par1 = -1.0F; - } - - if (par1 > 1.0F) - { - par1 = 1.0F; - } - - return Color.getHSBColor(0.62222224F - par1 * 0.05F, 0.5F + par1 * 0.1F, 1.0F).getRGB(); - } - } - */ } diff --git a/src/main/java/biomesoplenty/common/biomes/BiomeGenTropicalRainforest.java b/src/main/java/biomesoplenty/common/biomes/BiomeGenTropicalRainforest.java index 5f5065092..17a41bc2d 100644 --- a/src/main/java/biomesoplenty/common/biomes/BiomeGenTropicalRainforest.java +++ b/src/main/java/biomesoplenty/common/biomes/BiomeGenTropicalRainforest.java @@ -16,7 +16,7 @@ import biomesoplenty.common.configuration.BOPConfigurationMisc; import biomesoplenty.common.entities.EntityJungleSpider; import biomesoplenty.common.world.features.WorldGenBOPFlora; import biomesoplenty.common.world.features.WorldGenBOPTallGrass; -import biomesoplenty.common.world.features.WorldGenRainforestTree1; +import biomesoplenty.common.world.features.trees.WorldGenRainforestTree1; public class BiomeGenTropicalRainforest extends BOPBiome { diff --git a/src/main/java/biomesoplenty/common/biomes/BiomeGenTropics.java b/src/main/java/biomesoplenty/common/biomes/BiomeGenTropics.java index f5d3a9a4e..5265178ee 100644 --- a/src/main/java/biomesoplenty/common/biomes/BiomeGenTropics.java +++ b/src/main/java/biomesoplenty/common/biomes/BiomeGenTropics.java @@ -1,72 +1,114 @@ package biomesoplenty.common.biomes; -import net.minecraft.world.biome.BiomeGenBase; +import java.util.HashMap; +import java.util.Random; + +import net.minecraft.block.Block; +import net.minecraft.init.Blocks; +import net.minecraft.world.World; +import net.minecraft.world.gen.feature.WorldGenAbstractTree; +import net.minecraft.world.gen.feature.WorldGenShrub; +import net.minecraft.world.gen.feature.WorldGenerator; +import biomesoplenty.api.BOPBlockHelper; +import biomesoplenty.common.configuration.BOPConfigurationMisc; +import biomesoplenty.common.entities.EntityJungleSpider; +import biomesoplenty.common.world.features.WorldGenBOPFlora; +import biomesoplenty.common.world.features.WorldGenBOPTallGrass; +import biomesoplenty.common.world.features.trees.WorldGenPalmTree1; +import biomesoplenty.common.world.features.trees.WorldGenTropicsShrub; public class BiomeGenTropics extends BOPBiome { + private static final Height biomeHeight = new Height(0.0F, 0.4F); - @SuppressWarnings("unchecked") - public BiomeGenTropics(int par1) + public BiomeGenTropics(int id) { - super(par1); - /* - theBiomeDecorator = new BiomeDecoratorBOP(this); - customBiomeDecorator = (BiomeDecoratorBOP) theBiomeDecorator; - customBiomeDecorator.treesPerChunk = 12; - customBiomeDecorator.grassPerChunk = 7; - customBiomeDecorator.wheatGrassPerChunk = 4; - customBiomeDecorator.flowersPerChunk = 10; - customBiomeDecorator.sandPerChunk = 50; - customBiomeDecorator.sandPerChunk2 = 50; - customBiomeDecorator.orangeFlowersPerChunk = 10; - customBiomeDecorator.whiteFlowersPerChunk = 4; - customBiomeDecorator.sunflowersPerChunk = 2; - customBiomeDecorator.hibiscusPerChunk = 45; - customBiomeDecorator.shrubsPerChunk = 4; - customBiomeDecorator.generatePumpkins = false; - spawnableMonsterList.add(new SpawnListEntry(EntityJungleSpider.class, 12, 6, 6)); - spawnableCreatureList.clear(); - */ + super(id); + + //TODO: setHeight() + this.func_150570_a(biomeHeight); + //TODO: setColor() + this.setColor(2211330); + this.setTemperatureRainfall(2.0F, 2.0F); + + this.spawnableCreatureList.clear(); + + this.spawnableMonsterList.add(new SpawnListEntry(EntityJungleSpider.class, 12, 6, 6)); + + this.theBiomeDecorator.treesPerChunk = 12; + this.theBiomeDecorator.grassPerChunk = 7; + this.theBiomeDecorator.flowersPerChunk = 10; + this.theBiomeDecorator.sandPerChunk = 50; + this.theBiomeDecorator.sandPerChunk2 = 50; + + this.bopWorldFeatures.bopFlowersPerChunk = 30; + this.bopWorldFeatures.sunflowersPerChunk = 2; + this.bopWorldFeatures.shrubsPerChunk = 4; + this.bopWorldFeatures.generatePumpkins = false; + } + + @Override + //TODO: getRandomWorldGenForTrees() + public WorldGenAbstractTree func_150567_a(Random random) + { + return random.nextInt(2) == 0 ? new WorldGenPalmTree1() : + (random.nextInt(2) == 0 ? new WorldGenTropicsShrub() : + new WorldGenShrub(0, 0)); + } + + @Override + public HashMap getWeightedWorldGenForBOPFlowers() + { + HashMap flowerMap = new HashMap(); + + flowerMap.put(new WorldGenBOPFlora(BOPBlockHelper.get("flowers"), 9), 0.5D); + flowerMap.put(new WorldGenBOPFlora(BOPBlockHelper.get("flowers"), 5), 0.75D); + flowerMap.put(new WorldGenBOPFlora(BOPBlockHelper.get("flowers2"), 0), 5D); + + return flowerMap; + } + + @Override + public HashMap getWeightedWorldGenForGrass() + { + HashMap grassMap = new HashMap(); + + grassMap.put(new WorldGenBOPTallGrass(BOPBlockHelper.get("foliage"), 10), 0.5D); + grassMap.put(new WorldGenBOPTallGrass(BOPBlockHelper.get("foliage"), 11), 0.5D); + grassMap.put(new WorldGenBOPTallGrass(Blocks.tallgrass, 1), 1D); + + return grassMap; } - /* @Override - public void decorate(World par1World, Random par2Random, int par3, int par4) + public void decorate(World world, Random random, int chunkX, int chunkZ) { - super.decorate(par1World, par2Random, par3, par4); - int var5 = 12 + par2Random.nextInt(6); + 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, - Blocks.amethystOre.get().blockID, 6, 2); + //TODO: setBlock() + world.func_147465_d(x, y, z, BOPBlockHelper.get("gemOre"), 6, 2); } } } - */ - - /** - * Gets a WorldGen appropriate for this biome. - */ - /* + @Override - public WorldGenerator getRandomWorldGenForTrees(Random par1Random) + public int getSkyColorByTemp(float par1) { - return par1Random.nextInt(2) == 0 ? new WorldGenPalmTree1() - : (par1Random.nextInt(2) == 0 ? new WorldGenTropicsShrub() - : new WorldGenShrub(0, 0)); + if (BOPConfigurationMisc.skyColors) return 507391; + else return super.getSkyColorByTemp(par1); } - */ /** * Fog Color @@ -79,37 +121,7 @@ public class BiomeGenTropics extends BOPBiome } */ - /** - * takes temperature, returns color - */ - /* - @Override - public int getSkyColorByTemp(float par1) - { - if (BOPConfigurationMisc.skyColors) - { - return 507391; - } - else - { - par1 /= 3.0F; - - if (par1 < -1.0F) - { - par1 = -1.0F; - } - - if (par1 > 1.0F) - { - par1 = 1.0F; - } - - return Color.getHSBColor(0.62222224F - par1 * 0.05F, - 0.5F + par1 * 0.1F, 1.0F).getRGB(); - } - } - - @Override + /*@Override public float getFogCloseness() { // TODO Auto-generated method stub diff --git a/src/main/java/biomesoplenty/common/biomes/BiomeGenVolcano.java b/src/main/java/biomesoplenty/common/biomes/BiomeGenVolcano.java index c0378295c..9d279c390 100644 --- a/src/main/java/biomesoplenty/common/biomes/BiomeGenVolcano.java +++ b/src/main/java/biomesoplenty/common/biomes/BiomeGenVolcano.java @@ -1,63 +1,41 @@ package biomesoplenty.common.biomes; -import net.minecraft.world.biome.BiomeGenBase; +import net.minecraft.world.biome.BiomeGenBase.Height; +import biomesoplenty.api.BOPBlockHelper; +import biomesoplenty.common.configuration.BOPConfigurationMisc; public class BiomeGenVolcano extends BOPBiome { + private static final Height biomeHeight = new Height(0.6F, 1.2F); - public BiomeGenVolcano(int par1) - { - super(par1); - /* - spawnableCreatureList.clear(); - topBlock = (byte)Blocks.ashStone.get().blockID; - fillerBlock = (byte)Blocks.ashStone.get().blockID; - theBiomeDecorator = new BiomeDecoratorBOP(this); - customBiomeDecorator = (BiomeDecoratorBOP)theBiomeDecorator; - customBiomeDecorator.treesPerChunk = 0; - customBiomeDecorator.flowersPerChunk = -999; - customBiomeDecorator.grassPerChunk = -999; - customBiomeDecorator.lavaLakesPerChunk = 50; - customBiomeDecorator.generateAsh = true; - */ - } + public BiomeGenVolcano(int id) + { + super(id); + + //TODO: setHeight() + this.func_150570_a(biomeHeight); + this.setDisableRain(); + //TODO: setColor() + this.setColor(6645093); + this.setTemperatureRainfall(2.0F, 0.05F); - /** - * Gets a WorldGen appropriate for this biome. - */ - /* - @Override - public WorldGenerator getRandomWorldGenForTrees(Random par1Random) - { - return new WorldGenVolcano(); - } - */ + this.spawnableCreatureList.clear(); - /** - * takes temperature, returns color - */ - /* - @Override - public int getSkyColorByTemp(float par1) - { - if (BOPConfigurationMisc.skyColors) - return 8026746; - else - { - par1 /= 3.0F; + this.topBlock = BOPBlockHelper.get("ashStone"); + this.fillerBlock = BOPBlockHelper.get("ashStone"); + this.theBiomeDecorator.treesPerChunk = 0; + this.theBiomeDecorator.flowersPerChunk = -999; + this.theBiomeDecorator.grassPerChunk = -999; - if (par1 < -1.0F) - { - par1 = -1.0F; - } + this.bopWorldFeatures.lavaLakesPerChunk = 50; + this.bopWorldFeatures.lavaSpoutsPerChunk = 10; + this.bopWorldFeatures.generateAsh = true; + } - if (par1 > 1.0F) - { - par1 = 1.0F; - } - - return Color.getHSBColor(0.62222224F - par1 * 0.05F, 0.5F + par1 * 0.1F, 1.0F).getRGB(); - } - } - */ + @Override + public int getSkyColorByTemp(float par1) + { + if (BOPConfigurationMisc.skyColors) return 8026746; + else return super.getSkyColorByTemp(par1); + } } diff --git a/src/main/java/biomesoplenty/common/biomes/BiomeGenWasteland.java b/src/main/java/biomesoplenty/common/biomes/BiomeGenWasteland.java index fdf2cda8a..24ba3c3b0 100644 --- a/src/main/java/biomesoplenty/common/biomes/BiomeGenWasteland.java +++ b/src/main/java/biomesoplenty/common/biomes/BiomeGenWasteland.java @@ -1,119 +1,88 @@ package biomesoplenty.common.biomes; -import net.minecraft.world.biome.BiomeGenBase; +import java.util.HashMap; + +import net.minecraft.init.Blocks; +import net.minecraft.world.gen.feature.WorldGenerator; +import biomesoplenty.api.BOPBlockHelper; +import biomesoplenty.common.configuration.BOPConfigurationMisc; +import biomesoplenty.common.world.features.WorldGenBOPTallGrass; public class BiomeGenWasteland extends BOPBiome { - public BiomeGenWasteland(int par1) + public BiomeGenWasteland(int id) { - super(par1); - /* - topBlock = (byte) Blocks.driedDirt.get().blockID; - fillerBlock = (byte) Blocks.driedDirt.get().blockID; - theBiomeDecorator = new BiomeDecoratorBOP(this); - customBiomeDecorator = (BiomeDecoratorBOP) theBiomeDecorator; - customBiomeDecorator.treesPerChunk = 0; - customBiomeDecorator.grassPerChunk = 20; - customBiomeDecorator.deadGrassPerChunk = 14; - customBiomeDecorator.poisonWaterPerChunk = 10; - customBiomeDecorator.waterLakesPerChunk = 2; - waterColorMultiplier = 15073024; - spawnableCreatureList.clear(); - spawnableWaterCreatureList.clear(); - */ + super(id); + + this.spawnableCreatureList.clear(); + this.spawnableWaterCreatureList.clear(); + + this.waterColorMultiplier = 15073024; + + this.topBlock = BOPBlockHelper.get("driedDirt"); + this.fillerBlock = BOPBlockHelper.get("driedDirt"); + this.theBiomeDecorator.treesPerChunk = 0; + this.theBiomeDecorator.grassPerChunk = 20; + + //TODO: FEATURE customBiomeDecorator.poisonWaterPerChunk = 10; + this.bopWorldFeatures.waterLakesPerChunk = 2; } - /** - * Gets a WorldGen appropriate for this biome. - */ - /* - @Override + /*@Override public WorldGenerator getRandomWorldGenForTrees(Random par1Random) { return par1Random.nextInt(6) == 0 ? new WorldGenDeadTree3(false) : (par1Random.nextInt(2) == 0 ? new WorldGenWasteland2() : new WorldGenWasteland()); - } - */ + }*/ - /** - * Gets a WorldGen appropriate for this biome. - */ - /* - @Override + @Override + public HashMap getWeightedWorldGenForGrass() + { + HashMap grassMap = new HashMap(); + + grassMap.put(new WorldGenBOPTallGrass(BOPBlockHelper.get("plants"), 0), 1D); + + return grassMap; + } + + + /*@Override public WorldGenerator getRandomWorldGenForGrass(Random par1Random) { return par1Random.nextInt(2) == 0 ? new WorldGenWasteland4() : new WorldGenWasteland3(); - } - */ + }*/ - /** - * Provides the basic grass color based on the biome temperature and - * rainfall - */ - /* @Override - public int getBiomeGrassColor() + //TODO: getBiomeGrassColor() + public int func_150558_b(int p_150558_1_, int p_150558_2_, int p_150558_3_) { return 10330232; } - */ - /** - * 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 10067541; } - */ - - /** - * Fog Color - */ - /* + @Override + public int getSkyColorByTemp(float par1) + { + if (BOPConfigurationMisc.skyColors) return 9477744; + else return super.getSkyColorByTemp(par1); + } + + /*@Override public int getFogColour() { return 12106885; } */ - /** - * takes temperature, returns color - */ - /* - @Override - public int getSkyColorByTemp(float par1) - { - if (BOPConfigurationMisc.skyColors) - { - return 9477744; - } - else - { - par1 /= 3.0F; - - if (par1 < -1.0F) - { - par1 = -1.0F; - } - - if (par1 > 1.0F) - { - par1 = 1.0F; - } - - return Color.getHSBColor(0.62222224F - par1 * 0.05F, - 0.5F + par1 * 0.1F, 1.0F).getRGB(); - } - } - - @Override + /*@Override public float getFogCloseness() { // TODO Auto-generated method stub diff --git a/src/main/java/biomesoplenty/common/core/BOPBiomes.java b/src/main/java/biomesoplenty/common/core/BOPBiomes.java index 00f55d0cc..7cccaf5ed 100644 --- a/src/main/java/biomesoplenty/common/core/BOPBiomes.java +++ b/src/main/java/biomesoplenty/common/core/BOPBiomes.java @@ -50,11 +50,15 @@ import biomesoplenty.common.biomes.BiomeGenSacredSprings; import biomesoplenty.common.biomes.BiomeGenSeasonalForest; import biomesoplenty.common.biomes.BiomeGenShield; import biomesoplenty.common.biomes.BiomeGenShrubland; +import biomesoplenty.common.biomes.BiomeGenSludgepit; import biomesoplenty.common.biomes.BiomeGenSpruceWoods; +import biomesoplenty.common.biomes.BiomeGenTemperateRainforest; import biomesoplenty.common.biomes.BiomeGenThicket; import biomesoplenty.common.biomes.BiomeGenTimber; import biomesoplenty.common.biomes.BiomeGenTropicalRainforest; +import biomesoplenty.common.biomes.BiomeGenTropics; import biomesoplenty.common.biomes.BiomeGenTundra; +import biomesoplenty.common.biomes.BiomeGenVolcano; import biomesoplenty.common.biomes.BiomeGenWetland; import biomesoplenty.common.biomes.BiomeGenWoodland; import biomesoplenty.common.configuration.BOPConfigurationIDs; @@ -146,16 +150,16 @@ public class BOPBiomes registerBiome(new BOPBiomeListEntry(new BiomeGenShield(BOPConfigurationIDs.shieldID).setBiomeName("Shield"), BOPBiomeTemperatureType.COOL)); registerBiome(new BOPBiomeListEntry(new BiomeGenShrubland(BOPConfigurationIDs.shrublandID).setBiomeName("Shrubland"), BOPBiomeTemperatureType.COOL)); //registerBiome(new BOPBiomeListEntry(new BiomeGenSilkglades(BOPConfigurationIDs.silkgladesID).setBiomeName("Silkglades"), BOPBiomeTemperatureType.COOL)); - //registerBiome(new BOPBiomeListEntry(new BiomeGenSludgepit(BOPConfigurationIDs.sludgepitID).setBiomeName("Sludgepit"), BOPBiomeTemperatureType.WARM)); + registerOnlyBiome(new BOPBiomeListEntry(new BiomeGenSludgepit(BOPConfigurationIDs.sludgepitID).setBiomeName("Sludgepit"), BOPBiomeTemperatureType.WARM)); registerBiome(new BOPBiomeListEntry(new BiomeGenSpruceWoods(BOPConfigurationIDs.spruceWoodsID).setBiomeName("Spruce Woods"), BOPBiomeTemperatureType.WARM)); - /*registerBiome(new BOPBiomeListEntry(new BiomeGenTemperateRainforest(BOPConfigurationIDs.temperateRainforestID).setBiomeName("Temperate Rainforest"), BOPBiomeTemperatureType.WARM));*/ + registerBiome(new BOPBiomeListEntry(new BiomeGenTemperateRainforest(BOPConfigurationIDs.temperateRainforestID).setBiomeName("Temperate Rainforest"), BOPBiomeTemperatureType.WARM)); registerBiome(new BOPBiomeListEntry(new BiomeGenThicket(BOPConfigurationIDs.thicketID).setBiomeName("Thicket"), BOPBiomeTemperatureType.WARM)); registerBiome(new BOPBiomeListEntry(new BiomeGenTimber(BOPConfigurationIDs.timberID).setBiomeName("Timber"), BOPBiomeTemperatureType.COOL)); registerBiome(new BOPBiomeListEntry(new BiomeGenTropicalRainforest(BOPConfigurationIDs.tropicalRainforestID).setBiomeName("Tropical Rainforest"), BOPBiomeTemperatureType.HOT)); - /*registerBiome(new BOPBiomeListEntry(new BiomeGenTropics(BOPConfigurationIDs.tropicsID).setBiomeName("Tropics"), BOPBiomeTemperatureType.HOT));*/ + registerBiome(new BOPBiomeListEntry(new BiomeGenTropics(BOPConfigurationIDs.tropicsID).setBiomeName("Tropics"), BOPBiomeTemperatureType.HOT)); registerBiome(new BOPBiomeListEntry(new BiomeGenTundra(BOPConfigurationIDs.tundraID).setBiomeName("Tundra"), BOPBiomeTemperatureType.ICY)); - //registerBiome(new BOPBiomeListEntry(new BiomeGenVolcano(BOPConfigurationIDs.volcanoID).setBiomeName("Volcano"), BOPBiomeTemperatureType.HOT)); - /*registerBiome(new BOPBiomeListEntry(new BiomeGenWasteland(BOPConfigurationIDs.wastelandID).setBiomeName("Wasteland"), BOPBiomeTemperatureType.HOT));*/ + registerBiome(new BOPBiomeListEntry(new BiomeGenVolcano(BOPConfigurationIDs.volcanoID).setBiomeName("Volcano"), BOPBiomeTemperatureType.HOT)); + //registerBiome(new BOPBiomeListEntry(new BiomeGenWasteland(BOPConfigurationIDs.wastelandID).setBiomeName("Wasteland"), BOPBiomeTemperatureType.HOT)); registerBiome(new BOPBiomeListEntry(new BiomeGenWetland(BOPConfigurationIDs.wetlandID).setBiomeName("Wetland"), BOPBiomeTemperatureType.WARM)); registerBiome(new BOPBiomeListEntry(new BiomeGenWoodland(BOPConfigurationIDs.woodlandID).setBiomeName("Woodland"), BOPBiomeTemperatureType.WARM)); } diff --git a/src/main/java/biomesoplenty/common/world/decoration/BOPWorldFeatures.java b/src/main/java/biomesoplenty/common/world/decoration/BOPWorldFeatures.java index 7ccd548af..a390dca2f 100644 --- a/src/main/java/biomesoplenty/common/world/decoration/BOPWorldFeatures.java +++ b/src/main/java/biomesoplenty/common/world/decoration/BOPWorldFeatures.java @@ -10,6 +10,7 @@ public class BOPWorldFeatures public boolean generateGrass = false; public boolean generateSand = false; public boolean generateQuagmire = false; + public boolean generateAsh = false; public boolean generateMelons = false; public int waterPoolsPerChunk = 0; @@ -50,6 +51,7 @@ public class BOPWorldFeatures public int grassSplatterPerChunk = 0; public int rockpilesPerChunk = 0; public int logsPerChunk = 0; + public int lavaSpoutsPerChunk = 0; public int bopFlowersPerChunk = 0; } diff --git a/src/main/java/biomesoplenty/common/world/features/WorldGenLavaSpout.java b/src/main/java/biomesoplenty/common/world/features/WorldGenLavaSpout.java new file mode 100644 index 000000000..517dc72fc --- /dev/null +++ b/src/main/java/biomesoplenty/common/world/features/WorldGenLavaSpout.java @@ -0,0 +1,71 @@ +package biomesoplenty.common.world.features; + +import java.lang.reflect.Field; +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; +import net.minecraft.world.gen.feature.WorldGenerator; +import biomesoplenty.api.BOPBlockHelper; +import biomesoplenty.common.world.decoration.IBOPDecoration; +import biomesoplenty.common.world.generation.WorldGeneratorBOP; + +public class WorldGenLavaSpout extends WorldGeneratorBOP +{ + @Override + public boolean generate(World world, Random random, int x, int y, int z) + { + //TODO: isAirBlock() + while (world.func_147437_c(x, y, z) && y > 2) + { + --y; + } + + //TODO: getBlock() + Block block = world.func_147439_a(x, y, z); + + if (block != BOPBlockHelper.get("ashStone")) + { + return false; + } + else + { + for (int var7 = -2; var7 <= 2; ++var7) + { + for (int var8 = -2; var8 <= 2; ++var8) + { + //TODO: isAirBlock() isAirBlock() + if (world.func_147437_c(x + var7, y - 1, z + var8) && world.func_147437_c(x + var7, y - 2, z + var8)) + { + return false; + } + } + } + + //TODO: setBlock() + world.func_147449_b(x, y - 1, z, Blocks.flowing_lava); + world.func_147449_b(x, y, z, Blocks.flowing_lava); + world.func_147449_b(x, y + 1, z, Blocks.flowing_lava); + world.func_147449_b(x - 1, y + 1, z, Blocks.flowing_lava); + world.func_147449_b(x + 1, y + 1, z, Blocks.flowing_lava); + world.func_147449_b(x, y + 1, z - 1, Blocks.flowing_lava); + world.func_147449_b(x, y + 1, z + 1, Blocks.flowing_lava); + return true; + } + } + + @Override + public void doGeneration(World world, Random random, Field worldGeneratorField, WorldGenerator worldGenerator, BiomeGenBase biome, IBOPDecoration bopDecoration, int x, int z) throws Exception + { + for (int i = 0; i < worldGeneratorField.getInt(bopDecoration.getWorldFeatures()); i++) + { + int randX = x + random.nextInt(16) + 8; + int randZ = z + random.nextInt(16) + 8; + int randY = random.nextInt(world.getHeightValue(randX, randZ) * 2); + + worldGenerator.generate(world, random, randX, randY, randZ); + } + } +} diff --git a/src/main/java/biomesoplenty/common/world/features/WorldGenSplotches.java b/src/main/java/biomesoplenty/common/world/features/WorldGenSplotches.java index c562f2445..6bde55d1b 100644 --- a/src/main/java/biomesoplenty/common/world/features/WorldGenSplotches.java +++ b/src/main/java/biomesoplenty/common/world/features/WorldGenSplotches.java @@ -16,163 +16,174 @@ import biomesoplenty.common.world.generation.WorldGeneratorBOP; public class WorldGenSplotches extends WorldGeneratorBOP { - private Block splotchBlock; - private int splotchBlockMeta; + private Block splotchBlock; + private int splotchBlockMeta; - private int numberOfBlocks; - - private List blockList; + private int numberOfBlocks; - public WorldGenSplotches(Block quicksandBlock, int quicksandBlockMeta, int numberOfBlocks, Block... blockList) - { - super(true); - - this.splotchBlock = quicksandBlock; - this.splotchBlockMeta = quicksandBlockMeta; - this.numberOfBlocks = numberOfBlocks; - - this.blockList = Arrays.asList(blockList); - } + private List blockList; - @Override - public boolean generate(World world, Random random, int x, int y, int z) - { - float var6 = random.nextFloat() * (float)Math.PI; - double var7 = x + 8 + MathHelper.sin(var6) * numberOfBlocks / 8.0F; - double var9 = x + 8 - MathHelper.sin(var6) * numberOfBlocks / 8.0F; - double var11 = z + 8 + MathHelper.cos(var6) * numberOfBlocks / 8.0F; - double var13 = z + 8 - MathHelper.cos(var6) * numberOfBlocks / 8.0F; - double var15 = y + random.nextInt(3) - 2; - double var17 = y + random.nextInt(3) - 2; + public WorldGenSplotches(Block quicksandBlock, int quicksandBlockMeta, int numberOfBlocks, Block... blockList) + { + super(true); - for (int var19 = 0; var19 <= numberOfBlocks; ++var19) - { - double var20 = var7 + (var9 - var7) * var19 / numberOfBlocks; - double var22 = var15 + (var17 - var15) * var19 / numberOfBlocks; - double var24 = var11 + (var13 - var11) * var19 / numberOfBlocks; - double var26 = random.nextDouble() * numberOfBlocks / 16.0D; - double var28 = (MathHelper.sin(var19 * (float)Math.PI / numberOfBlocks) + 1.0F) * var26 + 1.0D; - double var30 = (MathHelper.sin(var19 * (float)Math.PI / numberOfBlocks) + 1.0F) * var26 + 1.0D; - int var32 = MathHelper.floor_double(var20 - var28 / 2.0D); - int var33 = MathHelper.floor_double(var22 - var30 / 2.0D); - int var34 = MathHelper.floor_double(var24 - var28 / 2.0D); - int var35 = MathHelper.floor_double(var20 + var28 / 2.0D); - int var36 = MathHelper.floor_double(var22 + var30 / 2.0D); - int var37 = MathHelper.floor_double(var24 + var28 / 2.0D); + this.splotchBlock = quicksandBlock; + this.splotchBlockMeta = quicksandBlockMeta; + this.numberOfBlocks = numberOfBlocks; - for (int var38 = var32; var38 <= var35; ++var38) - { - double var39 = (var38 + 0.5D - var20) / (var28 / 2.0D); + this.blockList = Arrays.asList(blockList); + } - if (var39 * var39 < 1.0D) - { - for (int var41 = var33; var41 <= var36; ++var41) - { - double var42 = (var41 + 0.5D - var22) / (var30 / 2.0D); + @Override + public boolean generate(World world, Random random, int x, int y, int z) + { + float var6 = random.nextFloat() * (float)Math.PI; + double var7 = x + 8 + MathHelper.sin(var6) * numberOfBlocks / 8.0F; + double var9 = x + 8 - MathHelper.sin(var6) * numberOfBlocks / 8.0F; + double var11 = z + 8 + MathHelper.cos(var6) * numberOfBlocks / 8.0F; + double var13 = z + 8 - MathHelper.cos(var6) * numberOfBlocks / 8.0F; + double var15 = y + random.nextInt(3) - 2; + double var17 = y + random.nextInt(3) - 2; - if (var39 * var39 + var42 * var42 < 1.0D) - { - for (int var44 = var34; var44 <= var37; ++var44) - { - double var45 = (var44 + 0.5D - var24) / (var28 / 2.0D); + for (int var19 = 0; var19 <= numberOfBlocks; ++var19) + { + double var20 = var7 + (var9 - var7) * var19 / numberOfBlocks; + double var22 = var15 + (var17 - var15) * var19 / numberOfBlocks; + double var24 = var11 + (var13 - var11) * var19 / numberOfBlocks; + double var26 = random.nextDouble() * numberOfBlocks / 16.0D; + double var28 = (MathHelper.sin(var19 * (float)Math.PI / numberOfBlocks) + 1.0F) * var26 + 1.0D; + double var30 = (MathHelper.sin(var19 * (float)Math.PI / numberOfBlocks) + 1.0F) * var26 + 1.0D; + int var32 = MathHelper.floor_double(var20 - var28 / 2.0D); + int var33 = MathHelper.floor_double(var22 - var30 / 2.0D); + int var34 = MathHelper.floor_double(var24 - var28 / 2.0D); + int var35 = MathHelper.floor_double(var20 + var28 / 2.0D); + int var36 = MathHelper.floor_double(var22 + var30 / 2.0D); + int var37 = MathHelper.floor_double(var24 + var28 / 2.0D); - //TODO: getBlock() - if (var39 * var39 + var42 * var42 + var45 * var45 < 1.0D && (blockList.contains(world.func_147439_a(var38, var41, var44)))) - { - //TODO: setBlockAndMetadata() - this.func_150516_a(world, var38, var41, var44, splotchBlock, splotchBlockMeta); - } - } - } - } - } - } - } + for (int var38 = var32; var38 <= var35; ++var38) + { + double var39 = (var38 + 0.5D - var20) / (var28 / 2.0D); - return true; - } + if (var39 * var39 < 1.0D) + { + for (int var41 = var33; var41 <= var36; ++var41) + { + double var42 = (var41 + 0.5D - var22) / (var30 / 2.0D); - @Override - public void doGeneration(World world, Random random, Field worldGeneratorField, WorldGenerator worldGenerator, BiomeGenBase biome, IBOPDecoration bopDecoration, int x, int z) throws Exception - { - String fieldName = worldGeneratorField.getName(); - - if (fieldName.equals("generateQuicksand") && bopDecoration.getWorldFeatures().generateQuicksand) - { - for (int i = 0; i < 5; ++i) - { - int randX = x + random.nextInt(16); - int randY = random.nextInt(64) + 64; - int randZ = z + random.nextInt(16); + if (var39 * var39 + var42 * var42 < 1.0D) + { + for (int var44 = var34; var44 <= var37; ++var44) + { + double var45 = (var44 + 0.5D - var24) / (var28 / 2.0D); - worldGenerator.generate(world, random, randX, randY, randZ); - } - } - else if (fieldName.equals("generateCanyon") && bopDecoration.getWorldFeatures().generateCanyon) - { - for (int i = 0; i < 15; ++i) - { - int randX = x + random.nextInt(16); - int randY = random.nextInt(64) + 64; - int randZ = z + random.nextInt(16); + //TODO: getBlock() + if (var39 * var39 + var42 * var42 + var45 * var45 < 1.0D && world.func_147439_a(var38, var41, var44) != Blocks.air && (blockList.contains(world.func_147439_a(var38, var41, var44)))) + { + //TODO: setBlockAndMetadata() + this.func_150516_a(world, var38, var41, var44, splotchBlock, splotchBlockMeta); + } + } + } + } + } + } + } - worldGenerator.generate(world, random, randX, randY, randZ); - } - } - else if (fieldName.equals("generateStoneInGrass") && bopDecoration.getWorldFeatures().generateStoneInGrass) - { - for (int i = 0; i < 15; ++i) - { - int randX = x + random.nextInt(16); - int randY = random.nextInt(64) + 64; - int randZ = z + random.nextInt(16); + return true; + } - worldGenerator.generate(world, random, randX, randY, randZ); - } - } - else if (fieldName.equals("generateStoneInGrass2") && bopDecoration.getWorldFeatures().generateStoneInGrass2) - { - for (int i = 0; i < 20; ++i) - { - int randX = x + random.nextInt(16); - int randY = random.nextInt(64) + 64; - int randZ = z + random.nextInt(16); + @Override + public void doGeneration(World world, Random random, Field worldGeneratorField, WorldGenerator worldGenerator, BiomeGenBase biome, IBOPDecoration bopDecoration, int x, int z) throws Exception + { + String fieldName = worldGeneratorField.getName(); - worldGenerator.generate(world, random, randX, randY, randZ); - } - } - else if (fieldName.equals("generateGrass") && bopDecoration.getWorldFeatures().generateGrass) - { - for (int i = 0; i < 15; ++i) - { - int randX = x + random.nextInt(16); - int randY = random.nextInt(128); - int randZ = z + random.nextInt(16); + if (fieldName.equals("generateQuicksand") && bopDecoration.getWorldFeatures().generateQuicksand) + { + for (int i = 0; i < 5; ++i) + { + int randX = x + random.nextInt(16); + int randY = random.nextInt(64) + 64; + int randZ = z + random.nextInt(16); - worldGenerator.generate(world, random, randX, randY, randZ); - } - } - else if (fieldName.equals("generateSand") && bopDecoration.getWorldFeatures().generateGrass) - { - for (int i = 0; i < 15; ++i) - { - int randX = x + random.nextInt(16); - int randY = random.nextInt(128); - int randZ = z + random.nextInt(16); + worldGenerator.generate(world, random, randX, randY, randZ); + } + } + else if (fieldName.equals("generateCanyon") && bopDecoration.getWorldFeatures().generateCanyon) + { + for (int i = 0; i < 15; ++i) + { + int randX = x + random.nextInt(16); + int randY = random.nextInt(64) + 64; + int randZ = z + random.nextInt(16); - worldGenerator.generate(world, random, randX, randY, randZ); - } - } - else if (fieldName.equals("generateQuagmire") && bopDecoration.getWorldFeatures().generateQuagmire) - { - for (int i = 0; i < 15; ++i) - { - int randX = x + random.nextInt(16); - int randY = random.nextInt(64) + 64; - int randZ = z + random.nextInt(16); + worldGenerator.generate(world, random, randX, randY, randZ); + } + } + else if (fieldName.equals("generateStoneInGrass") && bopDecoration.getWorldFeatures().generateStoneInGrass) + { + for (int i = 0; i < 15; ++i) + { + int randX = x + random.nextInt(16); + int randY = random.nextInt(64) + 64; + int randZ = z + random.nextInt(16); - worldGenerator.generate(world, random, randX, randY, randZ); - } - } - } + worldGenerator.generate(world, random, randX, randY, randZ); + } + } + else if (fieldName.equals("generateStoneInGrass2") && bopDecoration.getWorldFeatures().generateStoneInGrass2) + { + for (int i = 0; i < 20; ++i) + { + int randX = x + random.nextInt(16); + int randY = random.nextInt(64) + 64; + int randZ = z + random.nextInt(16); + + worldGenerator.generate(world, random, randX, randY, randZ); + } + } + else if (fieldName.equals("generateGrass") && bopDecoration.getWorldFeatures().generateGrass) + { + for (int i = 0; i < 15; ++i) + { + int randX = x + random.nextInt(16); + int randY = random.nextInt(128); + int randZ = z + random.nextInt(16); + + worldGenerator.generate(world, random, randX, randY, randZ); + } + } + else if (fieldName.equals("generateSand") && bopDecoration.getWorldFeatures().generateSand) + { + for (int i = 0; i < 15; ++i) + { + int randX = x + random.nextInt(16); + int randY = random.nextInt(128); + int randZ = z + random.nextInt(16); + + worldGenerator.generate(world, random, randX, randY, randZ); + } + } + else if (fieldName.equals("generateQuagmire") && bopDecoration.getWorldFeatures().generateQuagmire) + { + for (int i = 0; i < 15; ++i) + { + int randX = x + random.nextInt(16); + int randY = random.nextInt(64) + 64; + int randZ = z + random.nextInt(16); + + worldGenerator.generate(world, random, randX, randY, randZ); + } + } + else if (fieldName.equals("generateAsh") && bopDecoration.getWorldFeatures().generateAsh) + { + for (int i = 0; i < 10; ++i) + { + int randX = x + random.nextInt(16); + int randY = random.nextInt(128); + int randZ = z + random.nextInt(16); + + worldGenerator.generate(world, random, randX, randY, randZ); + } + } + } } diff --git a/src/main/java/biomesoplenty/common/world/features/trees/WorldGenBOPTaiga2.java b/src/main/java/biomesoplenty/common/world/features/trees/WorldGenBOPTaiga2.java index 92c992b29..c91c0a5b8 100644 --- a/src/main/java/biomesoplenty/common/world/features/trees/WorldGenBOPTaiga2.java +++ b/src/main/java/biomesoplenty/common/world/features/trees/WorldGenBOPTaiga2.java @@ -88,6 +88,12 @@ public class WorldGenBOPTaiga2 extends WorldGenAbstractTree j1 = l - i1; k1 = 3; break; + + case 8: + i1 = 2 + random.nextInt(3); + j1 = l - i1; + k1 = 2 + random.nextInt(2); + break; default: i1 = 1 + random.nextInt(2); diff --git a/src/main/java/biomesoplenty/common/world/features/trees/WorldGenBogTree1.java b/src/main/java/biomesoplenty/common/world/features/trees/WorldGenBogTree1.java new file mode 100644 index 000000000..3954ce937 --- /dev/null +++ b/src/main/java/biomesoplenty/common/world/features/trees/WorldGenBogTree1.java @@ -0,0 +1,473 @@ +/*package biomesoplenty.common.world.features.trees; + +import java.util.Random; + +import net.minecraft.block.Block; +import net.minecraft.block.BlockSapling; +import net.minecraft.init.Blocks; +import net.minecraft.util.Direction; +import net.minecraft.world.World; +import net.minecraft.world.gen.feature.WorldGenAbstractTree; +import net.minecraftforge.common.util.ForgeDirection; + +public class WorldGenBogTree1 extends WorldGenAbstractTree +{ + private final int minTreeHeight; + private final int randomTreeHeight; + + private final Block wood; + private final Block leaves; + + private final int woodMeta; + private final int leavesMeta; + + public WorldGenBogTree1(Block wood, Block leaves, int woodMeta, int leavesMeta, boolean doBlockNotify, int minTreeHeight, int randomTreeHeight) + { + super(doBlockNotify); + + this.wood = wood; + this.leaves = leaves; + this.woodMeta = woodMeta; + this.leavesMeta = leavesMeta; + this.minTreeHeight = minTreeHeight; + this.randomTreeHeight = randomTreeHeight; + } + + @Override + public boolean generate(World par1World, Random par2Random, int par3, int par4, int par5) + { + int l = par2Random.nextInt(this.randomTreeHeight) + this.minTreeHeight; + boolean flag = true; + + if (par4 >= 1 && par4 + l + 1 <= 256) + { + byte b0; + int k1; + Block block; + + for (int i1 = par4; i1 <= par4 + 1 + l; ++i1) + { + b0 = 1; + + if (i1 == par4) + { + b0 = 0; + } + + if (i1 >= par4 + 1 + l - 2) + { + b0 = 3; + } + + for (int j1 = par3 - b0; j1 <= par3 + b0 && flag; ++j1) + { + for (k1 = par5 - b0; k1 <= par5 + b0 && flag; ++k1) + { + if (i1 >= 0 && i1 < 256) + { + block = par1World.func_147439_a(j1, i1, k1); + + if (!this.isReplaceable(par1World, j1, i1, k1)) + { + flag = false; + } + } + else + { + flag = false; + } + } + } + } + + if (!flag) + { + return false; + } + else + { + Block block2 = par1World.func_147439_a(par3, par4 - 1, par5); + + boolean isSoil = block2.canSustainPlant(par1World, par3, par4 - 1, par5, ForgeDirection.UP, (BlockSapling)Blocks.sapling); + + if (isSoil && par4 < 256 - l - 1) + { + block2.onPlantGrow(par1World, par3, par4 - 1, par5, par3, par4, par5); + b0 = 3; + int l1; + int i2; + int j2; + int i3; + + for (k1 = par4 - b0 + l; k1 <= par4 + l; ++k1) + { + i3 = k1 - (par4 + l); + l1 = 3 - i3; + + for (i2 = par3 - l1; i2 <= par3 + l1; ++i2) + { + j2 = i2 - par3; + + for (int k2 = par5 - l1; k2 <= par5 + l1; ++k2) + { + int l2 = k2 - par5; + + if (Math.abs(j2) != l1 || Math.abs(l2) != l1 || par2Random.nextInt(2) != 0 && i3 != 0) + { + Block block1 = par1World.func_147439_a(i2, k1, k2); + + if (block1.isAir(par1World, i2, k1, k2) || block1.isLeaves(par1World, i2, k1, k2)) + { + this.func_150516_a(par1World, i2, k1, k2, this.leaves, this.leavesMeta); + } + } + } + } + } + + for (k1 = 0; k1 < l; ++k1) + { + block = par1World.func_147439_a(par3, par4 + k1, par5); + + if (block.isAir(par1World, par3, par4 + k1, par5) || block.isLeaves(par1World, par3, par4 + k1, par5)) + { + //TODO: setBlockAndMetadata() + this.func_150516_a(par1World, par3, par4 + k1, par5, this.wood, this.woodMeta); + this.func_150516_a(par1World, par3 - 1, par4 + k1, par5, this.wood, this.woodMeta); + this.func_150516_a(par1World, par3 + 1, par4 + k1, par5, this.wood, this.woodMeta); + this.func_150516_a(par1World, par3, par4 + k1, par5 - 1, this.wood, this.woodMeta); + this.func_150516_a(par1World, par3, par4 + k1, par5 + 1, this.wood, this.woodMeta); + this.func_150516_a(par1World, par3 - 1, par4, par5 - 1, this.wood, this.woodMeta); + this.func_150516_a(par1World, par3 + 1, par4, par5 + 1, this.wood, this.woodMeta); + this.func_150516_a(par1World, par3 - 1, par4, par5 + 1, this.wood, this.woodMeta); + this.func_150516_a(par1World, par3 + 1, par4, par5 - 1, this.wood, this.woodMeta); + this.func_150516_a(par1World, par3 - 1, par4 + 1, par5 - 1, this.wood, this.woodMeta); + this.func_150516_a(par1World, par3 + 1, par4 + 1, par5 + 1, this.wood, this.woodMeta); + this.func_150516_a(par1World, par3 - 1, par4 + 1, par5 + 1, this.wood, this.woodMeta); + this.func_150516_a(par1World, par3 + 1, par4 + 1, par5 - 1, this.wood, this.woodMeta); + this.func_150516_a(par1World, par3 - 2, par4, par5, this.wood, 4); + this.func_150516_a(par1World, par3 + 2, par4, par5, this.wood, 4); + this.func_150516_a(par1World, par3, par4, par5 - 2, this.wood, 8); + this.func_150516_a(par1World, par3, par4, par5 + 2, this.wood, 8); + this.func_150516_a(par1World, par3 - 1, par4 + (l - 4), par5 - 1, this.wood, this.woodMeta); + this.func_150516_a(par1World, par3 + 1, par4 + (l - 4), par5 + 1, this.wood, this.woodMeta); + this.func_150516_a(par1World, par3 - 1, par4 + (l - 4), par5 + 1, this.wood, this.woodMeta); + this.func_150516_a(par1World, par3 + 1, par4 + (l - 4), par5 - 1, this.wood, this.woodMeta); + this.func_150516_a(par1World, par3 - 2, par4 + (l - 4), par5, this.wood, 4); + this.func_150516_a(par1World, par3 + 2, par4 + (l - 4), par5, this.wood, 4); + this.func_150516_a(par1World, par3, par4 + (l - 4), par5 - 2, this.wood, 8); + this.func_150516_a(par1World, par3, par4 + (l - 4), par5 + 2, this.wood, 8); + this.func_150516_a(par1World, par3 - 3, par4 + (l - 3), par5, this.wood, this.woodMeta); + this.func_150516_a(par1World, par3 + 3, par4 + (l - 3), par5, this.wood, this.woodMeta); + this.func_150516_a(par1World, par3, par4 + (l - 3), par5 - 3, this.wood, this.woodMeta); + this.func_150516_a(par1World, par3, par4 + (l - 3), par5 + 3, this.wood, this.woodMeta); + } + } + + for (k1 = par4 - 3 + l; k1 <= par4 + l; ++k1) + { + i3 = k1 - (par4 + l); + l1 = 3 - i3; + + for (i2 = par3 - l1; i2 <= par3 + l1; ++i2) + { + for (j2 = par5 - l1; j2 <= par5 + l1; ++j2) + { + if (par1World.func_147439_a(i2, k1, j2).isLeaves(par1World, i2, k1, j2)) + { + if (par2Random.nextInt(4) == 0 && par1World.func_147439_a(i2 - 1, k1, j2).isAir(par1World, i2 - 1, k1, j2)) + { + this.growVines(par1World, i2 - 1, k1, j2, 8); + } + + if (par2Random.nextInt(4) == 0 && par1World.func_147439_a(i2 + 1, k1, j2).isAir(par1World, i2 + 1, k1, j2)) + { + this.growVines(par1World, i2 + 1, k1, j2, 2); + } + + if (par2Random.nextInt(4) == 0 && par1World.func_147439_a(i2, k1, j2 - 1).isAir(par1World, i2, k1, j2 - 1)) + { + this.growVines(par1World, i2, k1, j2 - 1, 1); + } + + if (par2Random.nextInt(4) == 0 && par1World.func_147439_a(i2, k1, j2 + 1).isAir(par1World, i2, k1, j2 + 1)) + { + this.growVines(par1World, i2, k1, j2 + 1, 4); + } + } + } + } + } + } + + return true; + } + } + + return false; + } + + private void growVines(World world, int x, int y, int z, int flag) + { + //TODO: setBlockAndMetadata() + this.func_150516_a(world, x, y, z, Blocks.vine, flag); + int i1 = 4; + + while (true) + { + --y; + + //TODO: getBlock() + if (world.func_147439_a(x, y, z).isAir(world, x, y, z) || i1 <= 0) + { + return; + } + + //TODO: setBlockAndMetadata() + this.func_150516_a(world, x, y, z, Blocks.vine, flag); + --i1; + } + } + + +}*/ + +package biomesoplenty.common.world.features.trees; + +import java.util.Random; + +import net.minecraft.block.Block; +import net.minecraft.block.BlockSapling; +import net.minecraft.block.material.Material; +import net.minecraft.init.Blocks; +import net.minecraft.world.World; +import net.minecraft.world.gen.feature.WorldGenAbstractTree; +import net.minecraftforge.common.util.ForgeDirection; + +public class WorldGenBogTree1 extends WorldGenAbstractTree +{ + private final int minTreeHeight; + private final int randomTreeHeight; + + private final Block wood; + private final Block leaves; + + private final int woodMeta; + private final int leavesMeta; + + public WorldGenBogTree1(Block wood, Block leaves, int woodMeta, int leavesMeta, boolean doBlockNotify, int minTreeHeight, int randomTreeHeight) + { + super(doBlockNotify); + + this.wood = wood; + this.leaves = leaves; + this.woodMeta = woodMeta; + this.leavesMeta = leavesMeta; + this.minTreeHeight = minTreeHeight; + this.randomTreeHeight = randomTreeHeight; + } + + @Override + public boolean generate(World world, Random random, int x, int y, int z) + { + int l; + + for (l = random.nextInt(randomTreeHeight) + minTreeHeight; world.func_147439_a(x, y - 1, z).func_149688_o() == Material.field_151586_h; --y) + { + ; + } + + boolean flag = true; + + if (y >= 1 && y + l + 1 <= 256) + { + int j1; + int k1; + + for (int i1 = y; i1 <= y + 1 + l; ++i1) + { + byte b0 = 1; + + if (i1 == y) + { + b0 = 0; + } + + if (i1 >= y + 1 + l - 2) + { + b0 = 3; + } + + for (j1 = x - b0; j1 <= x + b0 && flag; ++j1) + { + for (k1 = z - b0; k1 <= z + b0 && flag; ++k1) + { + if (i1 >= 0 && i1 < 256) + { + Block block = world.func_147439_a(j1, i1, k1); + + if (!(block.isAir(world, j1, i1, k1) || block.isLeaves(world, j1, i1, k1))) + { + if (block != Blocks.water && block != Blocks.flowing_water) + { + flag = false; + } + else if (i1 > y) + { + flag = false; + } + } + } + else + { + flag = false; + } + } + } + } + + if (!flag) + { + return false; + } + else + { + Block block1 = world.func_147439_a(x, y - 1, z); + + boolean isSoil = block1.canSustainPlant(world, x, y - 1, z, ForgeDirection.UP, (BlockSapling)Blocks.sapling); + if (isSoil && y < 256 - l - 1) + { + block1.onPlantGrow(world, x, y - 1, z, x, y, z); + int l1; + int l2; + int k2; + + for (k2 = y - 3 + l; k2 <= y + l; ++k2) + { + j1 = k2 - (y + l); + k1 = 3 - j1; + + for (l2 = x - k1; l2 <= x + k1; ++l2) + { + l1 = l2 - x; + + for (int i2 = z - k1; i2 <= z + k1; ++i2) + { + int j2 = i2 - z; + + if ((Math.abs(l1) != k1 || Math.abs(j2) != k1 || random.nextInt(2) != 0 && j1 != 0) && world.func_147439_a(l2, k2, i2).canBeReplacedByLeaves(world, l2, k2, i2)) + { + this.func_150516_a(world, l2, k2, i2, this.leaves, this.leavesMeta); + } + } + } + } + + for (k2 = 0; k2 < l; ++k2) + { + Block block2 = world.func_147439_a(x, y + k2, z); + + if (block2.isAir(world, x, y + k2, z) || block2.isLeaves(world, x, y + k2, z) || block2 == Blocks.flowing_water || block2 == Blocks.water) + { + //TODO: setBlockAndMetadata() + this.func_150516_a(world, x, y + k2, z, this.wood, this.woodMeta); + this.func_150516_a(world, x - 1, y + k2, z, this.wood, this.woodMeta); + this.func_150516_a(world, x + 1, y + k2, z, this.wood, this.woodMeta); + this.func_150516_a(world, x, y + k2, z - 1, this.wood, this.woodMeta); + this.func_150516_a(world, x, y + k2, z + 1, this.wood, this.woodMeta); + this.func_150516_a(world, x - 1, y, z - 1, this.wood, this.woodMeta); + this.func_150516_a(world, x + 1, y, z + 1, this.wood, this.woodMeta); + this.func_150516_a(world, x - 1, y, z + 1, this.wood, this.woodMeta); + this.func_150516_a(world, x + 1, y, z - 1, this.wood, this.woodMeta); + this.func_150516_a(world, x - 1, y + 1, z - 1, this.wood, this.woodMeta); + this.func_150516_a(world, x + 1, y + 1, z + 1, this.wood, this.woodMeta); + this.func_150516_a(world, x - 1, y + 1, z + 1, this.wood, this.woodMeta); + this.func_150516_a(world, x + 1, y + 1, z - 1, this.wood, this.woodMeta); + this.func_150516_a(world, x - 2, y, z, this.wood, 4); + this.func_150516_a(world, x + 2, y, z, this.wood, 4); + this.func_150516_a(world, x, y, z - 2, this.wood, 8); + this.func_150516_a(world, x, y, z + 2, this.wood, 8); + this.func_150516_a(world, x - 1, y + (l - 4), z - 1, this.wood, this.woodMeta); + this.func_150516_a(world, x + 1, y + (l - 4), z + 1, this.wood, this.woodMeta); + this.func_150516_a(world, x - 1, y + (l - 4), z + 1, this.wood, this.woodMeta); + this.func_150516_a(world, x + 1, y + (l - 4), z - 1, this.wood, this.woodMeta); + this.func_150516_a(world, x - 2, y + (l - 4), z, this.wood, 4); + this.func_150516_a(world, x + 2, y + (l - 4), z, this.wood, 4); + this.func_150516_a(world, x, y + (l - 4), z - 2, this.wood, 8); + this.func_150516_a(world, x, y + (l - 4), z + 2, this.wood, 8); + this.func_150516_a(world, x - 3, y + (l - 3), z, this.wood, this.woodMeta); + this.func_150516_a(world, x + 3, y + (l - 3), z, this.wood, this.woodMeta); + this.func_150516_a(world, x, y + (l - 3), z - 3, this.wood, this.woodMeta); + this.func_150516_a(world, x, y + (l - 3), z + 3, this.wood, this.woodMeta); + } + } + + for (k2 = y - 3 + l; k2 <= y + l; ++k2) + { + j1 = k2 - (y + l); + k1 = 3 - j1; + + for (l2 = x - k1; l2 <= x + k1; ++l2) + { + for (l1 = z - k1; l1 <= z + k1; ++l1) + { + if (world.func_147439_a(l2, k2, l1).isLeaves(world, l2, k2, l1)) + { + if (random.nextInt(4) == 0 && world.func_147439_a(l2 - 1, k2, l1).isAir(world, l2 - 1, k2, l1)) + { + this.generateVines(world, l2 - 1, k2, l1, 8); + } + + if (random.nextInt(4) == 0 && world.func_147439_a(l2 + 1, k2, l1).isAir(world, l2 + 1, k2, l1)) + { + this.generateVines(world, l2 + 1, k2, l1, 2); + } + + if (random.nextInt(4) == 0 && world.func_147439_a(l2, k2, l1 - 1).isAir(world, l2, k2, l1 - 1)) + { + this.generateVines(world, l2, k2, l1 - 1, 1); + } + + if (random.nextInt(4) == 0 && world.func_147439_a(l2, k2, l1 + 1).isAir(world, l2, k2, l1 + 1)) + { + this.generateVines(world, l2, k2, l1 + 1, 4); + } + } + } + } + } + + return true; + } + else + { + return false; + } + } + } + else + { + return false; + } + } + + // JAVADOC METHOD $$ func_76536_b + private void generateVines(World par1World, int par2, int par3, int par4, int par5) + { + this.func_150516_a(par1World, par2, par3, par4, Blocks.vine, par5); + int i1 = 4; + + while (true) + { + --par3; + + if (!(par1World.func_147439_a(par2, par3, par4).isAir(par1World, par2, par3, par4)) || i1 <= 0) + { + return; + } + + this.func_150516_a(par1World, par2, par3, par4, Blocks.vine, par5); + --i1; + } + } +} diff --git a/src/main/java/biomesoplenty/common/world/features/trees/WorldGenBogTree2.java b/src/main/java/biomesoplenty/common/world/features/trees/WorldGenBogTree2.java new file mode 100644 index 000000000..b61959326 --- /dev/null +++ b/src/main/java/biomesoplenty/common/world/features/trees/WorldGenBogTree2.java @@ -0,0 +1,457 @@ +/*package biomesoplenty.common.world.features.trees; + +import java.util.Random; + +import net.minecraft.block.Block; +import net.minecraft.block.BlockSapling; +import net.minecraft.init.Blocks; +import net.minecraft.util.Direction; +import net.minecraft.world.World; +import net.minecraft.world.gen.feature.WorldGenAbstractTree; +import net.minecraftforge.common.util.ForgeDirection; + +public class WorldGenBogTree1 extends WorldGenAbstractTree +{ + private final int minTreeHeight; + private final int randomTreeHeight; + + private final Block wood; + private final Block leaves; + + private final int woodMeta; + private final int leavesMeta; + + public WorldGenBogTree1(Block wood, Block leaves, int woodMeta, int leavesMeta, boolean doBlockNotify, int minTreeHeight, int randomTreeHeight) + { + super(doBlockNotify); + + this.wood = wood; + this.leaves = leaves; + this.woodMeta = woodMeta; + this.leavesMeta = leavesMeta; + this.minTreeHeight = minTreeHeight; + this.randomTreeHeight = randomTreeHeight; + } + + @Override + public boolean generate(World par1World, Random par2Random, int par3, int par4, int par5) + { + int l = par2Random.nextInt(this.randomTreeHeight) + this.minTreeHeight; + boolean flag = true; + + if (par4 >= 1 && par4 + l + 1 <= 256) + { + byte b0; + int k1; + Block block; + + for (int i1 = par4; i1 <= par4 + 1 + l; ++i1) + { + b0 = 1; + + if (i1 == par4) + { + b0 = 0; + } + + if (i1 >= par4 + 1 + l - 2) + { + b0 = 3; + } + + for (int j1 = par3 - b0; j1 <= par3 + b0 && flag; ++j1) + { + for (k1 = par5 - b0; k1 <= par5 + b0 && flag; ++k1) + { + if (i1 >= 0 && i1 < 256) + { + block = par1World.func_147439_a(j1, i1, k1); + + if (!this.isReplaceable(par1World, j1, i1, k1)) + { + flag = false; + } + } + else + { + flag = false; + } + } + } + } + + if (!flag) + { + return false; + } + else + { + Block block2 = par1World.func_147439_a(par3, par4 - 1, par5); + + boolean isSoil = block2.canSustainPlant(par1World, par3, par4 - 1, par5, ForgeDirection.UP, (BlockSapling)Blocks.sapling); + + if (isSoil && par4 < 256 - l - 1) + { + block2.onPlantGrow(par1World, par3, par4 - 1, par5, par3, par4, par5); + b0 = 3; + int l1; + int i2; + int j2; + int i3; + + for (k1 = par4 - b0 + l; k1 <= par4 + l; ++k1) + { + i3 = k1 - (par4 + l); + l1 = 3 - i3; + + for (i2 = par3 - l1; i2 <= par3 + l1; ++i2) + { + j2 = i2 - par3; + + for (int k2 = par5 - l1; k2 <= par5 + l1; ++k2) + { + int l2 = k2 - par5; + + if (Math.abs(j2) != l1 || Math.abs(l2) != l1 || par2Random.nextInt(2) != 0 && i3 != 0) + { + Block block1 = par1World.func_147439_a(i2, k1, k2); + + if (block1.isAir(par1World, i2, k1, k2) || block1.isLeaves(par1World, i2, k1, k2)) + { + this.func_150516_a(par1World, i2, k1, k2, this.leaves, this.leavesMeta); + } + } + } + } + } + + for (k1 = 0; k1 < l; ++k1) + { + block = par1World.func_147439_a(par3, par4 + k1, par5); + + if (block.isAir(par1World, par3, par4 + k1, par5) || block.isLeaves(par1World, par3, par4 + k1, par5)) + { + //TODO: setBlockAndMetadata() + this.func_150516_a(par1World, par3, par4 + k1, par5, this.wood, this.woodMeta); + this.func_150516_a(par1World, par3 - 1, par4 + k1, par5, this.wood, this.woodMeta); + this.func_150516_a(par1World, par3 + 1, par4 + k1, par5, this.wood, this.woodMeta); + this.func_150516_a(par1World, par3, par4 + k1, par5 - 1, this.wood, this.woodMeta); + this.func_150516_a(par1World, par3, par4 + k1, par5 + 1, this.wood, this.woodMeta); + this.func_150516_a(par1World, par3 - 1, par4, par5 - 1, this.wood, this.woodMeta); + this.func_150516_a(par1World, par3 + 1, par4, par5 + 1, this.wood, this.woodMeta); + this.func_150516_a(par1World, par3 - 1, par4, par5 + 1, this.wood, this.woodMeta); + this.func_150516_a(par1World, par3 + 1, par4, par5 - 1, this.wood, this.woodMeta); + this.func_150516_a(par1World, par3 - 1, par4 + 1, par5 - 1, this.wood, this.woodMeta); + this.func_150516_a(par1World, par3 + 1, par4 + 1, par5 + 1, this.wood, this.woodMeta); + this.func_150516_a(par1World, par3 - 1, par4 + 1, par5 + 1, this.wood, this.woodMeta); + this.func_150516_a(par1World, par3 + 1, par4 + 1, par5 - 1, this.wood, this.woodMeta); + this.func_150516_a(par1World, par3 - 2, par4, par5, this.wood, 4); + this.func_150516_a(par1World, par3 + 2, par4, par5, this.wood, 4); + this.func_150516_a(par1World, par3, par4, par5 - 2, this.wood, 8); + this.func_150516_a(par1World, par3, par4, par5 + 2, this.wood, 8); + this.func_150516_a(par1World, par3 - 1, par4 + (l - 4), par5 - 1, this.wood, this.woodMeta); + this.func_150516_a(par1World, par3 + 1, par4 + (l - 4), par5 + 1, this.wood, this.woodMeta); + this.func_150516_a(par1World, par3 - 1, par4 + (l - 4), par5 + 1, this.wood, this.woodMeta); + this.func_150516_a(par1World, par3 + 1, par4 + (l - 4), par5 - 1, this.wood, this.woodMeta); + this.func_150516_a(par1World, par3 - 2, par4 + (l - 4), par5, this.wood, 4); + this.func_150516_a(par1World, par3 + 2, par4 + (l - 4), par5, this.wood, 4); + this.func_150516_a(par1World, par3, par4 + (l - 4), par5 - 2, this.wood, 8); + this.func_150516_a(par1World, par3, par4 + (l - 4), par5 + 2, this.wood, 8); + this.func_150516_a(par1World, par3 - 3, par4 + (l - 3), par5, this.wood, this.woodMeta); + this.func_150516_a(par1World, par3 + 3, par4 + (l - 3), par5, this.wood, this.woodMeta); + this.func_150516_a(par1World, par3, par4 + (l - 3), par5 - 3, this.wood, this.woodMeta); + this.func_150516_a(par1World, par3, par4 + (l - 3), par5 + 3, this.wood, this.woodMeta); + } + } + + for (k1 = par4 - 3 + l; k1 <= par4 + l; ++k1) + { + i3 = k1 - (par4 + l); + l1 = 3 - i3; + + for (i2 = par3 - l1; i2 <= par3 + l1; ++i2) + { + for (j2 = par5 - l1; j2 <= par5 + l1; ++j2) + { + if (par1World.func_147439_a(i2, k1, j2).isLeaves(par1World, i2, k1, j2)) + { + if (par2Random.nextInt(4) == 0 && par1World.func_147439_a(i2 - 1, k1, j2).isAir(par1World, i2 - 1, k1, j2)) + { + this.growVines(par1World, i2 - 1, k1, j2, 8); + } + + if (par2Random.nextInt(4) == 0 && par1World.func_147439_a(i2 + 1, k1, j2).isAir(par1World, i2 + 1, k1, j2)) + { + this.growVines(par1World, i2 + 1, k1, j2, 2); + } + + if (par2Random.nextInt(4) == 0 && par1World.func_147439_a(i2, k1, j2 - 1).isAir(par1World, i2, k1, j2 - 1)) + { + this.growVines(par1World, i2, k1, j2 - 1, 1); + } + + if (par2Random.nextInt(4) == 0 && par1World.func_147439_a(i2, k1, j2 + 1).isAir(par1World, i2, k1, j2 + 1)) + { + this.growVines(par1World, i2, k1, j2 + 1, 4); + } + } + } + } + } + } + + return true; + } + } + + return false; + } + + private void growVines(World world, int x, int y, int z, int flag) + { + //TODO: setBlockAndMetadata() + this.func_150516_a(world, x, y, z, Blocks.vine, flag); + int i1 = 4; + + while (true) + { + --y; + + //TODO: getBlock() + if (world.func_147439_a(x, y, z).isAir(world, x, y, z) || i1 <= 0) + { + return; + } + + //TODO: setBlockAndMetadata() + this.func_150516_a(world, x, y, z, Blocks.vine, flag); + --i1; + } + } + + +}*/ + +package biomesoplenty.common.world.features.trees; + +import java.util.Random; + +import net.minecraft.block.Block; +import net.minecraft.block.BlockSapling; +import net.minecraft.block.material.Material; +import net.minecraft.init.Blocks; +import net.minecraft.world.World; +import net.minecraft.world.gen.feature.WorldGenAbstractTree; +import net.minecraftforge.common.util.ForgeDirection; + +public class WorldGenBogTree2 extends WorldGenAbstractTree +{ + private final int minTreeHeight; + private final int randomTreeHeight; + + private final Block wood; + private final Block leaves; + + private final int woodMeta; + private final int leavesMeta; + + public WorldGenBogTree2(Block wood, Block leaves, int woodMeta, int leavesMeta, boolean doBlockNotify, int minTreeHeight, int randomTreeHeight) + { + super(doBlockNotify); + + this.wood = wood; + this.leaves = leaves; + this.woodMeta = woodMeta; + this.leavesMeta = leavesMeta; + this.minTreeHeight = minTreeHeight; + this.randomTreeHeight = randomTreeHeight; + } + + @Override + public boolean generate(World world, Random random, int x, int y, int z) + { + int l; + + for (l = random.nextInt(randomTreeHeight) + minTreeHeight; world.func_147439_a(x, y - 1, z).func_149688_o() == Material.field_151586_h; --y) + { + ; + } + + boolean flag = true; + + if (y >= 1 && y + l + 1 <= 256) + { + int j1; + int k1; + + for (int i1 = y; i1 <= y + 1 + l; ++i1) + { + byte b0 = 1; + + if (i1 == y) + { + b0 = 0; + } + + if (i1 >= y + 1 + l - 2) + { + b0 = 3; + } + + for (j1 = x - b0; j1 <= x + b0 && flag; ++j1) + { + for (k1 = z - b0; k1 <= z + b0 && flag; ++k1) + { + if (i1 >= 0 && i1 < 256) + { + Block block = world.func_147439_a(j1, i1, k1); + + if (!(block.isAir(world, j1, i1, k1) || block.isLeaves(world, j1, i1, k1))) + { + if (block != Blocks.water && block != Blocks.flowing_water) + { + flag = false; + } + else if (i1 > y) + { + flag = false; + } + } + } + else + { + flag = false; + } + } + } + } + + if (!flag) + { + return false; + } + else + { + Block block1 = world.func_147439_a(x, y - 1, z); + + boolean isSoil = block1.canSustainPlant(world, x, y - 1, z, ForgeDirection.UP, (BlockSapling)Blocks.sapling); + if (isSoil && y < 256 - l - 1) + { + block1.onPlantGrow(world, x, y - 1, z, x, y, z); + int l1; + int l2; + int k2; + + for (k2 = y - 3 + l; k2 <= y + l; ++k2) + { + j1 = k2 - (y + l); + k1 = 2 - j1 / 2; + + for (l2 = x - k1; l2 <= x + k1; ++l2) + { + l1 = l2 - x; + + for (int i2 = z - k1; i2 <= z + k1; ++i2) + { + int j2 = i2 - z; + + if ((Math.abs(l1) != k1 || Math.abs(j2) != k1 || random.nextInt(2) != 0 && j1 != 0) && world.func_147439_a(l2, k2, i2).canBeReplacedByLeaves(world, l2, k2, i2)) + { + this.func_150516_a(world, l2, k2, i2, this.leaves, this.leavesMeta); + } + } + } + } + + for (k2 = 0; k2 < l; ++k2) + { + Block block2 = world.func_147439_a(x, y + k2, z); + + if (block2.isAir(world, x, y + k2, z) || block2.isLeaves(world, x, y + k2, z) || block2 == Blocks.flowing_water || block2 == Blocks.water) + { + //TODO: setBlockAndMetadata() + this.func_150516_a(world, x, y + k2, z, this.wood, this.woodMeta); + this.func_150516_a(world, x - 1, y, z, this.wood, this.woodMeta + 4); + this.func_150516_a(world, x + 1, y, z, this.wood, this.woodMeta + 4); + this.func_150516_a(world, x, y, z - 1, this.wood, this.woodMeta + 8); + this.func_150516_a(world, x, y, z + 1, this.wood, this.woodMeta + 8); + this.func_150516_a(world, x - 1, y + (l - 4), z, this.wood, this.woodMeta + 4); + this.func_150516_a(world, x + 1, y + (l - 4), z, this.wood, this.woodMeta + 4); + this.func_150516_a(world, x, y + (l - 4), z - 1, this.wood, this.woodMeta + 8); + this.func_150516_a(world, x, y + (l - 4), z + 1, this.wood, this.woodMeta + 8); + this.func_150516_a(world, x - 2, y + (l - 3), z, this.wood, this.woodMeta); + this.func_150516_a(world, x + 2, y + (l - 3), z, this.wood, this.woodMeta); + this.func_150516_a(world, x, y + (l - 3), z - 2, this.wood, this.woodMeta); + this.func_150516_a(world, x, y + (l - 3), z + 2, this.wood, this.woodMeta); + } + } + + for (k2 = y - 3 + l; k2 <= y + l; ++k2) + { + j1 = k2 - (y + l); + k1 = 2 - j1 / 2; + + for (l2 = x - k1; l2 <= x + k1; ++l2) + { + for (l1 = z - k1; l1 <= z + k1; ++l1) + { + if (world.func_147439_a(l2, k2, l1).isLeaves(world, l2, k2, l1)) + { + if (random.nextInt(4) == 0 && world.func_147439_a(l2 - 1, k2, l1).isAir(world, l2 - 1, k2, l1)) + { + this.generateVines(world, l2 - 1, k2, l1, 8); + } + + if (random.nextInt(4) == 0 && world.func_147439_a(l2 + 1, k2, l1).isAir(world, l2 + 1, k2, l1)) + { + this.generateVines(world, l2 + 1, k2, l1, 2); + } + + if (random.nextInt(4) == 0 && world.func_147439_a(l2, k2, l1 - 1).isAir(world, l2, k2, l1 - 1)) + { + this.generateVines(world, l2, k2, l1 - 1, 1); + } + + if (random.nextInt(4) == 0 && world.func_147439_a(l2, k2, l1 + 1).isAir(world, l2, k2, l1 + 1)) + { + this.generateVines(world, l2, k2, l1 + 1, 4); + } + } + } + } + } + + return true; + } + else + { + return false; + } + } + } + else + { + return false; + } + } + + // JAVADOC METHOD $$ func_76536_b + private void generateVines(World par1World, int par2, int par3, int par4, int par5) + { + this.func_150516_a(par1World, par2, par3, par4, Blocks.vine, par5); + int i1 = 4; + + while (true) + { + --par3; + + if (!(par1World.func_147439_a(par2, par3, par4).isAir(par1World, par2, par3, par4)) || i1 <= 0) + { + return; + } + + this.func_150516_a(par1World, par2, par3, par4, Blocks.vine, par5); + --i1; + } + } +} diff --git a/src/main/java/biomesoplenty/common/world/features/trees/WorldGenPalmTree1.java b/src/main/java/biomesoplenty/common/world/features/trees/WorldGenPalmTree1.java new file mode 100644 index 000000000..d748c67c7 --- /dev/null +++ b/src/main/java/biomesoplenty/common/world/features/trees/WorldGenPalmTree1.java @@ -0,0 +1,113 @@ +package biomesoplenty.common.world.features.trees; + +import java.util.Random; + +import net.minecraft.block.Block; +import net.minecraft.init.Blocks; +import net.minecraft.world.World; +import net.minecraft.world.gen.feature.WorldGenAbstractTree; +import biomesoplenty.api.BOPBlockHelper; + +public class WorldGenPalmTree1 extends WorldGenAbstractTree +{ + public WorldGenPalmTree1() + { + super(false); + } + + @Override + public boolean generate(World world, Random random, int x, int y, int z) + { + //TODO: isAirBlock() + while (world.func_147437_c(x, y, z) && y > 2) + { + --y; + } + + //TODO: getBlock() + Block block = world.func_147439_a(x, y, z); + + if (block != Blocks.grass) + { + return false; + } + else + { + for (int var7 = -2; var7 <= 2; ++var7) + { + for (int var8 = -2; var8 <= 2; ++var8) + { + //TODO: isAirBlock() isAirBlock() isAirBlock() + if (world.func_147437_c(x + var7, y - 1, z + var8) && world.func_147437_c(x + var7, y - 2, z + var8) && !world.func_147437_c(x + var7, y, z + var8)) + { + return false; + } + } + } + + //settings======== + double strength = random.nextInt(35) / 100D; + //================ + + double xoff = 0; + double yoff = 0; + int r = random.nextInt(4); + if(r == 0) { xoff = strength; } + else if(r == 1) { xoff = -strength; } + else if(r == 2) { yoff = strength; } + else { yoff = -strength; } + + int h = 1; + buildBlock(world, x, y, z, Blocks.dirt, 0); + for(int b = 0; b < 10; b++) + { + buildBlock(world, x + ((int) Math.floor(xoff)), y + h, z + ((int) Math.floor(yoff)), BOPBlockHelper.get("logs2"), 3); + if(b == 9) + { + generateTop(world, x + ((int) Math.floor(xoff)), y + h, z + ((int) Math.floor(yoff))); + } + else + { + h++; + xoff *= 1.3D; + yoff *= 1.3D; + } + } + + return true; + } + } + + public void generateTop(World world, int x, int y, int z) + { + buildBlock(world, x + 2, y - 1, z, BOPBlockHelper.get("colorizedLeaves1"), 2); + buildBlock(world, x - 2, y - 1, z, BOPBlockHelper.get("colorizedLeaves1"), 2); + buildBlock(world, x, y - 1, z + 2, BOPBlockHelper.get("colorizedLeaves1"), 2); + buildBlock(world, x, y - 1, z - 2, BOPBlockHelper.get("colorizedLeaves1"), 2); + + buildBlock(world, x + 1, y, z, BOPBlockHelper.get("colorizedLeaves1"), 2); + buildBlock(world, x - 1, y, z, BOPBlockHelper.get("colorizedLeaves1"), 2); + buildBlock(world, x, y, z + 1, BOPBlockHelper.get("colorizedLeaves1"), 2); + buildBlock(world, x, y, z - 1, BOPBlockHelper.get("colorizedLeaves1"), 2); + buildBlock(world, x + 2, y, z + 2, BOPBlockHelper.get("colorizedLeaves1"), 2); + buildBlock(world, x - 2, y, z - 2, BOPBlockHelper.get("colorizedLeaves1"), 2); + buildBlock(world, x + 2, y, z - 2, BOPBlockHelper.get("colorizedLeaves1"), 2); + buildBlock(world, x - 2, y, z + 2, BOPBlockHelper.get("colorizedLeaves1"), 2); + + buildBlock(world, x + 1, y + 1, z - 1, BOPBlockHelper.get("colorizedLeaves1"), 2); + buildBlock(world, x - 1, y + 1, z + 1, BOPBlockHelper.get("colorizedLeaves1"), 2); + buildBlock(world, x + 1, y + 1, z + 1, BOPBlockHelper.get("colorizedLeaves1"), 2); + buildBlock(world, x - 1, y + 1, z - 1, BOPBlockHelper.get("colorizedLeaves1"), 2); + buildBlock(world, x, y + 1, z, BOPBlockHelper.get("colorizedLeaves1"), 2); + + buildBlock(world, x + 2, y + 2, z, BOPBlockHelper.get("colorizedLeaves1"), 2); + buildBlock(world, x - 2, y + 2, z, BOPBlockHelper.get("colorizedLeaves1"), 2); + buildBlock(world, x, y + 2, z + 2, BOPBlockHelper.get("colorizedLeaves1"), 2); + buildBlock(world, x, y + 2, z - 2, BOPBlockHelper.get("colorizedLeaves1"), 2); + } + + public void buildBlock(World world, int x, int y, int z, Block block, int meta) + { + world.func_147465_d(x, y, z, block, meta, 2); + } +} diff --git a/src/main/java/biomesoplenty/common/world/features/WorldGenRainforestTree1.java b/src/main/java/biomesoplenty/common/world/features/trees/WorldGenRainforestTree1.java similarity index 99% rename from src/main/java/biomesoplenty/common/world/features/WorldGenRainforestTree1.java rename to src/main/java/biomesoplenty/common/world/features/trees/WorldGenRainforestTree1.java index 462b1c597..69889aeb6 100644 --- a/src/main/java/biomesoplenty/common/world/features/WorldGenRainforestTree1.java +++ b/src/main/java/biomesoplenty/common/world/features/trees/WorldGenRainforestTree1.java @@ -1,4 +1,4 @@ -package biomesoplenty.common.world.features; +package biomesoplenty.common.world.features.trees; import java.util.Random; import net.minecraft.block.Block; diff --git a/src/main/java/biomesoplenty/common/world/features/trees/WorldGenTropicsShrub.java b/src/main/java/biomesoplenty/common/world/features/trees/WorldGenTropicsShrub.java new file mode 100644 index 000000000..3df3e9ace --- /dev/null +++ b/src/main/java/biomesoplenty/common/world/features/trees/WorldGenTropicsShrub.java @@ -0,0 +1,120 @@ +package biomesoplenty.common.world.features.trees; + +import java.util.Random; + +import net.minecraft.block.Block; +import net.minecraft.init.Blocks; +import net.minecraft.world.World; +import net.minecraft.world.gen.feature.WorldGenAbstractTree; + +public class WorldGenTropicsShrub extends WorldGenAbstractTree +{ + public WorldGenTropicsShrub() + { + super(false); + } + + @Override + public boolean generate(World world, Random random, int x, int y, int z) + { + //TODO: isAirBlock() + while (world.func_147437_c(x, y, z) && y > 2) + { + --y; + } + + //TODO: getBlock() + Block block = world.func_147439_a(x, y, z); + + if (block != Blocks.grass && block != Blocks.sand) + { + return false; + } + else + { + for (int var7 = -2; var7 <= 2; ++var7) + { + for (int var8 = -2; var8 <= 2; ++var8) + { + //TODO: isAirBlock() isAirBlock() + if (world.func_147437_c(x + var7, y - 1, z + var8) && world.func_147437_c(x + var7, y - 2, z + var8)) + { + return false; + } + } + } + + //TODO: setBlock() + world.func_147449_b(x, y, z, Blocks.dirt); + world.func_147465_d(x, y + 1, z, Blocks.log, 3, 2); + world.func_147465_d(x, y + 2, z, Blocks.log, 3, 2); + world.func_147465_d(x + 1, y + 2, z, Blocks.leaves, 3, 2); + world.func_147465_d(x - 1, y + 2, z, Blocks.leaves, 3, 2); + world.func_147465_d(x, y + 2, z + 1, Blocks.leaves, 3, 2); + world.func_147465_d(x, y + 2, z - 1, Blocks.leaves, 3, 2); + world.func_147465_d(x, y + 3, z, Blocks.leaves, 3, 2); + + int var999 = random.nextInt(12); + int var998 = random.nextInt(4); + + if (var998 == 0) + { + if (var999 == 0) + { + world.func_147465_d(x - 1, y + 1, z, Blocks.cocoa, 11, 2); + } + if (var999 == 1) + { + world.func_147465_d(x + 1, y + 1, z, Blocks.cocoa, 9, 2); + } + if (var999 == 2) + { + world.func_147465_d(x, y + 1, z - 1, Blocks.cocoa, 8, 2); + } + if (var999 == 3) + { + world.func_147465_d(x, y + 1, z + 1, Blocks.cocoa, 10, 2); + } + } + else if (var998 == 1) + { + if (var999 == 0) + { + world.func_147465_d(x - 1, y + 1, z, Blocks.cocoa, 7, 2); + } + if (var999 == 1) + { + world.func_147465_d(x + 1, y + 1, z, Blocks.cocoa, 5, 2); + } + if (var999 == 2) + { + world.func_147465_d(x, y + 1, z - 1, Blocks.cocoa, 4, 2); + } + if (var999 == 3) + { + world.func_147465_d(x, y + 1, z + 1, Blocks.cocoa, 6, 2); + } + } + else if (var998 == 2) + { + if (var999 == 0) + { + world.func_147465_d(x - 1, y + 1, z, Blocks.cocoa, 3, 2); + } + if (var999 == 1) + { + world.func_147465_d(x + 1, y + 1, z, Blocks.cocoa, 1, 2); + } + if (var999 == 2) + { + world.func_147465_d(x, y + 1, z - 1, Blocks.cocoa, 0, 2); + } + if (var999 == 3) + { + world.func_147465_d(x, y + 1, z + 1, Blocks.cocoa, 2, 2); + } + } + return true; + } + } +} diff --git a/src/main/java/biomesoplenty/common/world/generation/WorldGenFieldAssociation.java b/src/main/java/biomesoplenty/common/world/generation/WorldGenFieldAssociation.java index f6146721f..b6d7c28d5 100644 --- a/src/main/java/biomesoplenty/common/world/generation/WorldGenFieldAssociation.java +++ b/src/main/java/biomesoplenty/common/world/generation/WorldGenFieldAssociation.java @@ -12,6 +12,7 @@ import biomesoplenty.common.world.features.WorldGenBOPDoubleFlora; import biomesoplenty.common.world.features.WorldGenBOPFlora; import biomesoplenty.common.world.features.WorldGenBOPTallGrass; import biomesoplenty.common.world.features.WorldGenGrassSplatter; +import biomesoplenty.common.world.features.WorldGenLavaSpout; import biomesoplenty.common.world.features.WorldGenLog; import biomesoplenty.common.world.features.WorldGenRiverCane; import biomesoplenty.common.world.features.WorldGenRockpile; @@ -37,6 +38,7 @@ public class WorldGenFieldAssociation associateField("generateGrass", new WorldGenSplotches(Blocks.grass, 0, 48, BOPBlockHelper.get("redRock"))); associateField("generateSand", new WorldGenSplotches(Blocks.sand, 0, 32, BOPBlockHelper.get("redRock"))); associateField("generateQuagmire", new WorldGenSplotches(Blocks.grass, 0, 48, BOPBlockHelper.get("mud"))); + associateField("generateAsh", new WorldGenSplotches(BOPBlockHelper.get("ash"), 0, 32, BOPBlockHelper.get("ashStone"), Blocks.netherrack)); associateField("generateMelons", new WorldGenMelon()); associateField("waterPoolsPerChunk", new WorldGenLiquids(Blocks.flowing_water)); @@ -75,6 +77,7 @@ public class WorldGenFieldAssociation associateField("grassSplatterPerChunk", new WorldGenGrassSplatter()); associateField("rockpilesPerChunk", new WorldGenRockpile()); associateField("logsPerChunk", new WorldGenLog()); + associateField("lavaSpoutsPerChunk", new WorldGenLavaSpout()); associateField("doubleTallGrassPerChunk", new WorldGenBOPDoubleFlora(Blocks.double_plant, Blocks.double_plant, 2, 8)); associateField("sunflowersPerChunk", new WorldGenBOPDoubleFlora(Blocks.double_plant, Blocks.double_plant, 0, 8));