From 45a2a27ca4c13f5e71608e3af749f1afba1e9023 Mon Sep 17 00:00:00 2001 From: Vexatos Date: Thu, 26 Sep 2013 21:52:57 +0200 Subject: [PATCH 01/15] Update de_DE.lang --- resources/assets/biomesoplenty/lang/de_DE.lang | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git a/resources/assets/biomesoplenty/lang/de_DE.lang b/resources/assets/biomesoplenty/lang/de_DE.lang index 03e164454..555301e50 100644 --- a/resources/assets/biomesoplenty/lang/de_DE.lang +++ b/resources/assets/biomesoplenty/lang/de_DE.lang @@ -27,9 +27,10 @@ tile.bop.plants.barley.name=Gerste tile.bop.plants.cattail.name=Rohrkolben tile.bop.plants.cattailtop.name=Rohrkolben tile.bop.plants.cattailbottom.name=Rohrkolben -tile.bop.plants.reed.name=Schilf +tile.bop.plants.rivercane.name=Flussschilfrohr tile.bop.plants.cactus.name=Kleiner Kaktus tile.bop.plants.witherwart.name=Witherwarze +tile.bop.plants.reed.name=Schilfgras tile.bop.flowers.clover.name=Klee tile.bop.flowers.swampflower.name=Sumpfblume @@ -64,7 +65,7 @@ tile.bop.foliage.highgrassbottom.name=Hohes Gras tile.bop.foliage.bush.name=Busch tile.bop.foliage.sprout.name=Sprössling tile.bop.foliage.highgrasstop.name=Hohes Gras -tile.bop.foliage.poisonivy.name=Gift-Efeu +tile.bop.foliage.poisonivy.name=Giftefeu tile.bop.foliage.berrybush.name=Beerenbusch tile.bop.foliage.shrub.name=Strauch tile.bop.foliage.wheatgrass.name=Weizengras @@ -366,12 +367,12 @@ item.bop.flippers.name=Schwimmflossen item.bop.bopBucket.amethyst_empty.name=Amethyst-Eimer item.bop.bopBucket.amethyst_spring_water.name=Amethyst-Eimer mit Quellwasser -item.bop.bopBucket.liquid_poison.name=Eimer mit Gift +item.bop.bopBucket.liquid_poison.name=Eimer mit Flüssigem Gift -tile.bop.liquidPoison.name=Gift +tile.bop.liquidPoison.name=Flüssiges Gift tile.bop.springWater.name=Quellwasser -fluid.bop.liquidPoison=Gift +fluid.bop.liquidPoison=Flüssiges Gift fluid.bop.springWater=Quellwasser phrase.bop.promisedPortalOverworld=Ein Portal zum gelobten Land ist im Himmel entstanden. @@ -380,5 +381,3 @@ phrase.bop.promisedPortalOther=Ein Portal ist im Himmel entstanden. itemGroup.tabBiomesOPlenty=Biomes O' Plenty generator.BIOMESOP=Biomes O' Plenty - - From 47bd4d85ac279bcf16aa49fe363c1357358c8dd5 Mon Sep 17 00:00:00 2001 From: Matt Caughey Date: Fri, 27 Sep 2013 02:41:54 -0400 Subject: [PATCH 02/15] Added a redwood shrub thing to Redwood Forests --- .../biomes/BiomeDecoratorBOP.java | 13 ++++ .../biomes/BiomeGenRedwoodForest.java | 6 +- .../worldgen/WorldGenRedwoodShrub.java | 69 +++++++++++++++++++ .../worldgen/tree/WorldGenRedwoodTree.java | 8 +-- .../worldgen/tree/WorldGenRedwoodTree2.java | 8 +-- 5 files changed, 94 insertions(+), 10 deletions(-) create mode 100644 common/biomesoplenty/worldgen/WorldGenRedwoodShrub.java diff --git a/common/biomesoplenty/biomes/BiomeDecoratorBOP.java b/common/biomesoplenty/biomes/BiomeDecoratorBOP.java index 39f5d2ea0..2e783e17e 100644 --- a/common/biomesoplenty/biomes/BiomeDecoratorBOP.java +++ b/common/biomesoplenty/biomes/BiomeDecoratorBOP.java @@ -90,6 +90,7 @@ import biomesoplenty.worldgen.WorldGenPotatoes; import biomesoplenty.worldgen.WorldGenPumpkinAlt; import biomesoplenty.worldgen.WorldGenQuagmire; import biomesoplenty.worldgen.WorldGenQuicksand; +import biomesoplenty.worldgen.WorldGenRedwoodShrub; import biomesoplenty.worldgen.WorldGenReedBOP; import biomesoplenty.worldgen.WorldGenShield; import biomesoplenty.worldgen.WorldGenShortKelp; @@ -234,6 +235,7 @@ public class BiomeDecoratorBOP extends BiomeDecorator public WorldGenerator bluebellGen; public WorldGenerator minersDelightGen; public WorldGenerator icyIrisGen; + public WorldGenerator redwoodShrubGen; public WorldGenerator boneSpineGen; public WorldGenerator boneSpine2Gen; @@ -331,6 +333,7 @@ public class BiomeDecoratorBOP extends BiomeDecorator public int minersDelightPerChunk; public int icyIrisPerChunk; public int waterReedsPerChunk; + public int redwoodShrubsPerChunk; public int boneSpinesPerChunk; public int boneSpines2PerChunk; @@ -536,6 +539,7 @@ public class BiomeDecoratorBOP extends BiomeDecorator waterlilyGen = new WorldGenWaterlily(); algaeGen = new WorldGenAlgae(); waterReedGen = new WorldGenWaterReeds(); + redwoodShrubGen = new WorldGenRedwoodShrub(0,0); pitGen = new WorldGenPit(Blocks.ash.get().blockID); waterlilyPerChunk = 0; lilyflowersPerChunk = 0; @@ -628,6 +632,7 @@ public class BiomeDecoratorBOP extends BiomeDecorator minersDelightPerChunk = 2; icyIrisPerChunk = 0; waterReedsPerChunk = 0; + redwoodShrubsPerChunk = 0; generateLakes = true; generateAsh = false; generateMycelium = false; @@ -1545,6 +1550,14 @@ public class BiomeDecoratorBOP extends BiomeDecorator var5 = chunk_Z + randomGenerator.nextInt(16) + 8; highCattailGen.generate(currentWorld, randomGenerator, var3, var4, var5); } + + for (var2 = 0; var2 < redwoodShrubsPerChunk; ++var2) + { + var3 = chunk_X + randomGenerator.nextInt(16) + 8; + var4 = randomGenerator.nextInt(50) + 70; + var5 = chunk_Z + randomGenerator.nextInt(16) + 8; + redwoodShrubGen.generate(currentWorld, randomGenerator, var3, var4, var5); + } //Added doGen = TerrainGen.decorate(currentWorld, randomGenerator, chunk_X, chunk_Z, DEAD_BUSH); diff --git a/common/biomesoplenty/biomes/BiomeGenRedwoodForest.java b/common/biomesoplenty/biomes/BiomeGenRedwoodForest.java index 2ee15247c..7ba2a32ef 100644 --- a/common/biomesoplenty/biomes/BiomeGenRedwoodForest.java +++ b/common/biomesoplenty/biomes/BiomeGenRedwoodForest.java @@ -9,6 +9,7 @@ import net.minecraft.world.gen.feature.WorldGenShrub; import net.minecraft.world.gen.feature.WorldGenTallGrass; import net.minecraft.world.gen.feature.WorldGenerator; import biomesoplenty.configuration.configfile.BOPConfigurationMain; +import biomesoplenty.worldgen.WorldGenRedwoodShrub; import biomesoplenty.worldgen.realtree.WorldGenRealRedwood; import biomesoplenty.worldgen.realtree.WorldGenRealRedwood2; import biomesoplenty.worldgen.tree.WorldGenRedwoodTree; @@ -23,12 +24,13 @@ public class BiomeGenRedwoodForest extends BiomeGenBase super(par1); theBiomeDecorator = new BiomeDecoratorBOP(this); customBiomeDecorator = (BiomeDecoratorBOP)theBiomeDecorator; - customBiomeDecorator.treesPerChunk = 6; + customBiomeDecorator.treesPerChunk = 50; customBiomeDecorator.grassPerChunk = 16; customBiomeDecorator.bushesPerChunk = 4; customBiomeDecorator.berryBushesPerChunk = 1; customBiomeDecorator.wheatGrassPerChunk = 7; customBiomeDecorator.shrubsPerChunk = 10; + customBiomeDecorator.redwoodShrubsPerChunk = 100; customBiomeDecorator.generatePumpkins = false; } @@ -43,7 +45,7 @@ public class BiomeGenRedwoodForest extends BiomeGenBase return par1Random.nextInt(4) == 0 ? new WorldGenRealRedwood() : (par1Random.nextInt(2) == 0 ? new WorldGenShrub(0,0) : new WorldGenRealRedwood2()); } - return par1Random.nextInt(4) == 0 ? new WorldGenRedwoodTree(false) : (par1Random.nextInt(2) == 0 ? new WorldGenShrub(0,0) : new WorldGenRedwoodTree2(false)); + return par1Random.nextInt(4) == 0 ? new WorldGenRedwoodTree(false) : (par1Random.nextInt(8) == 0 ? new WorldGenShrub(0,0) : new WorldGenRedwoodTree2(false)); } @Override diff --git a/common/biomesoplenty/worldgen/WorldGenRedwoodShrub.java b/common/biomesoplenty/worldgen/WorldGenRedwoodShrub.java new file mode 100644 index 000000000..0dda152e7 --- /dev/null +++ b/common/biomesoplenty/worldgen/WorldGenRedwoodShrub.java @@ -0,0 +1,69 @@ +package biomesoplenty.worldgen; + +import java.util.Random; + +import net.minecraft.block.Block; +import net.minecraft.world.World; +import net.minecraft.world.gen.feature.WorldGenerator; +import biomesoplenty.api.Blocks; + +public class WorldGenRedwoodShrub extends WorldGenerator +{ + private int field_76527_a; + private int field_76526_b; + + public WorldGenRedwoodShrub(int par1, int par2) + { + field_76526_b = par1; + field_76527_a = par2; + } + + @Override + public boolean generate(World par1World, Random par2Random, int par3, int par4, int par5) + { + int var15; + + for (boolean var6 = false; ((var15 = par1World.getBlockId(par3, par4, par5)) == 0 || var15 == Blocks.leavesColorized.get().blockID) && par4 > 0; --par4) + { + ; + } + + int var7 = par1World.getBlockId(par3, par4, par5); + int var77 = par1World.getBlockMetadata(par3, par4, par5); + + if (var7 == Blocks.logs3.get().blockID) + { + if (var77 == 0) + { + if (par1World.isAirBlock(par3 - 1, par4, par5) || par1World.isAirBlock(par3 + 1, par4, par5) || par1World.isAirBlock(par3, par4, par5 - 1) || par1World.isAirBlock(par3, par4, par5 + 1)) + { + ++par4; + this.setBlockAndMetadata(par1World, par3, par4, par5, Blocks.logs3.get().blockID,0); + + for (int var8 = par4; var8 <= par4 + 1; ++var8) + { + int var9 = var8 - par4; + int var10 = 2 - var9; + + for (int var11 = par3 - var10; var11 <= par3 + var10; ++var11) + { + int var12 = var11 - par3; + + for (int var13 = par5 - var10; var13 <= par5 + var10; ++var13) + { + int var14 = var13 - par5; + + if ((Math.abs(var12) != var10 || Math.abs(var14) != var10 || par2Random.nextInt(2) != 0) && !Block.opaqueCubeLookup[par1World.getBlockId(var11, var8, var13)]) + { + this.setBlockAndMetadata(par1World, var11, var8, var13, Blocks.leavesColorized.get().blockID, 3); + } + } + } + } + } + } + } + + return true; + } +} diff --git a/common/biomesoplenty/worldgen/tree/WorldGenRedwoodTree.java b/common/biomesoplenty/worldgen/tree/WorldGenRedwoodTree.java index 03704e864..8a5ce70bf 100644 --- a/common/biomesoplenty/worldgen/tree/WorldGenRedwoodTree.java +++ b/common/biomesoplenty/worldgen/tree/WorldGenRedwoodTree.java @@ -24,7 +24,7 @@ public class WorldGenRedwoodTree extends WorldGenerator public WorldGenRedwoodTree(boolean par1) { - this(par1, 30, 0, 0, false); + this(par1, 40, 0, 0, false); } public WorldGenRedwoodTree(boolean par1, int par2, int par3, int par4, boolean par5) @@ -62,16 +62,16 @@ public class WorldGenRedwoodTree extends WorldGenerator for (var8 = par4; var8 <= par4 + 1 + var6; ++var8) { - var9 = 1; + var9 = 7; if (var8 == par4) { - var9 = 0; + var9 = 7; } if (var8 >= par4 + 1 + var6 - 2) { - var9 = 2; + var9 = 8; } for (int var10 = par3 - var9; var10 <= par3 + var9 && var7; ++var10) diff --git a/common/biomesoplenty/worldgen/tree/WorldGenRedwoodTree2.java b/common/biomesoplenty/worldgen/tree/WorldGenRedwoodTree2.java index e8694c199..faf3f78c2 100644 --- a/common/biomesoplenty/worldgen/tree/WorldGenRedwoodTree2.java +++ b/common/biomesoplenty/worldgen/tree/WorldGenRedwoodTree2.java @@ -39,7 +39,7 @@ public class WorldGenRedwoodTree2 extends WorldGenerator @Override public boolean generate(World par1World, Random par2Random, int par3, int par4, int par5) { - int var6 = par2Random.nextInt(10) + minTreeHeight; + int var6 = par2Random.nextInt(15) + minTreeHeight; boolean var7 = true; if (par4 >= 1 && par4 + var6 + 1 <= 256) @@ -58,16 +58,16 @@ public class WorldGenRedwoodTree2 extends WorldGenerator for (var8 = par4; var8 <= par4 + 1 + var6; ++var8) { - var9 = 1; + var9 = 5; if (var8 == par4) { - var9 = 0; + var9 = 5; } if (var8 >= par4 + 1 + var6 - 2) { - var9 = 2; + var9 = 6; } for (int var10 = par3 - var9; var10 <= par3 + var9 && var7; ++var10) From c1fdf456c163ff60831a7ad6cc117b0abce7d487 Mon Sep 17 00:00:00 2001 From: Matt Caughey Date: Fri, 27 Sep 2013 16:31:57 -0400 Subject: [PATCH 03/15] Redwood Forest tweaks --- common/biomesoplenty/biomes/BiomeGenRedwoodForest.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/common/biomesoplenty/biomes/BiomeGenRedwoodForest.java b/common/biomesoplenty/biomes/BiomeGenRedwoodForest.java index 7ba2a32ef..17615511d 100644 --- a/common/biomesoplenty/biomes/BiomeGenRedwoodForest.java +++ b/common/biomesoplenty/biomes/BiomeGenRedwoodForest.java @@ -24,7 +24,7 @@ public class BiomeGenRedwoodForest extends BiomeGenBase super(par1); theBiomeDecorator = new BiomeDecoratorBOP(this); customBiomeDecorator = (BiomeDecoratorBOP)theBiomeDecorator; - customBiomeDecorator.treesPerChunk = 50; + customBiomeDecorator.treesPerChunk = 75; customBiomeDecorator.grassPerChunk = 16; customBiomeDecorator.bushesPerChunk = 4; customBiomeDecorator.berryBushesPerChunk = 1; From 435a20c2b3d8315f5465556d325a719b6d892c55 Mon Sep 17 00:00:00 2001 From: Matt Caughey Date: Fri, 27 Sep 2013 16:58:55 -0400 Subject: [PATCH 04/15] Added reeds to more biomes --- common/biomesoplenty/biomes/BiomeGenAutumnHills.java | 1 + common/biomesoplenty/biomes/BiomeGenBorealForest.java | 2 +- common/biomesoplenty/biomes/BiomeGenBrushland.java | 1 + common/biomesoplenty/biomes/BiomeGenCanyon.java | 1 + common/biomesoplenty/biomes/BiomeGenCanyonRavine.java | 1 + common/biomesoplenty/biomes/BiomeGenChaparral.java | 1 + common/biomesoplenty/biomes/BiomeGenConiferousForest.java | 1 + common/biomesoplenty/biomes/BiomeGenField.java | 1 + common/biomesoplenty/biomes/BiomeGenFieldForest.java | 1 + common/biomesoplenty/biomes/BiomeGenGarden.java | 1 + common/biomesoplenty/biomes/BiomeGenGrassland.java | 1 + common/biomesoplenty/biomes/BiomeGenLushDesert.java | 1 + common/biomesoplenty/biomes/BiomeGenMesa.java | 1 + common/biomesoplenty/biomes/BiomeGenMountain.java | 1 + common/biomesoplenty/biomes/BiomeGenOrchard.java | 1 + common/biomesoplenty/biomes/BiomeGenOvergrownGreens.java | 1 + common/biomesoplenty/biomes/BiomeGenPrairie.java | 1 + common/biomesoplenty/biomes/BiomeGenRedwoodForest.java | 1 + common/biomesoplenty/biomes/BiomeGenSavanna.java | 1 + common/biomesoplenty/biomes/BiomeGenScrubland.java | 1 + common/biomesoplenty/biomes/BiomeGenSeasonalForest.java | 1 + common/biomesoplenty/biomes/BiomeGenSeasonalSpruceForest.java | 1 + common/biomesoplenty/biomes/BiomeGenSpruceWoods.java | 1 + common/biomesoplenty/biomes/BiomeGenTemperateRainforest.java | 1 + common/biomesoplenty/biomes/BiomeGenTimber.java | 2 +- common/biomesoplenty/biomes/BiomeGenTimberThin.java | 1 + common/biomesoplenty/biomes/BiomeGenTundra.java | 1 + common/biomesoplenty/biomes/BiomeGenWoodland.java | 1 + common/biomesoplenty/biomes/vanilla/BiomeGenForestNew.java | 1 + common/biomesoplenty/biomes/vanilla/BiomeGenPlainsNew.java | 1 + 30 files changed, 30 insertions(+), 2 deletions(-) diff --git a/common/biomesoplenty/biomes/BiomeGenAutumnHills.java b/common/biomesoplenty/biomes/BiomeGenAutumnHills.java index f478846f8..7ba031ff8 100644 --- a/common/biomesoplenty/biomes/BiomeGenAutumnHills.java +++ b/common/biomesoplenty/biomes/BiomeGenAutumnHills.java @@ -32,6 +32,7 @@ public class BiomeGenAutumnHills extends BiomeGenBase customBiomeDecorator.sproutsPerChunk = 2; customBiomeDecorator.wheatGrassPerChunk = 16; customBiomeDecorator.shrubsPerChunk = 20; + customBiomeDecorator.waterReedsPerChunk = 2; } /** diff --git a/common/biomesoplenty/biomes/BiomeGenBorealForest.java b/common/biomesoplenty/biomes/BiomeGenBorealForest.java index ea55b6a40..e8f17db98 100644 --- a/common/biomesoplenty/biomes/BiomeGenBorealForest.java +++ b/common/biomesoplenty/biomes/BiomeGenBorealForest.java @@ -29,7 +29,7 @@ public class BiomeGenBorealForest extends BiomeGenBase customBiomeDecorator.grassPerChunk = 50; customBiomeDecorator.wheatGrassPerChunk = 25; customBiomeDecorator.shrubsPerChunk = 10; - customBiomeDecorator.waterReedsPerChunk = 2; + customBiomeDecorator.waterReedsPerChunk = 4; } /** diff --git a/common/biomesoplenty/biomes/BiomeGenBrushland.java b/common/biomesoplenty/biomes/BiomeGenBrushland.java index 14dc82241..c1dcc6630 100644 --- a/common/biomesoplenty/biomes/BiomeGenBrushland.java +++ b/common/biomesoplenty/biomes/BiomeGenBrushland.java @@ -23,6 +23,7 @@ public class BiomeGenBrushland extends BiomeGenBase customBiomeDecorator.flowersPerChunk = -999; customBiomeDecorator.wheatGrassPerChunk = 3; customBiomeDecorator.shrubsPerChunk = 30; + customBiomeDecorator.waterReedsPerChunk = 2; customBiomeDecorator.generateQuicksand = true; } diff --git a/common/biomesoplenty/biomes/BiomeGenCanyon.java b/common/biomesoplenty/biomes/BiomeGenCanyon.java index b31e9cc46..7b394abd0 100644 --- a/common/biomesoplenty/biomes/BiomeGenCanyon.java +++ b/common/biomesoplenty/biomes/BiomeGenCanyon.java @@ -26,6 +26,7 @@ public class BiomeGenCanyon extends BiomeGenBase customBiomeDecorator.flowersPerChunk = -999; customBiomeDecorator.canyonGrassPerChunk = 5; customBiomeDecorator.aloePerChunk = 2; + customBiomeDecorator.waterReedsPerChunk = 2; customBiomeDecorator.generatePumpkins = false; customBiomeDecorator.generateCanyon = true; } diff --git a/common/biomesoplenty/biomes/BiomeGenCanyonRavine.java b/common/biomesoplenty/biomes/BiomeGenCanyonRavine.java index a75504eb3..8aed8bd95 100644 --- a/common/biomesoplenty/biomes/BiomeGenCanyonRavine.java +++ b/common/biomesoplenty/biomes/BiomeGenCanyonRavine.java @@ -26,6 +26,7 @@ public class BiomeGenCanyonRavine extends BiomeGenBase customBiomeDecorator.flowersPerChunk = -999; customBiomeDecorator.canyonGrassPerChunk = 3; customBiomeDecorator.aloePerChunk = 2; + customBiomeDecorator.waterReedsPerChunk = 4; customBiomeDecorator.generatePumpkins = false; customBiomeDecorator.generateCanyon = true; } diff --git a/common/biomesoplenty/biomes/BiomeGenChaparral.java b/common/biomesoplenty/biomes/BiomeGenChaparral.java index e18c5c838..690a9d6fc 100644 --- a/common/biomesoplenty/biomes/BiomeGenChaparral.java +++ b/common/biomesoplenty/biomes/BiomeGenChaparral.java @@ -33,6 +33,7 @@ public class BiomeGenChaparral extends BiomeGenBase customBiomeDecorator.carrotsPerChunk = 1; customBiomeDecorator.wheatGrassPerChunk = 10; customBiomeDecorator.shrubsPerChunk = 10; + customBiomeDecorator.waterReedsPerChunk = 2; spawnableCreatureList.add(new SpawnListEntry(EntityHorse.class, 5, 2, 6)); } diff --git a/common/biomesoplenty/biomes/BiomeGenConiferousForest.java b/common/biomesoplenty/biomes/BiomeGenConiferousForest.java index 7579ae614..c5d8dde12 100644 --- a/common/biomesoplenty/biomes/BiomeGenConiferousForest.java +++ b/common/biomesoplenty/biomes/BiomeGenConiferousForest.java @@ -38,6 +38,7 @@ public class BiomeGenConiferousForest extends BiomeGenBase customBiomeDecorator.berryBushesPerChunk = 1; customBiomeDecorator.wheatGrassPerChunk = 5; customBiomeDecorator.shrubsPerChunk = 8; + customBiomeDecorator.waterReedsPerChunk = 2; } /** diff --git a/common/biomesoplenty/biomes/BiomeGenField.java b/common/biomesoplenty/biomes/BiomeGenField.java index 097e42440..5e6bf8c26 100644 --- a/common/biomesoplenty/biomes/BiomeGenField.java +++ b/common/biomesoplenty/biomes/BiomeGenField.java @@ -25,6 +25,7 @@ public class BiomeGenField extends BiomeGenBase customBiomeDecorator.bushesPerChunk = 8; customBiomeDecorator.berryBushesPerChunk = 5; customBiomeDecorator.wheatGrassPerChunk = 4; + customBiomeDecorator.waterReedsPerChunk = 4; customBiomeDecorator.generatePumpkins = true; spawnableCreatureList.add(new SpawnListEntry(EntityHorse.class, 5, 2, 6)); } diff --git a/common/biomesoplenty/biomes/BiomeGenFieldForest.java b/common/biomesoplenty/biomes/BiomeGenFieldForest.java index 3cbfca223..a507153fb 100644 --- a/common/biomesoplenty/biomes/BiomeGenFieldForest.java +++ b/common/biomesoplenty/biomes/BiomeGenFieldForest.java @@ -28,6 +28,7 @@ public class BiomeGenFieldForest extends BiomeGenBase customBiomeDecorator.berryBushesPerChunk = 5; customBiomeDecorator.wheatGrassPerChunk = 4; customBiomeDecorator.shrubsPerChunk = 2; + customBiomeDecorator.waterReedsPerChunk = 4; customBiomeDecorator.generatePumpkins = true; spawnableCreatureList.add(new SpawnListEntry(EntityHorse.class, 5, 2, 6)); } diff --git a/common/biomesoplenty/biomes/BiomeGenGarden.java b/common/biomesoplenty/biomes/BiomeGenGarden.java index fbb01cd16..27aaf02ba 100644 --- a/common/biomesoplenty/biomes/BiomeGenGarden.java +++ b/common/biomesoplenty/biomes/BiomeGenGarden.java @@ -40,6 +40,7 @@ public class BiomeGenGarden extends BiomeGenBase customBiomeDecorator.lilyflowersPerChunk = 4; customBiomeDecorator.wheatGrassPerChunk = 10; customBiomeDecorator.shrubsPerChunk = 10; + customBiomeDecorator.waterReedsPerChunk = 4; customBiomeDecorator.generatePumpkins = true; customBiomeDecorator.generateMelons = true; spawnableCreatureList.clear(); diff --git a/common/biomesoplenty/biomes/BiomeGenGrassland.java b/common/biomesoplenty/biomes/BiomeGenGrassland.java index bd549cc47..9bc225014 100644 --- a/common/biomesoplenty/biomes/BiomeGenGrassland.java +++ b/common/biomesoplenty/biomes/BiomeGenGrassland.java @@ -34,6 +34,7 @@ public class BiomeGenGrassland extends BiomeGenBase customBiomeDecorator.waterLakesPerChunk = 15; customBiomeDecorator.portobellosPerChunk = 3; customBiomeDecorator.reedsBOPPerChunk = 5; + customBiomeDecorator.waterReedsPerChunk = 2; customBiomeDecorator.generatePumpkins = false; spawnableCreatureList.add(new SpawnListEntry(EntitySheep.class, 14, 4, 4)); spawnableCreatureList.add(new SpawnListEntry(EntityPig.class, 12, 4, 4)); diff --git a/common/biomesoplenty/biomes/BiomeGenLushDesert.java b/common/biomesoplenty/biomes/BiomeGenLushDesert.java index 80844cf24..eb6b19579 100644 --- a/common/biomesoplenty/biomes/BiomeGenLushDesert.java +++ b/common/biomesoplenty/biomes/BiomeGenLushDesert.java @@ -36,6 +36,7 @@ public class BiomeGenLushDesert extends BiomeGenBase customBiomeDecorator.cactiPerChunk = 20; customBiomeDecorator.tinyCactiPerChunk = 5; customBiomeDecorator.waterLakesPerChunk = 5; + customBiomeDecorator.waterReedsPerChunk = 4; customBiomeDecorator.aloePerChunk = 3; customBiomeDecorator.generateGrass = true; customBiomeDecorator.generateSand = true; diff --git a/common/biomesoplenty/biomes/BiomeGenMesa.java b/common/biomesoplenty/biomes/BiomeGenMesa.java index 3aab166ed..fcff96121 100644 --- a/common/biomesoplenty/biomes/BiomeGenMesa.java +++ b/common/biomesoplenty/biomes/BiomeGenMesa.java @@ -28,6 +28,7 @@ public class BiomeGenMesa extends BiomeGenBase customBiomeDecorator.deadBushPerChunk = 2; customBiomeDecorator.desertGrassPerChunk = 10; customBiomeDecorator.tinyCactiPerChunk = 2; + customBiomeDecorator.waterReedsPerChunk = 2; spawnableMonsterList.add(new SpawnListEntry(EntitySpider.class, 15, 2, 6)); } diff --git a/common/biomesoplenty/biomes/BiomeGenMountain.java b/common/biomesoplenty/biomes/BiomeGenMountain.java index 8f6fbf90e..904292e95 100644 --- a/common/biomesoplenty/biomes/BiomeGenMountain.java +++ b/common/biomesoplenty/biomes/BiomeGenMountain.java @@ -25,6 +25,7 @@ public class BiomeGenMountain extends BiomeGenBase customBiomeDecorator.wheatGrassPerChunk = 1; customBiomeDecorator.berryBushesPerChunk = 3; customBiomeDecorator.shrubsPerChunk = 10; + customBiomeDecorator.waterReedsPerChunk = 4; } /** diff --git a/common/biomesoplenty/biomes/BiomeGenOrchard.java b/common/biomesoplenty/biomes/BiomeGenOrchard.java index 1f1744982..7d5b0d1fb 100644 --- a/common/biomesoplenty/biomes/BiomeGenOrchard.java +++ b/common/biomesoplenty/biomes/BiomeGenOrchard.java @@ -32,6 +32,7 @@ public class BiomeGenOrchard extends BiomeGenBase customBiomeDecorator.berryBushesPerChunk = 3; customBiomeDecorator.carrotsPerChunk = 1; customBiomeDecorator.shrubsPerChunk = 10; + customBiomeDecorator.waterReedsPerChunk = 4; spawnableCreatureList.add(new SpawnListEntry(EntityHorse.class, 5, 2, 6)); } diff --git a/common/biomesoplenty/biomes/BiomeGenOvergrownGreens.java b/common/biomesoplenty/biomes/BiomeGenOvergrownGreens.java index ff0ef06dd..2e11d6d7a 100644 --- a/common/biomesoplenty/biomes/BiomeGenOvergrownGreens.java +++ b/common/biomesoplenty/biomes/BiomeGenOvergrownGreens.java @@ -27,6 +27,7 @@ public class BiomeGenOvergrownGreens extends BiomeGenBase customBiomeDecorator.wheatGrassPerChunk = 10; customBiomeDecorator.highGrassPerChunk = 15; customBiomeDecorator.shrubsPerChunk = 5; + customBiomeDecorator.waterReedsPerChunk = 4; } @Override diff --git a/common/biomesoplenty/biomes/BiomeGenPrairie.java b/common/biomesoplenty/biomes/BiomeGenPrairie.java index 66f8cdec5..dd82148c6 100644 --- a/common/biomesoplenty/biomes/BiomeGenPrairie.java +++ b/common/biomesoplenty/biomes/BiomeGenPrairie.java @@ -30,6 +30,7 @@ public class BiomeGenPrairie extends BiomeGenBase customBiomeDecorator.wheatGrassPerChunk = 25; customBiomeDecorator.carrotsPerChunk = 1; customBiomeDecorator.shrubsPerChunk = 3; + customBiomeDecorator.waterReedsPerChunk = 4; spawnableCreatureList.add(new SpawnListEntry(EntityHorse.class, 5, 2, 6)); } diff --git a/common/biomesoplenty/biomes/BiomeGenRedwoodForest.java b/common/biomesoplenty/biomes/BiomeGenRedwoodForest.java index 17615511d..e388dfdd8 100644 --- a/common/biomesoplenty/biomes/BiomeGenRedwoodForest.java +++ b/common/biomesoplenty/biomes/BiomeGenRedwoodForest.java @@ -31,6 +31,7 @@ public class BiomeGenRedwoodForest extends BiomeGenBase customBiomeDecorator.wheatGrassPerChunk = 7; customBiomeDecorator.shrubsPerChunk = 10; customBiomeDecorator.redwoodShrubsPerChunk = 100; + customBiomeDecorator.waterReedsPerChunk = 2; customBiomeDecorator.generatePumpkins = false; } diff --git a/common/biomesoplenty/biomes/BiomeGenSavanna.java b/common/biomesoplenty/biomes/BiomeGenSavanna.java index 37e228312..f34b8f681 100644 --- a/common/biomesoplenty/biomes/BiomeGenSavanna.java +++ b/common/biomesoplenty/biomes/BiomeGenSavanna.java @@ -28,6 +28,7 @@ public class BiomeGenSavanna extends BiomeGenBase customBiomeDecorator.wheatGrassPerChunk = 10; customBiomeDecorator.bushesPerChunk = 10; customBiomeDecorator.shrubsPerChunk = 3; + customBiomeDecorator.waterReedsPerChunk = 2; customBiomeDecorator.generatePumpkins = false; } diff --git a/common/biomesoplenty/biomes/BiomeGenScrubland.java b/common/biomesoplenty/biomes/BiomeGenScrubland.java index acb7decf7..3017096a4 100644 --- a/common/biomesoplenty/biomes/BiomeGenScrubland.java +++ b/common/biomesoplenty/biomes/BiomeGenScrubland.java @@ -26,6 +26,7 @@ public class BiomeGenScrubland extends BiomeGenBase customBiomeDecorator.grassPerChunk = 30; customBiomeDecorator.wheatGrassPerChunk = 10; customBiomeDecorator.shrubsPerChunk = 2; + customBiomeDecorator.waterReedsPerChunk = 2; customBiomeDecorator.generatePumpkins = false; } diff --git a/common/biomesoplenty/biomes/BiomeGenSeasonalForest.java b/common/biomesoplenty/biomes/BiomeGenSeasonalForest.java index c0fe19f56..c202b38a6 100644 --- a/common/biomesoplenty/biomes/BiomeGenSeasonalForest.java +++ b/common/biomesoplenty/biomes/BiomeGenSeasonalForest.java @@ -34,6 +34,7 @@ public class BiomeGenSeasonalForest extends BiomeGenBase customBiomeDecorator.toadstoolsPerChunk = 4; customBiomeDecorator.wheatGrassPerChunk = 4; customBiomeDecorator.shrubsPerChunk = 15; + customBiomeDecorator.waterReedsPerChunk = 4; } /** diff --git a/common/biomesoplenty/biomes/BiomeGenSeasonalSpruceForest.java b/common/biomesoplenty/biomes/BiomeGenSeasonalSpruceForest.java index a97b94fcb..28e8d4410 100644 --- a/common/biomesoplenty/biomes/BiomeGenSeasonalSpruceForest.java +++ b/common/biomesoplenty/biomes/BiomeGenSeasonalSpruceForest.java @@ -34,6 +34,7 @@ public class BiomeGenSeasonalSpruceForest extends BiomeGenBase customBiomeDecorator.toadstoolsPerChunk = 4; customBiomeDecorator.wheatGrassPerChunk = 4; customBiomeDecorator.shrubsPerChunk = 15; + customBiomeDecorator.waterReedsPerChunk = 2; } /** diff --git a/common/biomesoplenty/biomes/BiomeGenSpruceWoods.java b/common/biomesoplenty/biomes/BiomeGenSpruceWoods.java index 25a4b8b06..28b9675db 100644 --- a/common/biomesoplenty/biomes/BiomeGenSpruceWoods.java +++ b/common/biomesoplenty/biomes/BiomeGenSpruceWoods.java @@ -32,6 +32,7 @@ public class BiomeGenSpruceWoods extends BiomeGenBase customBiomeDecorator.carrotsPerChunk = 1; customBiomeDecorator.bluebellsPerChunk = 100; customBiomeDecorator.shrubsPerChunk = 5; + customBiomeDecorator.waterReedsPerChunk = 2; } /** diff --git a/common/biomesoplenty/biomes/BiomeGenTemperateRainforest.java b/common/biomesoplenty/biomes/BiomeGenTemperateRainforest.java index d5c31ccac..0991c4250 100644 --- a/common/biomesoplenty/biomes/BiomeGenTemperateRainforest.java +++ b/common/biomesoplenty/biomes/BiomeGenTemperateRainforest.java @@ -36,6 +36,7 @@ public class BiomeGenTemperateRainforest extends BiomeGenBase customBiomeDecorator.sandPerChunk = -999; customBiomeDecorator.sandPerChunk2 = -999; customBiomeDecorator.shrubsPerChunk = 10; + customBiomeDecorator.waterReedsPerChunk = 2; } /** diff --git a/common/biomesoplenty/biomes/BiomeGenTimber.java b/common/biomesoplenty/biomes/BiomeGenTimber.java index 1c3dce9f7..2cb41094d 100644 --- a/common/biomesoplenty/biomes/BiomeGenTimber.java +++ b/common/biomesoplenty/biomes/BiomeGenTimber.java @@ -27,7 +27,7 @@ public class BiomeGenTimber extends BiomeGenBase customBiomeDecorator.thornsPerChunk = 2; customBiomeDecorator.flowersPerChunk = -999; customBiomeDecorator.toadstoolsPerChunk = 2; - customBiomeDecorator.waterReedsPerChunk = 2; + customBiomeDecorator.waterReedsPerChunk = 4; customBiomeDecorator.shrubsPerChunk = 10; } diff --git a/common/biomesoplenty/biomes/BiomeGenTimberThin.java b/common/biomesoplenty/biomes/BiomeGenTimberThin.java index 65e20ae77..f8a84c65d 100644 --- a/common/biomesoplenty/biomes/BiomeGenTimberThin.java +++ b/common/biomesoplenty/biomes/BiomeGenTimberThin.java @@ -28,6 +28,7 @@ public class BiomeGenTimberThin extends BiomeGenBase customBiomeDecorator.flowersPerChunk = -999; customBiomeDecorator.toadstoolsPerChunk = 2; customBiomeDecorator.shrubsPerChunk = 5; + customBiomeDecorator.waterReedsPerChunk = 2; } /** diff --git a/common/biomesoplenty/biomes/BiomeGenTundra.java b/common/biomesoplenty/biomes/BiomeGenTundra.java index 1632e231e..da93b9462 100644 --- a/common/biomesoplenty/biomes/BiomeGenTundra.java +++ b/common/biomesoplenty/biomes/BiomeGenTundra.java @@ -29,6 +29,7 @@ public class BiomeGenTundra extends BiomeGenBase customBiomeDecorator.gravelPerChunk = 8; customBiomeDecorator.gravelPerChunk2 = 8; customBiomeDecorator.shrubsPerChunk = 2; + customBiomeDecorator.waterReedsPerChunk = 2; } @Override diff --git a/common/biomesoplenty/biomes/BiomeGenWoodland.java b/common/biomesoplenty/biomes/BiomeGenWoodland.java index 386d56890..ef8ef7903 100644 --- a/common/biomesoplenty/biomes/BiomeGenWoodland.java +++ b/common/biomesoplenty/biomes/BiomeGenWoodland.java @@ -23,6 +23,7 @@ public class BiomeGenWoodland extends BiomeGenBase customBiomeDecorator.wheatGrassPerChunk = 3; customBiomeDecorator.toadstoolsPerChunk = 3; customBiomeDecorator.shrubsPerChunk = 20; + customBiomeDecorator.waterReedsPerChunk = 2; } @Override diff --git a/common/biomesoplenty/biomes/vanilla/BiomeGenForestNew.java b/common/biomesoplenty/biomes/vanilla/BiomeGenForestNew.java index 26602acf1..eebf1ce57 100644 --- a/common/biomesoplenty/biomes/vanilla/BiomeGenForestNew.java +++ b/common/biomesoplenty/biomes/vanilla/BiomeGenForestNew.java @@ -33,6 +33,7 @@ public class BiomeGenForestNew extends BiomeGenBase customBiomeDecorator.carrotsPerChunk = 1; customBiomeDecorator.wheatGrassPerChunk = 1; customBiomeDecorator.shrubsPerChunk = 10; + customBiomeDecorator.waterReedsPerChunk = 2; } /** diff --git a/common/biomesoplenty/biomes/vanilla/BiomeGenPlainsNew.java b/common/biomesoplenty/biomes/vanilla/BiomeGenPlainsNew.java index 6497f2922..99166e452 100644 --- a/common/biomesoplenty/biomes/vanilla/BiomeGenPlainsNew.java +++ b/common/biomesoplenty/biomes/vanilla/BiomeGenPlainsNew.java @@ -28,6 +28,7 @@ public class BiomeGenPlainsNew extends BiomeGenBase customBiomeDecorator.tinyFlowersPerChunk = 1; customBiomeDecorator.portobellosPerChunk = 1; customBiomeDecorator.sunflowersPerChunk = 2; + customBiomeDecorator.waterReedsPerChunk = 2; spawnableCreatureList.add(new SpawnListEntry(EntityHorse.class, 5, 2, 6)); } From 0050fcff481c69f79182cdda1bfc3cccd4ccdb9c Mon Sep 17 00:00:00 2001 From: Matt Caughey Date: Fri, 27 Sep 2013 17:27:39 -0400 Subject: [PATCH 05/15] Tweaked reed gen again. Removed sand bordering water in the Coniferous Forest. --- .../biomes/BiomeGenConiferousForest.java | 4 ++++ .../biomes/BiomeGenConiferousForestSnow.java | 6 ++++-- .../biomesoplenty/worldgen/WorldGenWaterReeds.java | 13 +++---------- 3 files changed, 11 insertions(+), 12 deletions(-) diff --git a/common/biomesoplenty/biomes/BiomeGenConiferousForest.java b/common/biomesoplenty/biomes/BiomeGenConiferousForest.java index c5d8dde12..676cabe90 100644 --- a/common/biomesoplenty/biomes/BiomeGenConiferousForest.java +++ b/common/biomesoplenty/biomes/BiomeGenConiferousForest.java @@ -39,6 +39,10 @@ public class BiomeGenConiferousForest extends BiomeGenBase customBiomeDecorator.wheatGrassPerChunk = 5; customBiomeDecorator.shrubsPerChunk = 8; customBiomeDecorator.waterReedsPerChunk = 2; + customBiomeDecorator.sandPerChunk = -999; + customBiomeDecorator.sandPerChunk2 = -999; + customBiomeDecorator.gravelPerChunk = 1; + customBiomeDecorator.gravelPerChunk2 = 1; } /** diff --git a/common/biomesoplenty/biomes/BiomeGenConiferousForestSnow.java b/common/biomesoplenty/biomes/BiomeGenConiferousForestSnow.java index 2b1a7a16c..d84a1b088 100644 --- a/common/biomesoplenty/biomes/BiomeGenConiferousForestSnow.java +++ b/common/biomesoplenty/biomes/BiomeGenConiferousForestSnow.java @@ -25,10 +25,12 @@ public class BiomeGenConiferousForestSnow extends BiomeGenBase customBiomeDecorator.treesPerChunk = 2; customBiomeDecorator.mushroomsPerChunk = 4; customBiomeDecorator.flowersPerChunk = -999; - customBiomeDecorator.sandPerChunk = -999; - customBiomeDecorator.sandPerChunk2 = -999; customBiomeDecorator.shrubsPerChunk = 4; customBiomeDecorator.wheatGrassPerChunk = 1; + customBiomeDecorator.sandPerChunk = -999; + customBiomeDecorator.sandPerChunk2 = -999; + customBiomeDecorator.gravelPerChunk = 1; + customBiomeDecorator.gravelPerChunk2 = 1; } @Override diff --git a/common/biomesoplenty/worldgen/WorldGenWaterReeds.java b/common/biomesoplenty/worldgen/WorldGenWaterReeds.java index 388eee07a..bfafb71f0 100644 --- a/common/biomesoplenty/worldgen/WorldGenWaterReeds.java +++ b/common/biomesoplenty/worldgen/WorldGenWaterReeds.java @@ -15,11 +15,10 @@ public class WorldGenWaterReeds extends WorldGenerator for (int var6 = 0; var6 < 64; ++var6) { int var7 = par3 + par2Random.nextInt(8) - par2Random.nextInt(8); - int var8 = par4 + par2Random.nextInt(4) - par2Random.nextInt(4); + int var8 = par4 + par2Random.nextInt(2) - par2Random.nextInt(2); int var9 = par5 + par2Random.nextInt(8) - par2Random.nextInt(8); - int var998 = par2Random.nextInt(64); - int var999 = par2Random.nextInt(32); + int var999 = par2Random.nextInt(64); if (par1World.isAirBlock(var7, var8, var9) && par1World.getBlockId(var7, var8 - 1, var9) == Block.waterStill.blockID) { @@ -38,13 +37,7 @@ public class WorldGenWaterReeds extends WorldGenerator } else { - if (par1World.getBlockId(var7, var8 - 4, var9) != Block.waterStill.blockID) - { - if (var998 == 0) - { - par1World.setBlock(var7, var8, var9, Blocks.plants.get().blockID, 14, 2); - } - } + return false; } } } From 56e4a7deca9a66a98e478db53b4bb01babd56233 Mon Sep 17 00:00:00 2001 From: Matt Caughey Date: Fri, 27 Sep 2013 21:42:34 -0400 Subject: [PATCH 06/15] Made reeds generate based on the distance to land rather than the depth of the water --- .../worldgen/WorldGenWaterReeds.java | 19 +++---------------- 1 file changed, 3 insertions(+), 16 deletions(-) diff --git a/common/biomesoplenty/worldgen/WorldGenWaterReeds.java b/common/biomesoplenty/worldgen/WorldGenWaterReeds.java index bfafb71f0..01bcf6087 100644 --- a/common/biomesoplenty/worldgen/WorldGenWaterReeds.java +++ b/common/biomesoplenty/worldgen/WorldGenWaterReeds.java @@ -17,27 +17,14 @@ public class WorldGenWaterReeds extends WorldGenerator int var7 = par3 + par2Random.nextInt(8) - par2Random.nextInt(8); int var8 = par4 + par2Random.nextInt(2) - par2Random.nextInt(2); int var9 = par5 + par2Random.nextInt(8) - par2Random.nextInt(8); - - int var999 = par2Random.nextInt(64); if (par1World.isAirBlock(var7, var8, var9) && par1World.getBlockId(var7, var8 - 1, var9) == Block.waterStill.blockID) { - if (par1World.getBlockId(var7, var8 - 2, var9) != Block.waterStill.blockID) + for (int var900 = 5; var900 > -5; --var900) { - par1World.setBlock(var7, var8, var9, Blocks.plants.get().blockID, 14, 2); - } - else - { - if (par1World.getBlockId(var7, var8 - 3, var9) != Block.waterStill.blockID) + if (par1World.getBlockId(var7 - var900, var8 - 1, var9 - var900) != Block.waterStill.blockID && par1World.getBlockId(var7 - var900, var8 - 1, var9 - var900) != Block.waterMoving.blockID) { - if (var999 == 0) - { - par1World.setBlock(var7, var8, var9, Blocks.plants.get().blockID, 14, 2); - } - } - else - { - return false; + par1World.setBlock(var7, var8, var9, Blocks.plants.get().blockID, 14, 2); } } } From 518f0528d01921283732b7d75a3dac489c736e84 Mon Sep 17 00:00:00 2001 From: Matt Caughey Date: Fri, 27 Sep 2013 23:37:16 -0400 Subject: [PATCH 07/15] Tweaked the Wasteland a bit and changed max/min height of the Marsh --- common/biomesoplenty/biomes/BiomeGenWasteland.java | 2 +- common/biomesoplenty/configuration/BOPBiomes.java | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/common/biomesoplenty/biomes/BiomeGenWasteland.java b/common/biomesoplenty/biomes/BiomeGenWasteland.java index db1da8051..f909faad3 100644 --- a/common/biomesoplenty/biomes/BiomeGenWasteland.java +++ b/common/biomesoplenty/biomes/BiomeGenWasteland.java @@ -36,7 +36,7 @@ public class BiomeGenWasteland extends BiomeGenBase @Override public WorldGenerator getRandomWorldGenForTrees(Random par1Random) { - return par1Random.nextInt(4) == 0 ? new WorldGenDeadTree3(false) : (par1Random.nextInt(2) == 0 ? new WorldGenWasteland2() : new WorldGenWasteland()); + return par1Random.nextInt(4) == 0 ? new WorldGenWasteland() : (par1Random.nextInt(4) == 0 ? new WorldGenWasteland2() : new WorldGenDeadTree3(false)); } /** diff --git a/common/biomesoplenty/configuration/BOPBiomes.java b/common/biomesoplenty/configuration/BOPBiomes.java index df12ab4d9..5775c4f55 100644 --- a/common/biomesoplenty/configuration/BOPBiomes.java +++ b/common/biomesoplenty/configuration/BOPBiomes.java @@ -226,7 +226,7 @@ public class BOPBiomes { Biomes.lushSwamp = Optional.of((new BiomeGenLushSwamp(BOPConfigurationIDs.lushSwampID)).setColor(522674).setBiomeName("Lush Swamp").func_76733_a(9154376).setMinMaxHeight(0.2F, 0.3F).setTemperatureRainfall(0.7F, 1.0F)); Biomes.mangrove = Optional.of((new BiomeGenMangrove(BOPConfigurationIDs.mangroveID)).setColor(16440917).setBiomeName("Mangrove").setMinMaxHeight(0.1F, 0.3F).setTemperatureRainfall(0.8F, 0.9F)); Biomes.mapleWoods = Optional.of((new BiomeGenMapleWoods(BOPConfigurationIDs.mapleWoodsID)).setColor(747097).setBiomeName("Maple Woods").func_76733_a(5159473).setTemperatureRainfall(0.2F, 0.8F).setMinMaxHeight(0.3F, 0.6F)); - Biomes.marsh = Optional.of((new BiomeGenMarsh(BOPConfigurationIDs.marshID)).setColor(10486015).setBiomeName("Marsh").setMinMaxHeight(0.2F, 0.3F).setTemperatureRainfall(0.5F, 0.9F)); + Biomes.marsh = Optional.of((new BiomeGenMarsh(BOPConfigurationIDs.marshID)).setColor(10486015).setBiomeName("Marsh").setMinMaxHeight(0.2F, 0.2F).setTemperatureRainfall(0.5F, 0.9F)); Biomes.meadow = Optional.of((new BiomeGenMeadow(BOPConfigurationIDs.meadowID)).setColor(9286496).setBiomeName("Meadow").setTemperatureRainfall(0.7F, 0.7F)); Biomes.meadowForest = Optional.of((new BiomeGenMeadowForest(BOPConfigurationIDs.meadowForestID)).setColor(9286496).setBiomeName("Meadow Forest").setTemperatureRainfall(0.7F, 0.7F)); Biomes.mesa = Optional.of((new BiomeGenMesa(BOPConfigurationIDs.mesaID)).setColor(16421912).setBiomeName("Mesa").setDisableRain().setTemperatureRainfall(2.0F, 0.05F).setMinMaxHeight(0.4F, 2.0F)); From ca2783b4f0ab10db0b53cc3541702fe0fb0c71a0 Mon Sep 17 00:00:00 2001 From: Matt Caughey Date: Sat, 28 Sep 2013 00:13:03 -0400 Subject: [PATCH 08/15] Tweaked some achievement icons --- common/biomesoplenty/helpers/AchievementHelper.java | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/common/biomesoplenty/helpers/AchievementHelper.java b/common/biomesoplenty/helpers/AchievementHelper.java index 9a0ef7d89..c4fa33ae9 100644 --- a/common/biomesoplenty/helpers/AchievementHelper.java +++ b/common/biomesoplenty/helpers/AchievementHelper.java @@ -164,7 +164,7 @@ public class AchievementHelper achLushSwamp = (new Achievement(3118, "achLushSwamp", -4, 0, new ItemStack(Blocks.ivy.get(), 1, 0), achBOP)).registerAchievement(); achMangrove = (new Achievement(3119, "achMangrove", -2, 0, new ItemStack(Blocks.colorizedSaplings.get(), 1, 1), achBOP)).registerAchievement(); achMapleWoods = (new Achievement(3120, "achMapleWoods", 0, 0, new ItemStack(Blocks.saplings.get(), 1, 11), achBOP)).registerAchievement(); - achMarsh = (new Achievement(3121, "achMarsh", 2, 0, new ItemStack(Item.bucketWater, 1, 0), achBOP)).registerAchievement(); + achMarsh = (new Achievement(3121, "achMarsh", 2, 0, new ItemStack(Blocks.plants.get(), 1, 14), achBOP)).registerAchievement(); achMeadow = (new Achievement(3122, "achMeadow", 4, 0, new ItemStack(Blocks.flowers.get(), 1, 4), achBOP)).registerAchievement(); achMesa = (new Achievement(3123, "achMesa", 6, 0, new ItemStack(Blocks.redRock.get(), 1, 0), achBOP)).registerAchievement(); achMoor = (new Achievement(3124, "achMoor", 8, 0, new ItemStack(Blocks.flowers.get(), 1, 1), achBOP)).registerAchievement(); @@ -189,7 +189,7 @@ public class AchievementHelper achScrubland = (new Achievement(3141, "achScrubland", -2, 4, new ItemStack(Block.tallGrass, 1, 0), achBOP)).registerAchievement(); achSeasonalForest = (new Achievement(3142, "achSeasonalForest", 0, 4, new ItemStack(Blocks.saplings.get(), 1, 8), achBOP)).registerAchievement(); achShield = (new Achievement(3143, "achShield", 2, 4, new ItemStack(Blocks.moss.get(), 1, 0), achBOP)).registerAchievement(); - achShrubland = (new Achievement(3144, "achShrubland", 4, 4, new ItemStack(Blocks.foliage.get(), 1, 1), achBOP)).registerAchievement(); + achShrubland = (new Achievement(3144, "achShrubland", 4, 4, new ItemStack(Blocks.foliage.get(), 1, 9), achBOP)).registerAchievement(); achSilkglades = (new Achievement(3145, "achSilkglades", 6, 4, new ItemStack(Block.web, 1, 0), achBOP)).registerAchievement(); achSludgepit = (new Achievement(3146, "achSludgepit", 8, 4, new ItemStack(Blocks.foliage.get(), 1, 0), achBOP)).registerAchievement().setSpecial(); achSpruceWoods = (new Achievement(3147, "achSpruceWoods", 10, 4, new ItemStack(Blocks.flowers2.get(), 1, 5), achBOP)).registerAchievement(); @@ -201,7 +201,7 @@ public class AchievementHelper achTropicalRainforest = (new Achievement(3152, "achTropicalRainforest", -2, 6, new ItemStack(Blocks.flowers.get(), 1, 5), achBOP)).registerAchievement(); achTropics = (new Achievement(3153, "achTropics", 0, 6, new ItemStack(Blocks.colorizedSaplings.get(), 1, 2), achBOP)).registerAchievement(); achTundra = (new Achievement(3154, "achTundra", 2, 6, new ItemStack(Block.gravel, 1, 0), achBOP)).registerAchievement(); - achVolcano = (new Achievement(3155, "achVolcano", 4, 6, new ItemStack(Item.bucketLava, 1, 0), achBOP)).registerAchievement(); + achVolcano = (new Achievement(3155, "achVolcano", 4, 6, new ItemStack(Blocks.ash.get(), 1, 0), achBOP)).registerAchievement(); achWasteland = (new Achievement(3156, "achWasteland", 6, 6, new ItemStack(Blocks.driedDirt.get(), 1, 0), achBOP)).registerAchievement().setSpecial(); achWetland = (new Achievement(3157, "achWetland", 8, 6, new ItemStack(Blocks.plants.get(), 1, 7), achBOP)).registerAchievement(); achWoodland = (new Achievement(3158, "achWoodland", 10, 6, new ItemStack(Blocks.mushrooms.get(), 1, 0), achBOP)).registerAchievement(); From cbf3a778635e0416114e6c1e279572df9f8c8625 Mon Sep 17 00:00:00 2001 From: Matt Caughey Date: Sat, 28 Sep 2013 06:33:51 -0400 Subject: [PATCH 09/15] Attempt as massive oak trees --- .../biomes/BiomeGenSacredSprings.java | 3 +- .../worldgen/tree/WorldGenMassiveTree.java | 504 ++++++++++++++++++ 2 files changed, 506 insertions(+), 1 deletion(-) create mode 100644 common/biomesoplenty/worldgen/tree/WorldGenMassiveTree.java diff --git a/common/biomesoplenty/biomes/BiomeGenSacredSprings.java b/common/biomesoplenty/biomes/BiomeGenSacredSprings.java index 684ff7e95..4f2957e8a 100644 --- a/common/biomesoplenty/biomes/BiomeGenSacredSprings.java +++ b/common/biomesoplenty/biomes/BiomeGenSacredSprings.java @@ -12,6 +12,7 @@ import net.minecraft.world.gen.feature.WorldGenerator; import biomesoplenty.api.Blocks; import biomesoplenty.configuration.configfile.BOPConfigurationMisc; import biomesoplenty.entities.EntityJungleSpider; +import biomesoplenty.worldgen.tree.WorldGenMassiveTree; public class BiomeGenSacredSprings extends BiomeGenBase { @@ -39,7 +40,7 @@ public class BiomeGenSacredSprings extends BiomeGenBase @Override public WorldGenerator getRandomWorldGenForTrees(Random par1Random) { - return new WorldGenShrub(0, 0); + return par1Random.nextInt(150) == 0 ? new WorldGenMassiveTree(false) : new WorldGenShrub(0, 0); } @Override diff --git a/common/biomesoplenty/worldgen/tree/WorldGenMassiveTree.java b/common/biomesoplenty/worldgen/tree/WorldGenMassiveTree.java new file mode 100644 index 000000000..b535121c3 --- /dev/null +++ b/common/biomesoplenty/worldgen/tree/WorldGenMassiveTree.java @@ -0,0 +1,504 @@ +package biomesoplenty.worldgen.tree; + +import java.util.Random; + +import net.minecraft.block.Block; +import net.minecraft.util.MathHelper; +import net.minecraft.world.World; +import net.minecraft.world.gen.feature.WorldGenerator; + +public class WorldGenMassiveTree extends WorldGenerator +{ + /** + * Contains three sets of two values that provide complimentary indices for a given 'major' index - 1 and 2 for 0, 0 + * and 2 for 1, and 0 and 1 for 2. + */ + static final byte[] otherCoordPairs = new byte[] {(byte)2, (byte)0, (byte)0, (byte)1, (byte)2, (byte)1}; + + /** random seed for GenBigTree */ + Random rand = new Random(); + + /** Reference to the World object. */ + World worldObj; + int[] basePos = new int[] {0, 0, 0}; + int heightLimit = 0; + int height; + double heightAttenuation = 0.45D; + double branchDensity = 5.0D; + double branchSlope = 0.45D; + double scaleWidth = 4.0D; + double leafDensity = 5.0D; + + /** + * Currently always 1, can be set to 2 in the class constructor to generate a double-sized tree trunk for big trees. + */ + int trunkSize = 2; + + /** + * Sets the limit of the random value used to initialize the height limit. + */ + int heightLimitLimit = 45; + + /** + * Sets the distance limit for how far away the generator will populate leaves from the base leaf node. + */ + int leafDistanceLimit = 4; + + /** Contains a list of a points at which to generate groups of leaves. */ + int[][] leafNodes; + + public WorldGenMassiveTree(boolean par1) + { + super(par1); + } + + /** + * Generates a list of leaf nodes for the tree, to be populated by generateLeaves. + */ + void generateLeafNodeList() + { + height = (int)(heightLimit * heightAttenuation); + + if (height >= heightLimit) + { + height = heightLimit - 1; + } + + int var1 = (int)(1.382D + Math.pow(leafDensity * heightLimit / 13.0D, 2.0D)); + + if (var1 < 1) + { + var1 = 1; + } + + int[][] var2 = new int[var1 * heightLimit][4]; + int var3 = basePos[1] + heightLimit - leafDistanceLimit; + int var4 = 1; + int var5 = basePos[1] + height; + int var6 = var3 - basePos[1]; + var2[0][0] = basePos[0]; + var2[0][1] = var3; + var2[0][2] = basePos[2]; + var2[0][3] = var5; + --var3; + + while (var6 >= 0) + { + int var7 = 0; + float var8 = this.layerSize(var6); + + if (var8 < 0.0F) + { + --var3; + --var6; + } + else + { + for (double var9 = 0.5D; var7 < var1; ++var7) + { + double var11 = scaleWidth * var8 * (rand.nextFloat() + 0.328D); + double var13 = rand.nextFloat() * 2.0D * Math.PI; + int var15 = MathHelper.floor_double(var11 * Math.sin(var13) + basePos[0] + var9); + int var16 = MathHelper.floor_double(var11 * Math.cos(var13) + basePos[2] + var9); + int[] var17 = new int[] {var15, var3, var16}; + int[] var18 = new int[] {var15, var3 + leafDistanceLimit, var16}; + + if (this.checkBlockLine(var17, var18) == -1) + { + int[] var19 = new int[] {basePos[0], basePos[1], basePos[2]}; + double var20 = Math.sqrt(Math.pow(Math.abs(basePos[0] - var17[0]), 2.0D) + Math.pow(Math.abs(basePos[2] - var17[2]), 2.0D)); + double var22 = var20 * branchSlope; + + if (var17[1] - var22 > var5) + { + var19[1] = var5; + } + else + { + var19[1] = (int)(var17[1] - var22); + } + + if (this.checkBlockLine(var19, var17) == -1) + { + var2[var4][0] = var15; + var2[var4][1] = var3; + var2[var4][2] = var16; + var2[var4][3] = var19[1]; + ++var4; + } + } + } + + --var3; + --var6; + } + } + + leafNodes = new int[var4][4]; + System.arraycopy(var2, 0, leafNodes, 0, var4); + } + + void genTreeLayer(int par1, int par2, int par3, float par4, byte par5, int par6) + { + int var7 = (int)(par4 + 0.618D); + byte var8 = otherCoordPairs[par5]; + byte var9 = otherCoordPairs[par5 + 3]; + int[] var10 = new int[] {par1, par2, par3}; + int[] var11 = new int[] {0, 0, 0}; + int var12 = -var7; + int var13 = -var7; + + for (var11[par5] = var10[par5]; var12 <= var7; ++var12) + { + var11[var8] = var10[var8] + var12; + var13 = -var7; + + while (var13 <= var7) + { + double var15 = Math.pow(Math.abs(var12) + 0.5D, 2.0D) + Math.pow(Math.abs(var13) + 0.5D, 2.0D); + + if (var15 > par4 * par4) + { + ++var13; + } + else + { + var11[var9] = var10[var9] + var13; + int var14 = worldObj.getBlockId(var11[0], var11[1], var11[2]); + + if (var14 != 0 && var14 != Block.leaves.blockID) + { + ++var13; + } + else + { + this.setBlockAndMetadata(worldObj, var11[0], var11[1], var11[2], par6, 4); + ++var13; + } + } + } + } + } + + /** + * Gets the rough size of a layer of the tree. + */ + float layerSize(int par1) + { + if (par1 < (heightLimit) * 0.3D) + return -1.618F; + else + { + float var2 = heightLimit / 2.0F; + float var3 = heightLimit / 2.0F - par1; + float var4; + + if (var3 == 0.0F) + { + var4 = var2; + } + else if (Math.abs(var3) >= var2) + { + var4 = 0.0F; + } + else + { + var4 = (float)Math.sqrt(Math.pow(Math.abs(var2), 2.0D) - Math.pow(Math.abs(var3), 2.0D)); + } + + var4 *= 0.5F; + return var4; + } + } + + float leafSize(int par1) + { + return par1 >= 0 && par1 < leafDistanceLimit ? (par1 != 0 && par1 != leafDistanceLimit - 1 ? 3.0F : 2.0F) : -1.0F; + } + + /** + * Generates the leaves surrounding an individual entry in the leafNodes list. + */ + void generateLeafNode(int par1, int par2, int par3) + { + int var4 = par2; + + for (int var5 = par2 + leafDistanceLimit; var4 < var5; ++var4) + { + float var6 = this.leafSize(var4 - par2); + this.genTreeLayer(par1, var4, par3, var6, (byte)1, Block.leaves.blockID); + } + } + + /** + * Places a line of the specified block ID into the world from the first coordinate triplet to the second. + */ + void placeBlockLine(int[] par1ArrayOfInteger, int[] par2ArrayOfInteger, int par3) + { + int[] var4 = new int[] {0, 0, 0}; + byte var5 = 0; + byte var6; + + for (var6 = 0; var5 < 3; ++var5) + { + var4[var5] = par2ArrayOfInteger[var5] - par1ArrayOfInteger[var5]; + + if (Math.abs(var4[var5]) > Math.abs(var4[var6])) + { + var6 = var5; + } + } + + if (var4[var6] != 0) + { + byte var7 = otherCoordPairs[var6]; + byte var8 = otherCoordPairs[var6 + 3]; + byte var9; + + if (var4[var6] > 0) + { + var9 = 1; + } + else + { + var9 = -1; + } + + double var10 = (double)var4[var7] / (double)var4[var6]; + double var12 = (double)var4[var8] / (double)var4[var6]; + int[] var14 = new int[] {0, 0, 0}; + int var15 = 0; + + for (int var16 = var4[var6] + var9; var15 != var16; var15 += var9) + { + var14[var6] = MathHelper.floor_double(par1ArrayOfInteger[var6] + var15 + 0.5D); + var14[var7] = MathHelper.floor_double(par1ArrayOfInteger[var7] + var15 * var10 + 0.5D); + var14[var8] = MathHelper.floor_double(par1ArrayOfInteger[var8] + var15 * var12 + 0.5D); + byte var17 = 0; + int var18 = Math.abs(var14[0] - par1ArrayOfInteger[0]); + int var19 = Math.abs(var14[2] - par1ArrayOfInteger[2]); + int var20 = Math.max(var18, var19); + + if (var20 > 0) + { + if (var18 == var20) + { + var17 = 4; + } + else if (var19 == var20) + { + var17 = 8; + } + } + + this.setBlockAndMetadata(worldObj, var14[0], var14[1], var14[2], par3, var17); + } + } + } + + /** + * Generates the leaf portion of the tree as specified by the leafNodes list. + */ + void generateLeaves() + { + int var1 = 0; + + for (int var2 = leafNodes.length; var1 < var2; ++var1) + { + int var3 = leafNodes[var1][0]; + int var4 = leafNodes[var1][1]; + int var5 = leafNodes[var1][2]; + this.generateLeafNode(var3, var4, var5); + } + } + + /** + * Indicates whether or not a leaf node requires additional wood to be added to preserve integrity. + */ + boolean leafNodeNeedsBase(int par1) + { + return par1 >= heightLimit * 0.2D; + } + + /** + * Places the trunk for the big tree that is being generated. Able to generate double-sized trunks by changing a + * field that is always 1 to 2. + */ + void generateTrunk() + { + int var1 = basePos[0]; + int var2 = basePos[1]; + int var3 = basePos[1] + height; + int var4 = basePos[2]; + int[] var5 = new int[] {var1, var2, var4}; + int[] var6 = new int[] {var1, var3, var4}; + this.placeBlockLine(var5, var6, Block.wood.blockID); + + if (trunkSize == 2) + { + ++var5[0]; + ++var6[0]; + this.placeBlockLine(var5, var6, Block.wood.blockID); + ++var5[2]; + ++var6[2]; + this.placeBlockLine(var5, var6, Block.wood.blockID); + var5[0] += -1; + var6[0] += -1; + this.placeBlockLine(var5, var6, Block.wood.blockID); + } + } + + /** + * Generates additional wood blocks to fill out the bases of different leaf nodes that would otherwise degrade. + */ + void generateLeafNodeBases() + { + int var1 = 0; + int var2 = leafNodes.length; + + for (int[] var3 = new int[] {basePos[0], basePos[1], basePos[2]}; var1 < var2; ++var1) + { + int[] var4 = leafNodes[var1]; + int[] var5 = new int[] {var4[0], var4[1], var4[2]}; + var3[1] = var4[3]; + int var6 = var3[1] - basePos[1]; + + if (this.leafNodeNeedsBase(var6)) + { + this.placeBlockLine(var3, var5, Block.wood.blockID); + } + } + } + + /** + * Checks a line of blocks in the world from the first coordinate to triplet to the second, returning the distance + * (in blocks) before a non-air, non-leaf block is encountered and/or the end is encountered. + */ + int checkBlockLine(int[] par1ArrayOfInteger, int[] par2ArrayOfInteger) + { + int[] var3 = new int[] {0, 0, 0}; + byte var4 = 0; + byte var5; + + for (var5 = 0; var4 < 3; ++var4) + { + var3[var4] = par2ArrayOfInteger[var4] - par1ArrayOfInteger[var4]; + + if (Math.abs(var3[var4]) > Math.abs(var3[var5])) + { + var5 = var4; + } + } + + if (var3[var5] == 0) + return -1; + else + { + byte var6 = otherCoordPairs[var5]; + byte var7 = otherCoordPairs[var5 + 3]; + byte var8; + + if (var3[var5] > 0) + { + var8 = 1; + } + else + { + var8 = -1; + } + + double var9 = (double)var3[var6] / (double)var3[var5]; + double var11 = (double)var3[var7] / (double)var3[var5]; + int[] var13 = new int[] {0, 0, 0}; + int var14 = 0; + int var15; + + for (var15 = var3[var5] + var8; var14 != var15; var14 += var8) + { + var13[var5] = par1ArrayOfInteger[var5] + var14; + var13[var6] = MathHelper.floor_double(par1ArrayOfInteger[var6] + var14 * var9); + var13[var7] = MathHelper.floor_double(par1ArrayOfInteger[var7] + var14 * var11); + int var16 = worldObj.getBlockId(var13[0], var13[1], var13[2]); + + if (var16 != 0 && var16 != Block.leaves.blockID) + { + break; + } + } + + return var14 == var15 ? -1 : Math.abs(var14); + } + } + + /** + * Returns a boolean indicating whether or not the current location for the tree, spanning basePos to to the height + * limit, is valid. + */ + boolean validTreeLocation() + { + int[] var1 = new int[] {basePos[0], basePos[1], basePos[2]}; + int[] var2 = new int[] {basePos[0], basePos[1] + heightLimit - 1, basePos[2]}; + int var3 = worldObj.getBlockId(basePos[0], basePos[1] - 1, basePos[2]); + + if (var3 != 2 && var3 != 3) + return false; + else + { + int var4 = this.checkBlockLine(var1, var2); + + if (var4 == -1) + return true; + else if (var4 < 6) + return false; + else + { + heightLimit = var4; + return true; + } + } + } + + /** + * Rescales the generator settings, only used in WorldGenBigTree + */ + @Override + public void setScale(double par1, double par3, double par5) + { + heightLimitLimit = (int)(par1 * 12.0D); + + if (par1 > 0.5D) + { + leafDistanceLimit = 5; + } + + scaleWidth = par3; + leafDensity = par5; + } + + @Override + public boolean generate(World par1World, Random par2Random, int par3, int par4, int par5) + { + worldObj = par1World; + long var6 = par2Random.nextLong(); + rand.setSeed(var6); + basePos[0] = par3; + basePos[1] = par4; + basePos[2] = par5; + + if (heightLimit == 0) + { + heightLimit = 30 + par2Random.nextInt(30); + } + + if (!this.validTreeLocation()) + return false; + else + { + this.generateLeafNodeList(); + this.generateLeaves(); + this.generateTrunk(); + this.generateLeafNodeBases(); + return true; + } + } +} From ac220d1f8954d713f31a46d9f78d181dc7bdea1e Mon Sep 17 00:00:00 2001 From: Matt Caughey Date: Sat, 28 Sep 2013 06:51:39 -0400 Subject: [PATCH 10/15] Fixed tree trunks --- .../worldgen/tree/WorldGenMassiveTree.java | 56 +++++++++++-------- 1 file changed, 33 insertions(+), 23 deletions(-) diff --git a/common/biomesoplenty/worldgen/tree/WorldGenMassiveTree.java b/common/biomesoplenty/worldgen/tree/WorldGenMassiveTree.java index b535121c3..f7636b2cd 100644 --- a/common/biomesoplenty/worldgen/tree/WorldGenMassiveTree.java +++ b/common/biomesoplenty/worldgen/tree/WorldGenMassiveTree.java @@ -324,29 +324,39 @@ public class WorldGenMassiveTree extends WorldGenerator * Places the trunk for the big tree that is being generated. Able to generate double-sized trunks by changing a * field that is always 1 to 2. */ - void generateTrunk() - { - int var1 = basePos[0]; - int var2 = basePos[1]; - int var3 = basePos[1] + height; - int var4 = basePos[2]; - int[] var5 = new int[] {var1, var2, var4}; - int[] var6 = new int[] {var1, var3, var4}; - this.placeBlockLine(var5, var6, Block.wood.blockID); + + + void generateTrunk() + { + int var1 = basePos[0]; + int var2 = basePos[1]; + int var3 = basePos[1] + height; + int var4 = basePos[2]; + + int[] var5 = new int[] {var1, var2, var4}; + int[] var6 = new int[] {var1, var3, var4}; + + if (trunkSize == 2) + { + for (int i = -2; i < 3; i++ ) + { + var5[0] = var1 + i; + var6[0] = var1 + i; + + for (int j = -2; j < 3; j++ ) + { + if ((i != -2 && j != -2) || (i != -2 && j != 2) || (i != 2 && j != -2) || (i != 2 && j != 2)) + { + var5[2] = var4 + j; + var6[2] = var4 + j; + this.placeBlockLine(var5, var6, Block.wood.blockID); + } + } + } + } + } + - if (trunkSize == 2) - { - ++var5[0]; - ++var6[0]; - this.placeBlockLine(var5, var6, Block.wood.blockID); - ++var5[2]; - ++var6[2]; - this.placeBlockLine(var5, var6, Block.wood.blockID); - var5[0] += -1; - var6[0] += -1; - this.placeBlockLine(var5, var6, Block.wood.blockID); - } - } /** * Generates additional wood blocks to fill out the bases of different leaf nodes that would otherwise degrade. @@ -487,7 +497,7 @@ public class WorldGenMassiveTree extends WorldGenerator if (heightLimit == 0) { - heightLimit = 30 + par2Random.nextInt(30); + heightLimit = 50; } if (!this.validTreeLocation()) From 600781cb18ca2a3a75feb14c694f21c7cb208107 Mon Sep 17 00:00:00 2001 From: Matt Caughey Date: Sat, 28 Sep 2013 07:25:23 -0400 Subject: [PATCH 11/15] Fixed massive tree trunks again --- common/biomesoplenty/worldgen/tree/WorldGenMassiveTree.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/common/biomesoplenty/worldgen/tree/WorldGenMassiveTree.java b/common/biomesoplenty/worldgen/tree/WorldGenMassiveTree.java index f7636b2cd..67da54958 100644 --- a/common/biomesoplenty/worldgen/tree/WorldGenMassiveTree.java +++ b/common/biomesoplenty/worldgen/tree/WorldGenMassiveTree.java @@ -345,7 +345,7 @@ public class WorldGenMassiveTree extends WorldGenerator for (int j = -2; j < 3; j++ ) { - if ((i != -2 && j != -2) || (i != -2 && j != 2) || (i != 2 && j != -2) || (i != 2 && j != 2)) + if (!(i == -2 && j == -2) && !(i == -2 && j == 2) && !(i == 2 && j == -2) && !(i == 2 && j == 2)) { var5[2] = var4 + j; var6[2] = var4 + j; From 9b97f207ca35a4229811ddaf246b246784869836 Mon Sep 17 00:00:00 2001 From: Matt Caughey Date: Sat, 28 Sep 2013 18:53:14 -0400 Subject: [PATCH 12/15] Added a Sacred Oak sapling --- common/biomesoplenty/api/BlockReferences.java | 1 + .../blocks/BlockBOPColorizedSapling.java | 8 ++++---- .../configuration/BOPVanillaCompat.java | 3 +++ .../itemblocks/ItemBlockColorizedSapling.java | 2 +- resources/assets/biomesoplenty/lang/en_US.lang | 1 + .../textures/blocks/sapling_sacredoak.png | Bin 0 -> 697 bytes 6 files changed, 10 insertions(+), 5 deletions(-) create mode 100644 resources/assets/biomesoplenty/textures/blocks/sapling_sacredoak.png diff --git a/common/biomesoplenty/api/BlockReferences.java b/common/biomesoplenty/api/BlockReferences.java index ac1e86637..f3bce590c 100644 --- a/common/biomesoplenty/api/BlockReferences.java +++ b/common/biomesoplenty/api/BlockReferences.java @@ -91,6 +91,7 @@ public class BlockReferences { redwoodSapling (Blocks.colorizedSaplings, 3), willowSapling (Blocks.colorizedSaplings, 4), pineSapling (Blocks.colorizedSaplings, 5), + sacredoakSapling (Blocks.colorizedSaplings, 6), mapleSapling (Blocks.saplings, 11), orangeAutumnSapling (Blocks.saplings, 8), pinkCherrySapling (Blocks.saplings, 10), diff --git a/common/biomesoplenty/blocks/BlockBOPColorizedSapling.java b/common/biomesoplenty/blocks/BlockBOPColorizedSapling.java index 9a1dd2afb..e0f1f7db6 100644 --- a/common/biomesoplenty/blocks/BlockBOPColorizedSapling.java +++ b/common/biomesoplenty/blocks/BlockBOPColorizedSapling.java @@ -13,9 +13,9 @@ import net.minecraft.world.World; import net.minecraft.world.gen.feature.WorldGenerator; import net.minecraftforge.common.ForgeDirection; import biomesoplenty.BiomesOPlenty; -import biomesoplenty.worldgen.WorldGenNetherBush; import biomesoplenty.worldgen.tree.WorldGenAcacia; import biomesoplenty.worldgen.tree.WorldGenMangrove; +import biomesoplenty.worldgen.tree.WorldGenMassiveTree; import biomesoplenty.worldgen.tree.WorldGenPalmTree1; import biomesoplenty.worldgen.tree.WorldGenPalmTree3; import biomesoplenty.worldgen.tree.WorldGenPineTree; @@ -26,7 +26,7 @@ import cpw.mods.fml.relauncher.SideOnly; public class BlockBOPColorizedSapling extends BlockSapling { - private static final String[] saplings = new String[] {"acacia", "mangrove", "palm", "redwood", "willow", "pine"}; + private static final String[] saplings = new String[] {"acacia", "mangrove", "palm", "redwood", "willow", "pine", "sacredoak"}; private Icon[] textures; private static final int TYPES = 15; @@ -163,8 +163,8 @@ public class BlockBOPColorizedSapling extends BlockSapling obj = new WorldGenPineTree(); break; - case 6: // Hellbark - obj = new WorldGenNetherBush(); + case 6: // Sacred Oak + obj = new WorldGenMassiveTree(false); break; } } diff --git a/common/biomesoplenty/configuration/BOPVanillaCompat.java b/common/biomesoplenty/configuration/BOPVanillaCompat.java index d0d105980..749bf1a46 100644 --- a/common/biomesoplenty/configuration/BOPVanillaCompat.java +++ b/common/biomesoplenty/configuration/BOPVanillaCompat.java @@ -47,6 +47,7 @@ public class BOPVanillaCompat { dungeon.addItem(new WeightedRandomChestContent(new ItemStack(Items.miscItems.get(), 1, 15), 1, 2, 5)); dungeon.addItem(new WeightedRandomChestContent(new ItemStack(Items.wadingBoots.get(), 1, 0), 1, 1, 15)); dungeon.addItem(new WeightedRandomChestContent(new ItemStack(Items.flippers.get(), 1, 0), 1, 1, 10)); + dungeon.addItem(new WeightedRandomChestContent(new ItemStack(Blocks.colorizedSaplings.get(),1,6), 1, 1, 1)); mineshaft.addItem(new WeightedRandomChestContent(new ItemStack(Items.miscItems.get(), 1, 1), 2, 8, 25)); mineshaft.addItem(new WeightedRandomChestContent(new ItemStack(Items.miscItems.get(), 1, 10), 1, 3, 10)); @@ -70,9 +71,11 @@ public class BOPVanillaCompat { desertTemple.addItem(new WeightedRandomChestContent(new ItemStack(Items.wadingBoots.get(),1,0), 1, 1, 20)); desertTemple.addItem(new WeightedRandomChestContent(new ItemStack(Items.flippers.get(),1,0), 1, 1, 15)); + desertTemple.addItem(new WeightedRandomChestContent(new ItemStack(Blocks.colorizedSaplings.get(),1,6), 1, 1, 1)); jungleTemple.addItem(new WeightedRandomChestContent(new ItemStack(Items.wadingBoots.get(),1,0), 1, 1, 20)); jungleTemple.addItem(new WeightedRandomChestContent(new ItemStack(Items.flippers.get(),1,0), 1, 1, 15)); + jungleTemple.addItem(new WeightedRandomChestContent(new ItemStack(Blocks.colorizedSaplings.get(),1,6), 1, 1, 1)); village.addItem(new WeightedRandomChestContent(new ItemStack(Blocks.plants.get(),1,5), 2, 6, 25)); village.addItem(new WeightedRandomChestContent(new ItemStack(Items.miscItems.get(), 1, 1), 2, 8, 25)); diff --git a/common/biomesoplenty/itemblocks/ItemBlockColorizedSapling.java b/common/biomesoplenty/itemblocks/ItemBlockColorizedSapling.java index 856c7e5ed..d8f65e0cd 100644 --- a/common/biomesoplenty/itemblocks/ItemBlockColorizedSapling.java +++ b/common/biomesoplenty/itemblocks/ItemBlockColorizedSapling.java @@ -7,7 +7,7 @@ import net.minecraft.util.Icon; public class ItemBlockColorizedSapling extends ItemBlock { - private static final String[] saplings = new String[] {"acacia", "mangrove", "palm", "redwood", "willow", "pine"}; + private static final String[] saplings = new String[] {"acacia", "mangrove", "palm", "redwood", "willow", "pine", "sacredoak"}; public ItemBlockColorizedSapling(int par1) { diff --git a/resources/assets/biomesoplenty/lang/en_US.lang b/resources/assets/biomesoplenty/lang/en_US.lang index db3378063..4ef0ea961 100644 --- a/resources/assets/biomesoplenty/lang/en_US.lang +++ b/resources/assets/biomesoplenty/lang/en_US.lang @@ -103,6 +103,7 @@ tile.bop.colorizedSaplings.palmSapling.name=Palm Sapling tile.bop.colorizedSaplings.redwoodSapling.name=Redwood Sapling tile.bop.colorizedSaplings.willowSapling.name=Willow Sapling tile.bop.colorizedSaplings.pineSapling.name=Pine Sapling +tile.bop.colorizedSaplings.sacredoakSapling.name=Sacred Oak Sapling tile.bop.willow.name=Willow tile.bop.ivy.name=Ivy diff --git a/resources/assets/biomesoplenty/textures/blocks/sapling_sacredoak.png b/resources/assets/biomesoplenty/textures/blocks/sapling_sacredoak.png new file mode 100644 index 0000000000000000000000000000000000000000..2ab3077d648635eb04fd4739394e6508308a4e37 GIT binary patch literal 697 zcmV;q0!ICbP)N2bPDNB8 zb~7$DE-^7j^FlWO00K2hL_t(IPi<3MPZMDf-EF&opxi7JxwNsh_6DV}lr+6#wLmHD zLbNSac~FcmMq;Xj`TIrEh->vCbZsar)-Ght}s(C;3Uv;^2^=Jd` z_BCr1CGf2*Zil{CL~h`yjFHE2iD@YF{iP^I_m|=Oye4LHM9Tw$?lR$UI21}eUz>-T z^@*W9Mo3hQY{jK3V<{p?z@o^BA&29wB-*L^?;JiIt^sZ0cijMlv>};!6h^$O;E;MZuk$4`pCu9z%~h ztL&U{8|+9$Gw)YG151DQPep+6)R`Tv6ix!-%3 zc$OBzRxKtYQ5l=`ZiQtmv$3VXEH>e)r=)v5Jq2TVLb~ydIBzDpJD>GWBzVSG*~m-_ f!M}}8? Date: Sun, 29 Sep 2013 11:16:32 +0200 Subject: [PATCH 13/15] Random pine trees --- .../worldgen/tree/WorldGenPineTree.java | 208 +++++++----------- 1 file changed, 85 insertions(+), 123 deletions(-) diff --git a/common/biomesoplenty/worldgen/tree/WorldGenPineTree.java b/common/biomesoplenty/worldgen/tree/WorldGenPineTree.java index c48549ab9..84ee89bca 100644 --- a/common/biomesoplenty/worldgen/tree/WorldGenPineTree.java +++ b/common/biomesoplenty/worldgen/tree/WorldGenPineTree.java @@ -3,6 +3,7 @@ package biomesoplenty.worldgen.tree; import java.util.Random; import net.minecraft.block.Block; +import net.minecraft.block.material.Material; import net.minecraft.world.World; import net.minecraft.world.gen.feature.WorldGenerator; import biomesoplenty.api.Blocks; @@ -20,7 +21,9 @@ public class WorldGenPineTree extends WorldGenerator int var6 = var1.getBlockId(var3, var4, var5); if (var6 != Block.grass.blockID && var6 != Blocks.hardDirt.get().blockID && var6 != Block.stone.blockID && var6 != Block.dirt.blockID) + { return false; + } else { for (int var7 = -2; var7 <= 2; ++var7) @@ -28,137 +31,96 @@ public class WorldGenPineTree extends WorldGenerator for (int var8 = -2; var8 <= 2; ++var8) { if (var1.isAirBlock(var3 + var7, var4 - 1, var5 + var8) && var1.isAirBlock(var3 + var7, var4 - 2, var5 + var8) && !var1.isAirBlock(var3 + var7, var4, var5 + var8)) + { return false; + } } } - - int var99 = var2.nextInt(2); - - if (var99 == 0) + + //settings======== + int baselength = 4 + var2.nextInt(4); + int branches = 1 + var2.nextInt(3); + //================ + + int h = 1; + buildBlock(var1, var3, var4, var5, Block.dirt.blockID, 0); + for(int b = 0; b < baselength; b++) { - var1.setBlock(var3, var4, var5, Block.dirt.blockID); - var1.setBlock(var3, var4 + 1, var5, Blocks.logs4.get().blockID, 0, 2); - var1.setBlock(var3, var4 + 2, var5, Blocks.logs4.get().blockID, 0, 2); - var1.setBlock(var3, var4 + 3, var5, Blocks.logs4.get().blockID, 0, 2); - var1.setBlock(var3, var4 + 4, var5, Blocks.logs4.get().blockID, 0, 2); - var1.setBlock(var3, var4 + 5, var5, Blocks.logs4.get().blockID, 0, 2); - var1.setBlock(var3, var4 + 6, var5, Blocks.logs4.get().blockID, 0, 2); - var1.setBlock(var3, var4 + 7, var5, Blocks.logs4.get().blockID, 0, 2); - var1.setBlock(var3, var4 + 8, var5, Blocks.logs4.get().blockID, 0, 2); - var1.setBlock(var3, var4 + 9, var5, Blocks.logs4.get().blockID, 0, 2); - var1.setBlock(var3, var4 + 10, var5, Blocks.logs4.get().blockID, 0, 2); - - var1.setBlock(var3 + 1, var4 + 6, var5, Blocks.leavesColorized.get().blockID, 5, 2); - var1.setBlock(var3 - 1, var4 + 6, var5, Blocks.leavesColorized.get().blockID, 5, 2); - var1.setBlock(var3, var4 + 6, var5 + 1, Blocks.leavesColorized.get().blockID, 5, 2); - var1.setBlock(var3, var4 + 6, var5 - 1, Blocks.leavesColorized.get().blockID, 5, 2); - var1.setBlock(var3 + 1, var4 + 6, var5 + 1, Blocks.leavesColorized.get().blockID, 5, 2); - var1.setBlock(var3 + 1, var4 + 6, var5 - 1, Blocks.leavesColorized.get().blockID, 5, 2); - var1.setBlock(var3 - 1, var4 + 6, var5 + 1, Blocks.leavesColorized.get().blockID, 5, 2); - var1.setBlock(var3 - 1, var4 + 6, var5 - 1, Blocks.leavesColorized.get().blockID, 5, 2); - var1.setBlock(var3 - 1, var4 + 6, var5 - 2, Blocks.leavesColorized.get().blockID, 5, 2); - var1.setBlock(var3 - 2, var4 + 6, var5 - 1, Blocks.leavesColorized.get().blockID, 5, 2); - var1.setBlock(var3 - 2, var4 + 6, var5 - 2, Blocks.leavesColorized.get().blockID, 5, 2); - var1.setBlock(var3 + 1, var4 + 6, var5 + 2, Blocks.leavesColorized.get().blockID, 5, 2); - var1.setBlock(var3 + 2, var4 + 6, var5 + 1, Blocks.leavesColorized.get().blockID, 5, 2); - var1.setBlock(var3 + 2, var4 + 6, var5 + 2, Blocks.leavesColorized.get().blockID, 5, 2); - - var1.setBlock(var3 + 1, var4 + 8, var5, Blocks.leavesColorized.get().blockID, 5, 2); - var1.setBlock(var3 - 1, var4 + 8, var5, Blocks.leavesColorized.get().blockID, 5, 2); - var1.setBlock(var3, var4 + 8, var5 + 1, Blocks.leavesColorized.get().blockID, 5, 2); - var1.setBlock(var3, var4 + 8, var5 - 1, Blocks.leavesColorized.get().blockID, 5, 2); - var1.setBlock(var3 + 1, var4 + 8, var5 + 1, Blocks.leavesColorized.get().blockID, 5, 2); - var1.setBlock(var3 + 1, var4 + 8, var5 - 1, Blocks.leavesColorized.get().blockID, 5, 2); - var1.setBlock(var3 - 1, var4 + 8, var5 + 1, Blocks.leavesColorized.get().blockID, 5, 2); - var1.setBlock(var3 - 1, var4 + 8, var5 - 1, Blocks.leavesColorized.get().blockID, 5, 2); - var1.setBlock(var3 + 1, var4 + 8, var5 - 2, Blocks.leavesColorized.get().blockID, 5, 2); - var1.setBlock(var3 + 2, var4 + 8, var5 - 1, Blocks.leavesColorized.get().blockID, 5, 2); - var1.setBlock(var3 + 2, var4 + 8, var5 - 2, Blocks.leavesColorized.get().blockID, 5, 2); - var1.setBlock(var3 - 1, var4 + 8, var5 + 2, Blocks.leavesColorized.get().blockID, 5, 2); - var1.setBlock(var3 - 2, var4 + 8, var5 + 1, Blocks.leavesColorized.get().blockID, 5, 2); - var1.setBlock(var3 - 2, var4 + 8, var5 + 2, Blocks.leavesColorized.get().blockID, 5, 2); - - var1.setBlock(var3 + 1, var4 + 10, var5, Blocks.leavesColorized.get().blockID, 5, 2); - var1.setBlock(var3 - 1, var4 + 10, var5, Blocks.leavesColorized.get().blockID, 5, 2); - var1.setBlock(var3, var4 + 10, var5 + 1, Blocks.leavesColorized.get().blockID, 5, 2); - var1.setBlock(var3, var4 + 10, var5 - 1, Blocks.leavesColorized.get().blockID, 5, 2); - var1.setBlock(var3 + 1, var4 + 10, var5 + 1, Blocks.leavesColorized.get().blockID, 5, 2); - var1.setBlock(var3 + 1, var4 + 10, var5 - 1, Blocks.leavesColorized.get().blockID, 5, 2); - var1.setBlock(var3 - 1, var4 + 10, var5 + 1, Blocks.leavesColorized.get().blockID, 5, 2); - var1.setBlock(var3 - 1, var4 + 10, var5 - 1, Blocks.leavesColorized.get().blockID, 5, 2); - - var1.setBlock(var3 + 1, var4 + 11, var5, Blocks.leavesColorized.get().blockID, 5, 2); - var1.setBlock(var3 - 1, var4 + 11, var5, Blocks.leavesColorized.get().blockID, 5, 2); - var1.setBlock(var3, var4 + 11, var5 + 1, Blocks.leavesColorized.get().blockID, 5, 2); - var1.setBlock(var3, var4 + 11, var5 - 1, Blocks.leavesColorized.get().blockID, 5, 2); - - var1.setBlock(var3, var4 + 12, var5, Blocks.leavesColorized.get().blockID, 5, 2); + buildBlock(var1, var3, var4 + h, var5, Blocks.logs4.get().blockID, 0); + h++; } - - if (var99 == 1) + + int c = 1; + for(int r = 0; r < branches; r++) { - var1.setBlock(var3, var4, var5, Block.dirt.blockID); - var1.setBlock(var3, var4 + 1, var5, Blocks.logs4.get().blockID, 0, 2); - var1.setBlock(var3, var4 + 2, var5, Blocks.logs4.get().blockID, 0, 2); - var1.setBlock(var3, var4 + 3, var5, Blocks.logs4.get().blockID, 0, 2); - var1.setBlock(var3, var4 + 4, var5, Blocks.logs4.get().blockID, 0, 2); - var1.setBlock(var3, var4 + 5, var5, Blocks.logs4.get().blockID, 0, 2); - var1.setBlock(var3, var4 + 6, var5, Blocks.logs4.get().blockID, 0, 2); - var1.setBlock(var3, var4 + 7, var5, Blocks.logs4.get().blockID, 0, 2); - var1.setBlock(var3, var4 + 8, var5, Blocks.logs4.get().blockID, 0, 2); - var1.setBlock(var3, var4 + 9, var5, Blocks.logs4.get().blockID, 0, 2); - var1.setBlock(var3, var4 + 10, var5, Blocks.logs4.get().blockID, 0, 2); - - var1.setBlock(var3 + 1, var4 + 6, var5, Blocks.leavesColorized.get().blockID, 5, 2); - var1.setBlock(var3 - 1, var4 + 6, var5, Blocks.leavesColorized.get().blockID, 5, 2); - var1.setBlock(var3, var4 + 6, var5 + 1, Blocks.leavesColorized.get().blockID, 5, 2); - var1.setBlock(var3, var4 + 6, var5 - 1, Blocks.leavesColorized.get().blockID, 5, 2); - var1.setBlock(var3 + 1, var4 + 6, var5 + 1, Blocks.leavesColorized.get().blockID, 5, 2); - var1.setBlock(var3 + 1, var4 + 6, var5 - 1, Blocks.leavesColorized.get().blockID, 5, 2); - var1.setBlock(var3 - 1, var4 + 6, var5 + 1, Blocks.leavesColorized.get().blockID, 5, 2); - var1.setBlock(var3 - 1, var4 + 6, var5 - 1, Blocks.leavesColorized.get().blockID, 5, 2); - - var1.setBlock(var3 + 1, var4 + 6, var5 - 2, Blocks.leavesColorized.get().blockID, 5, 2); - var1.setBlock(var3 + 2, var4 + 6, var5 - 1, Blocks.leavesColorized.get().blockID, 5, 2); - var1.setBlock(var3 + 2, var4 + 6, var5 - 2, Blocks.leavesColorized.get().blockID, 5, 2); - var1.setBlock(var3 - 1, var4 + 6, var5 + 2, Blocks.leavesColorized.get().blockID, 5, 2); - var1.setBlock(var3 - 2, var4 + 6, var5 + 1, Blocks.leavesColorized.get().blockID, 5, 2); - var1.setBlock(var3 - 2, var4 + 6, var5 + 2, Blocks.leavesColorized.get().blockID, 5, 2); - - var1.setBlock(var3 + 1, var4 + 8, var5, Blocks.leavesColorized.get().blockID, 5, 2); - var1.setBlock(var3 - 1, var4 + 8, var5, Blocks.leavesColorized.get().blockID, 5, 2); - var1.setBlock(var3, var4 + 8, var5 + 1, Blocks.leavesColorized.get().blockID, 5, 2); - var1.setBlock(var3, var4 + 8, var5 - 1, Blocks.leavesColorized.get().blockID, 5, 2); - var1.setBlock(var3 + 1, var4 + 8, var5 + 1, Blocks.leavesColorized.get().blockID, 5, 2); - var1.setBlock(var3 + 1, var4 + 8, var5 - 1, Blocks.leavesColorized.get().blockID, 5, 2); - var1.setBlock(var3 - 1, var4 + 8, var5 + 1, Blocks.leavesColorized.get().blockID, 5, 2); - var1.setBlock(var3 - 1, var4 + 8, var5 - 1, Blocks.leavesColorized.get().blockID, 5, 2); - - var1.setBlock(var3 - 1, var4 + 8, var5 - 2, Blocks.leavesColorized.get().blockID, 5, 2); - var1.setBlock(var3 - 2, var4 + 8, var5 - 1, Blocks.leavesColorized.get().blockID, 5, 2); - var1.setBlock(var3 - 2, var4 + 8, var5 - 2, Blocks.leavesColorized.get().blockID, 5, 2); - var1.setBlock(var3 + 1, var4 + 8, var5 + 2, Blocks.leavesColorized.get().blockID, 5, 2); - var1.setBlock(var3 + 2, var4 + 8, var5 + 1, Blocks.leavesColorized.get().blockID, 5, 2); - var1.setBlock(var3 + 2, var4 + 8, var5 + 2, Blocks.leavesColorized.get().blockID, 5, 2); - - var1.setBlock(var3 + 1, var4 + 10, var5, Blocks.leavesColorized.get().blockID, 5, 2); - var1.setBlock(var3 - 1, var4 + 10, var5, Blocks.leavesColorized.get().blockID, 5, 2); - var1.setBlock(var3, var4 + 10, var5 + 1, Blocks.leavesColorized.get().blockID, 5, 2); - var1.setBlock(var3, var4 + 10, var5 - 1, Blocks.leavesColorized.get().blockID, 5, 2); - var1.setBlock(var3 + 1, var4 + 10, var5 + 1, Blocks.leavesColorized.get().blockID, 5, 2); - var1.setBlock(var3 + 1, var4 + 10, var5 - 1, Blocks.leavesColorized.get().blockID, 5, 2); - var1.setBlock(var3 - 1, var4 + 10, var5 + 1, Blocks.leavesColorized.get().blockID, 5, 2); - var1.setBlock(var3 - 1, var4 + 10, var5 - 1, Blocks.leavesColorized.get().blockID, 5, 2); - - var1.setBlock(var3 + 1, var4 + 11, var5, Blocks.leavesColorized.get().blockID, 5, 2); - var1.setBlock(var3 - 1, var4 + 11, var5, Blocks.leavesColorized.get().blockID, 5, 2); - var1.setBlock(var3, var4 + 11, var5 + 1, Blocks.leavesColorized.get().blockID, 5, 2); - var1.setBlock(var3, var4 + 11, var5 - 1, Blocks.leavesColorized.get().blockID, 5, 2); - - var1.setBlock(var3, var4 + 12, var5, Blocks.leavesColorized.get().blockID, 5, 2); + generateBranch(var1, var2, var3, var4 + h, var5, c); + c++; + h+=2; } - + + generateTop(var1, var3, var4 + h, var5); return true; } } + + public void generateTop(World world, int x, int y, int z) + { + for(int i = -1; i < 2; i++) + { + for(int j = -1; j < 2; j++) + { + buildBlock(world, x + i, y, z + j, Blocks.leavesColorized.get().blockID, 5); + } + } + buildBlock(world, x, y, z, Blocks.logs4.get().blockID, 0); + buildBlock(world, x + 1, y + 1, z, Blocks.leavesColorized.get().blockID, 5); + buildBlock(world, x, y + 1, z - 1, Blocks.leavesColorized.get().blockID, 5); + buildBlock(world, x, y + 1, z + 1, Blocks.leavesColorized.get().blockID, 5); + buildBlock(world, x - 1, y + 1, z, Blocks.leavesColorized.get().blockID, 5); + buildBlock(world, x, y + 2, z, Blocks.leavesColorized.get().blockID, 5); + } + + public void generateBranch(World world, Random rand, int x, int y, int z, int n) + { + for(int i = -1; i < 2; i++) + { + for(int j = -1; j < 2; j++) + { + buildBlock(world, x + i, y, z + j, Blocks.leavesColorized.get().blockID, 5); + } + } + + if(n % 2 == 0) + { + buildBlock(world, x + 1, y, z - 2, Blocks.leavesColorized.get().blockID, 5); + buildBlock(world, x + 2, y, z - 2, Blocks.leavesColorized.get().blockID, 5); + buildBlock(world, x + 2, y, z - 1, Blocks.leavesColorized.get().blockID, 5); + + buildBlock(world, x - 2, y, z + 1, Blocks.leavesColorized.get().blockID, 5); + buildBlock(world, x - 2, y, z + 2, Blocks.leavesColorized.get().blockID, 5); + buildBlock(world, x - 1, y, z + 2, Blocks.leavesColorized.get().blockID, 5); + } + else + { + buildBlock(world, x + 2, y, z + 1, Blocks.leavesColorized.get().blockID, 5); + buildBlock(world, x + 2, y, z + 2, Blocks.leavesColorized.get().blockID, 5); + buildBlock(world, x + 1, y, z + 2, Blocks.leavesColorized.get().blockID, 5); + + buildBlock(world, x - 1, y, z - 2, Blocks.leavesColorized.get().blockID, 5); + buildBlock(world, x - 2, y, z - 2, Blocks.leavesColorized.get().blockID, 5); + buildBlock(world, x - 2, y, z - 1, Blocks.leavesColorized.get().blockID, 5); + } + + buildBlock(world, x, y, z, Blocks.logs4.get().blockID, 0); + buildBlock(world, x, y + 1, z, Blocks.logs4.get().blockID, 0); + } + + public void buildBlock(World world, int x, int y, int z, int id, int meta) + { + Material m = world.getBlockMaterial(x, y, z); + if(m == Material.air || m == Material.leaves) + { + world.setBlock(x, y, z, id, meta, 2); + } + } } From c98636b6de656b232f2d040361ab3aad50c59135 Mon Sep 17 00:00:00 2001 From: ted80-PC Date: Sun, 29 Sep 2013 12:50:35 +0200 Subject: [PATCH 14/15] Random palm trees --- .../worldgen/tree/WorldGenPalmTree1.java | 245 +++++------------- .../worldgen/tree/WorldGenPalmTree3.java | 229 +++++----------- 2 files changed, 138 insertions(+), 336 deletions(-) diff --git a/common/biomesoplenty/worldgen/tree/WorldGenPalmTree1.java b/common/biomesoplenty/worldgen/tree/WorldGenPalmTree1.java index 8a8e9c302..e7740fed8 100644 --- a/common/biomesoplenty/worldgen/tree/WorldGenPalmTree1.java +++ b/common/biomesoplenty/worldgen/tree/WorldGenPalmTree1.java @@ -3,6 +3,7 @@ package biomesoplenty.worldgen.tree; import java.util.Random; import net.minecraft.block.Block; +import net.minecraft.block.material.Material; import net.minecraft.world.World; import net.minecraft.world.gen.feature.WorldGenerator; import biomesoplenty.api.Blocks; @@ -20,7 +21,9 @@ public class WorldGenPalmTree1 extends WorldGenerator int var6 = var1.getBlockId(var3, var4, var5); if (var6 != Block.grass.blockID) + { return false; + } else { for (int var7 = -2; var7 <= 2; ++var7) @@ -28,189 +31,79 @@ public class WorldGenPalmTree1 extends WorldGenerator for (int var8 = -2; var8 <= 2; ++var8) { if (var1.isAirBlock(var3 + var7, var4 - 1, var5 + var8) && var1.isAirBlock(var3 + var7, var4 - 2, var5 + var8) && !var1.isAirBlock(var3 + var7, var4, var5 + var8)) + { return false; + } } } - - int var99 = var2.nextInt(4); - - if (var99 == 0) + + //settings======== + double strength = var2.nextInt(35) / 100D; + //================ + + double xoff = 0; + double yoff = 0; + int r = var2.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(var1, var3, var4, var5, Block.dirt.blockID, 0); + for(int b = 0; b < 10; b++) { - var1.setBlock(var3, var4, var5, Block.dirt.blockID); - var1.setBlock(var3, var4 + 1, var5, Blocks.logs2.get().blockID, 3, 2); - var1.setBlock(var3, var4 + 2, var5, Blocks.logs2.get().blockID, 3, 2); - var1.setBlock(var3, var4 + 3, var5, Blocks.logs2.get().blockID, 3, 2); - var1.setBlock(var3, var4 + 4, var5, Blocks.logs2.get().blockID, 3, 2); - var1.setBlock(var3, var4 + 5, var5, Blocks.logs2.get().blockID, 3, 2); - var1.setBlock(var3, var4 + 6, var5, Blocks.logs2.get().blockID, 3, 2); - var1.setBlock(var3 + 1, var4 + 7, var5, Blocks.logs2.get().blockID, 3, 2); - var1.setBlock(var3 + 1, var4 + 8, var5, Blocks.logs2.get().blockID, 3, 2); - var1.setBlock(var3 + 1, var4 + 9, var5, Blocks.logs2.get().blockID, 3, 2); - var1.setBlock(var3 + 2, var4 + 10, var5, Blocks.logs2.get().blockID, 3, 2); - var1.setBlock(var3 + 2, var4 + 11, var5, Blocks.logs2.get().blockID, 3, 2); - var1.setBlock(var3 + 2, var4 + 12, var5, Blocks.logs2.get().blockID, 3, 2); - - var1.setBlock(var3, var4 + 11, var5, Blocks.leavesColorized.get().blockID, 2, 2); - var1.setBlock(var3 + 4, var4 + 11, var5, Blocks.leavesColorized.get().blockID, 2, 2); - var1.setBlock(var3 + 2, var4 + 11, var5 - 2, Blocks.leavesColorized.get().blockID, 2, 2); - var1.setBlock(var3 + 2, var4 + 11, var5 + 2, Blocks.leavesColorized.get().blockID, 2, 2); - - var1.setBlock(var3 + 1, var4 + 12, var5, Blocks.leavesColorized.get().blockID, 2, 2); - var1.setBlock(var3 + 3, var4 + 12, var5, Blocks.leavesColorized.get().blockID, 2, 2); - var1.setBlock(var3 + 2, var4 + 12, var5 - 1, Blocks.leavesColorized.get().blockID, 2, 2); - var1.setBlock(var3 + 2, var4 + 12, var5 + 1, Blocks.leavesColorized.get().blockID, 2, 2); - - var1.setBlock(var3, var4 + 12, var5 - 2, Blocks.leavesColorized.get().blockID, 2, 2); - var1.setBlock(var3 + 4, var4 + 12, var5 - 2, Blocks.leavesColorized.get().blockID, 2, 2); - var1.setBlock(var3, var4 + 12, var5 + 2, Blocks.leavesColorized.get().blockID, 2, 2); - var1.setBlock(var3 + 4, var4 + 12, var5 + 2, Blocks.leavesColorized.get().blockID, 2, 2); - - var1.setBlock(var3 + 1, var4 + 13, var5 - 1, Blocks.leavesColorized.get().blockID, 2, 2); - var1.setBlock(var3 + 3, var4 + 13, var5 - 1, Blocks.leavesColorized.get().blockID, 2, 2); - var1.setBlock(var3 + 1, var4 + 13, var5 + 1, Blocks.leavesColorized.get().blockID, 2, 2); - var1.setBlock(var3 + 3, var4 + 13, var5 + 1, Blocks.leavesColorized.get().blockID, 2, 2); - - var1.setBlock(var3 + 2, var4 + 13, var5, Blocks.leavesColorized.get().blockID, 2, 2); - - var1.setBlock(var3, var4 + 14, var5, Blocks.leavesColorized.get().blockID, 2, 2); - var1.setBlock(var3 + 4, var4 + 14, var5, Blocks.leavesColorized.get().blockID, 2, 2); - var1.setBlock(var3 + 2, var4 + 14, var5 - 2, Blocks.leavesColorized.get().blockID, 2, 2); - var1.setBlock(var3 + 2, var4 + 14, var5 + 2, Blocks.leavesColorized.get().blockID, 2, 2); - } - - if (var99 == 1) - { - var1.setBlock(var3, var4, var5, Block.dirt.blockID); - var1.setBlock(var3, var4 + 1, var5, Blocks.logs2.get().blockID, 3, 2); - var1.setBlock(var3, var4 + 2, var5, Blocks.logs2.get().blockID, 3, 2); - var1.setBlock(var3, var4 + 3, var5, Blocks.logs2.get().blockID, 3, 2); - var1.setBlock(var3, var4 + 4, var5, Blocks.logs2.get().blockID, 3, 2); - var1.setBlock(var3, var4 + 5, var5, Blocks.logs2.get().blockID, 3, 2); - var1.setBlock(var3, var4 + 6, var5, Blocks.logs2.get().blockID, 3, 2); - var1.setBlock(var3 - 1, var4 + 7, var5, Blocks.logs2.get().blockID, 3, 2); - var1.setBlock(var3 - 1, var4 + 8, var5, Blocks.logs2.get().blockID, 3, 2); - var1.setBlock(var3 - 1, var4 + 9, var5, Blocks.logs2.get().blockID, 3, 2); - var1.setBlock(var3 - 2, var4 + 10, var5, Blocks.logs2.get().blockID, 3, 2); - var1.setBlock(var3 - 2, var4 + 11, var5, Blocks.logs2.get().blockID, 3, 2); - var1.setBlock(var3 - 2, var4 + 12, var5, Blocks.logs2.get().blockID, 3, 2); - - var1.setBlock(var3 - 4, var4 + 11, var5, Blocks.leavesColorized.get().blockID, 2, 2); - var1.setBlock(var3, var4 + 11, var5, Blocks.leavesColorized.get().blockID, 2, 2); - var1.setBlock(var3 - 2, var4 + 11, var5 - 2, Blocks.leavesColorized.get().blockID, 2, 2); - var1.setBlock(var3 - 2, var4 + 11, var5 + 2, Blocks.leavesColorized.get().blockID, 2, 2); - - var1.setBlock(var3 - 3, var4 + 12, var5, Blocks.leavesColorized.get().blockID, 2, 2); - var1.setBlock(var3 - 1, var4 + 12, var5, Blocks.leavesColorized.get().blockID, 2, 2); - var1.setBlock(var3 - 2, var4 + 12, var5 - 1, Blocks.leavesColorized.get().blockID, 2, 2); - var1.setBlock(var3 - 2, var4 + 12, var5 + 1, Blocks.leavesColorized.get().blockID, 2, 2); - - var1.setBlock(var3 - 4, var4 + 12, var5 - 2, Blocks.leavesColorized.get().blockID, 2, 2); - var1.setBlock(var3, var4 + 12, var5 - 2, Blocks.leavesColorized.get().blockID, 2, 2); - var1.setBlock(var3 - 4, var4 + 12, var5 + 2, Blocks.leavesColorized.get().blockID, 2, 2); - var1.setBlock(var3, var4 + 12, var5 + 2, Blocks.leavesColorized.get().blockID, 2, 2); - - var1.setBlock(var3 - 3, var4 + 13, var5 - 1, Blocks.leavesColorized.get().blockID, 2, 2); - var1.setBlock(var3 - 1, var4 + 13, var5 - 1, Blocks.leavesColorized.get().blockID, 2, 2); - var1.setBlock(var3 - 3, var4 + 13, var5 + 1, Blocks.leavesColorized.get().blockID, 2, 2); - var1.setBlock(var3 - 1, var4 + 13, var5 + 1, Blocks.leavesColorized.get().blockID, 2, 2); - - var1.setBlock(var3 - 2, var4 + 13, var5, Blocks.leavesColorized.get().blockID, 2, 2); - - var1.setBlock(var3 - 4, var4 + 14, var5, Blocks.leavesColorized.get().blockID, 2, 2); - var1.setBlock(var3, var4 + 14, var5, Blocks.leavesColorized.get().blockID, 2, 2); - var1.setBlock(var3 - 2, var4 + 14, var5 - 2, Blocks.leavesColorized.get().blockID, 2, 2); - var1.setBlock(var3 - 2, var4 + 14, var5 + 2, Blocks.leavesColorized.get().blockID, 2, 2); - } - - if (var99 == 2) - { - var1.setBlock(var3, var4, var5, Block.dirt.blockID); - var1.setBlock(var3, var4 + 1, var5, Blocks.logs2.get().blockID, 3, 2); - var1.setBlock(var3, var4 + 2, var5, Blocks.logs2.get().blockID, 3, 2); - var1.setBlock(var3, var4 + 3, var5, Blocks.logs2.get().blockID, 3, 2); - var1.setBlock(var3, var4 + 4, var5, Blocks.logs2.get().blockID, 3, 2); - var1.setBlock(var3, var4 + 5, var5, Blocks.logs2.get().blockID, 3, 2); - var1.setBlock(var3, var4 + 6, var5, Blocks.logs2.get().blockID, 3, 2); - var1.setBlock(var3, var4 + 7, var5 + 1, Blocks.logs2.get().blockID, 3, 2); - var1.setBlock(var3, var4 + 8, var5 + 1, Blocks.logs2.get().blockID, 3, 2); - var1.setBlock(var3, var4 + 9, var5 + 1, Blocks.logs2.get().blockID, 3, 2); - var1.setBlock(var3, var4 + 10, var5 + 2, Blocks.logs2.get().blockID, 3, 2); - var1.setBlock(var3, var4 + 11, var5 + 2, Blocks.logs2.get().blockID, 3, 2); - var1.setBlock(var3, var4 + 12, var5 + 2, Blocks.logs2.get().blockID, 3, 2); - - var1.setBlock(var3 - 2, var4 + 11, var5 + 2, Blocks.leavesColorized.get().blockID, 2, 2); - var1.setBlock(var3 + 2, var4 + 11, var5 + 2, Blocks.leavesColorized.get().blockID, 2, 2); - var1.setBlock(var3, var4 + 11, var5, Blocks.leavesColorized.get().blockID, 2, 2); - var1.setBlock(var3, var4 + 11, var5 + 4, Blocks.leavesColorized.get().blockID, 2, 2); - - var1.setBlock(var3 - 1, var4 + 12, var5 + 2, Blocks.leavesColorized.get().blockID, 2, 2); - var1.setBlock(var3 + 1, var4 + 12, var5 + 2, Blocks.leavesColorized.get().blockID, 2, 2); - var1.setBlock(var3, var4 + 12, var5 + 1, Blocks.leavesColorized.get().blockID, 2, 2); - var1.setBlock(var3, var4 + 12, var5 + 3, Blocks.leavesColorized.get().blockID, 2, 2); - - var1.setBlock(var3 - 2, var4 + 12, var5, Blocks.leavesColorized.get().blockID, 2, 2); - var1.setBlock(var3 + 2, var4 + 12, var5, Blocks.leavesColorized.get().blockID, 2, 2); - var1.setBlock(var3 - 2, var4 + 12, var5 + 4, Blocks.leavesColorized.get().blockID, 2, 2); - var1.setBlock(var3 + 2, var4 + 12, var5 + 4, Blocks.leavesColorized.get().blockID, 2, 2); - - var1.setBlock(var3 - 1, var4 + 13, var5 + 1, Blocks.leavesColorized.get().blockID, 2, 2); - var1.setBlock(var3 + 1, var4 + 13, var5 + 1, Blocks.leavesColorized.get().blockID, 2, 2); - var1.setBlock(var3 - 1, var4 + 13, var5 + 3, Blocks.leavesColorized.get().blockID, 2, 2); - var1.setBlock(var3 + 1, var4 + 13, var5 + 3, Blocks.leavesColorized.get().blockID, 2, 2); - - var1.setBlock(var3, var4 + 13, var5 + 2, Blocks.leavesColorized.get().blockID, 2, 2); - - var1.setBlock(var3 - 2, var4 + 14, var5 + 2, Blocks.leavesColorized.get().blockID, 2, 2); - var1.setBlock(var3 + 2, var4 + 14, var5 + 2, Blocks.leavesColorized.get().blockID, 2, 2); - var1.setBlock(var3, var4 + 14, var5, Blocks.leavesColorized.get().blockID, 2, 2); - var1.setBlock(var3, var4 + 14, var5 + 4, Blocks.leavesColorized.get().blockID, 2, 2); - } - - if (var99 == 3) - { - var1.setBlock(var3, var4, var5, Block.dirt.blockID); - var1.setBlock(var3, var4 + 1, var5, Blocks.logs2.get().blockID, 3, 2); - var1.setBlock(var3, var4 + 2, var5, Blocks.logs2.get().blockID, 3, 2); - var1.setBlock(var3, var4 + 3, var5, Blocks.logs2.get().blockID, 3, 2); - var1.setBlock(var3, var4 + 4, var5, Blocks.logs2.get().blockID, 3, 2); - var1.setBlock(var3, var4 + 5, var5, Blocks.logs2.get().blockID, 3, 2); - var1.setBlock(var3, var4 + 6, var5, Blocks.logs2.get().blockID, 3, 2); - var1.setBlock(var3, var4 + 7, var5 - 1, Blocks.logs2.get().blockID, 3, 2); - var1.setBlock(var3, var4 + 8, var5 - 1, Blocks.logs2.get().blockID, 3, 2); - var1.setBlock(var3, var4 + 9, var5 - 1, Blocks.logs2.get().blockID, 3, 2); - var1.setBlock(var3, var4 + 10, var5 - 2, Blocks.logs2.get().blockID, 3, 2); - var1.setBlock(var3, var4 + 11, var5 - 2, Blocks.logs2.get().blockID, 3, 2); - var1.setBlock(var3, var4 + 12, var5 - 2, Blocks.logs2.get().blockID, 3, 2); - - var1.setBlock(var3 - 2, var4 + 11, var5 - 2, Blocks.leavesColorized.get().blockID, 2, 2); - var1.setBlock(var3 + 2, var4 + 11, var5 - 2, Blocks.leavesColorized.get().blockID, 2, 2); - var1.setBlock(var3, var4 + 11, var5 - 4, Blocks.leavesColorized.get().blockID, 2, 2); - var1.setBlock(var3, var4 + 11, var5, Blocks.leavesColorized.get().blockID, 2, 2); - - var1.setBlock(var3 - 1, var4 + 12, var5 - 2, Blocks.leavesColorized.get().blockID, 2, 2); - var1.setBlock(var3 + 1, var4 + 12, var5 - 2, Blocks.leavesColorized.get().blockID, 2, 2); - var1.setBlock(var3, var4 + 12, var5 - 3, Blocks.leavesColorized.get().blockID, 2, 2); - var1.setBlock(var3, var4 + 12, var5 - 1, Blocks.leavesColorized.get().blockID, 2, 2); - - var1.setBlock(var3 - 2, var4 + 12, var5 - 4, Blocks.leavesColorized.get().blockID, 2, 2); - var1.setBlock(var3 + 2, var4 + 12, var5 - 4, Blocks.leavesColorized.get().blockID, 2, 2); - var1.setBlock(var3 - 2, var4 + 12, var5, Blocks.leavesColorized.get().blockID, 2, 2); - var1.setBlock(var3 + 2, var4 + 12, var5, Blocks.leavesColorized.get().blockID, 2, 2); - - var1.setBlock(var3 - 1, var4 + 13, var5 - 3, Blocks.leavesColorized.get().blockID, 2, 2); - var1.setBlock(var3 + 1, var4 + 13, var5 - 3, Blocks.leavesColorized.get().blockID, 2, 2); - var1.setBlock(var3 - 1, var4 + 13, var5 - 1, Blocks.leavesColorized.get().blockID, 2, 2); - var1.setBlock(var3 + 1, var4 + 13, var5 - 1, Blocks.leavesColorized.get().blockID, 2, 2); - - var1.setBlock(var3, var4 + 13, var5 - 2, Blocks.leavesColorized.get().blockID, 2, 2); - - var1.setBlock(var3 - 2, var4 + 14, var5 - 2, Blocks.leavesColorized.get().blockID, 2, 2); - var1.setBlock(var3 + 2, var4 + 14, var5 - 2, Blocks.leavesColorized.get().blockID, 2, 2); - var1.setBlock(var3, var4 + 14, var5 - 4, Blocks.leavesColorized.get().blockID, 2, 2); - var1.setBlock(var3, var4 + 14, var5, Blocks.leavesColorized.get().blockID, 2, 2); + buildBlock(var1, var3 + ((int) Math.floor(xoff)), var4 + h, var5 + ((int) Math.floor(yoff)), Blocks.logs2.get().blockID, 3); + if(b == 9) + { + generateTop(var1, var3 + ((int) Math.floor(xoff)), var4 + h, var5 + ((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, Blocks.leavesColorized.get().blockID, 2); + buildBlock(world, x - 2, y - 1, z, Blocks.leavesColorized.get().blockID, 2); + buildBlock(world, x, y - 1, z + 2, Blocks.leavesColorized.get().blockID, 2); + buildBlock(world, x, y - 1, z - 2, Blocks.leavesColorized.get().blockID, 2); + + buildBlock(world, x + 1, y, z, Blocks.leavesColorized.get().blockID, 2); + buildBlock(world, x - 1, y, z, Blocks.leavesColorized.get().blockID, 2); + buildBlock(world, x, y, z + 1, Blocks.leavesColorized.get().blockID, 2); + buildBlock(world, x, y, z - 1, Blocks.leavesColorized.get().blockID, 2); + buildBlock(world, x + 2, y, z + 2, Blocks.leavesColorized.get().blockID, 2); + buildBlock(world, x - 2, y, z - 2, Blocks.leavesColorized.get().blockID, 2); + buildBlock(world, x + 2, y, z - 2, Blocks.leavesColorized.get().blockID, 2); + buildBlock(world, x - 2, y, z + 2, Blocks.leavesColorized.get().blockID, 2); + + buildBlock(world, x + 1, y + 1, z - 1, Blocks.leavesColorized.get().blockID, 2); + buildBlock(world, x - 1, y + 1, z + 1, Blocks.leavesColorized.get().blockID, 2); + buildBlock(world, x + 1, y + 1, z + 1, Blocks.leavesColorized.get().blockID, 2); + buildBlock(world, x - 1, y + 1, z - 1, Blocks.leavesColorized.get().blockID, 2); + buildBlock(world, x, y + 1, z, Blocks.leavesColorized.get().blockID, 2); + + buildBlock(world, x + 2, y + 2, z, Blocks.leavesColorized.get().blockID, 2); + buildBlock(world, x - 2, y + 2, z, Blocks.leavesColorized.get().blockID, 2); + buildBlock(world, x, y + 2, z + 2, Blocks.leavesColorized.get().blockID, 2); + buildBlock(world, x, y + 2, z - 2, Blocks.leavesColorized.get().blockID, 2); + } + + public void buildBlock(World world, int x, int y, int z, int id, int meta) + { + Material m = world.getBlockMaterial(x, y, z); + if(m == Material.air || m == Material.leaves) + { + world.setBlock(x, y, z, id, meta, 2); + } + } } diff --git a/common/biomesoplenty/worldgen/tree/WorldGenPalmTree3.java b/common/biomesoplenty/worldgen/tree/WorldGenPalmTree3.java index 3a8e9f61f..38b0475f0 100644 --- a/common/biomesoplenty/worldgen/tree/WorldGenPalmTree3.java +++ b/common/biomesoplenty/worldgen/tree/WorldGenPalmTree3.java @@ -3,6 +3,7 @@ package biomesoplenty.worldgen.tree; import java.util.Random; import net.minecraft.block.Block; +import net.minecraft.block.material.Material; import net.minecraft.world.World; import net.minecraft.world.gen.feature.WorldGenerator; import biomesoplenty.api.Blocks; @@ -20,7 +21,9 @@ public class WorldGenPalmTree3 extends WorldGenerator int var6 = var1.getBlockId(var3, var4, var5); if (var6 != Block.grass.blockID) + { return false; + } else { for (int var7 = -2; var7 <= 2; ++var7) @@ -28,173 +31,79 @@ public class WorldGenPalmTree3 extends WorldGenerator for (int var8 = -2; var8 <= 2; ++var8) { if (var1.isAirBlock(var3 + var7, var4 - 1, var5 + var8) && var1.isAirBlock(var3 + var7, var4 - 2, var5 + var8) && !var1.isAirBlock(var3 + var7, var4, var5 + var8)) + { return false; + } } } - - int var99 = var2.nextInt(4); - - if (var99 == 0) + + //settings======== + double strength = var2.nextInt(25) / 100D; + //================ + + double xoff = 0; + double yoff = 0; + int r = var2.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(var1, var3, var4, var5, Block.dirt.blockID, 0); + for(int b = 0; b < 8; b++) { - var1.setBlock(var3, var4, var5, Block.dirt.blockID); - var1.setBlock(var3, var4 + 1, var5, Blocks.logs2.get().blockID, 3, 2); - var1.setBlock(var3, var4 + 2, var5, Blocks.logs2.get().blockID, 3, 2); - var1.setBlock(var3, var4 + 3, var5, Blocks.logs2.get().blockID, 3, 2); - var1.setBlock(var3, var4 + 4, var5, Blocks.logs2.get().blockID, 3, 2); - var1.setBlock(var3 + 1, var4 + 5, var5, Blocks.logs2.get().blockID, 3, 2); - var1.setBlock(var3 + 1, var4 + 6, var5, Blocks.logs2.get().blockID, 3, 2); - var1.setBlock(var3 + 2, var4 + 7, var5, Blocks.logs2.get().blockID, 3, 2); - var1.setBlock(var3 + 2, var4 + 8, var5, Blocks.logs2.get().blockID, 3, 2); - - var1.setBlock(var3, var4 + 7, var5, Blocks.leavesColorized.get().blockID, 2, 2); - var1.setBlock(var3 + 4, var4 + 7, var5, Blocks.leavesColorized.get().blockID, 2, 2); - var1.setBlock(var3 + 2, var4 + 7, var5 - 2, Blocks.leavesColorized.get().blockID, 2, 2); - var1.setBlock(var3 + 2, var4 + 7, var5 + 2, Blocks.leavesColorized.get().blockID, 2, 2); - - var1.setBlock(var3 + 1, var4 + 8, var5, Blocks.leavesColorized.get().blockID, 2, 2); - var1.setBlock(var3 + 3, var4 + 8, var5, Blocks.leavesColorized.get().blockID, 2, 2); - var1.setBlock(var3 + 2, var4 + 8, var5 - 1, Blocks.leavesColorized.get().blockID, 2, 2); - var1.setBlock(var3 + 2, var4 + 8, var5 + 1, Blocks.leavesColorized.get().blockID, 2, 2); - - var1.setBlock(var3, var4 + 8, var5 - 2, Blocks.leavesColorized.get().blockID, 2, 2); - var1.setBlock(var3 + 4, var4 + 8, var5 - 2, Blocks.leavesColorized.get().blockID, 2, 2); - var1.setBlock(var3, var4 + 8, var5 + 2, Blocks.leavesColorized.get().blockID, 2, 2); - var1.setBlock(var3 + 4, var4 + 8, var5 + 2, Blocks.leavesColorized.get().blockID, 2, 2); - - var1.setBlock(var3 + 1, var4 + 9, var5 - 1, Blocks.leavesColorized.get().blockID, 2, 2); - var1.setBlock(var3 + 3, var4 + 9, var5 - 1, Blocks.leavesColorized.get().blockID, 2, 2); - var1.setBlock(var3 + 1, var4 + 9, var5 + 1, Blocks.leavesColorized.get().blockID, 2, 2); - var1.setBlock(var3 + 3, var4 + 9, var5 + 1, Blocks.leavesColorized.get().blockID, 2, 2); - - var1.setBlock(var3 + 2, var4 + 9, var5, Blocks.leavesColorized.get().blockID, 2, 2); - - var1.setBlock(var3, var4 + 10, var5, Blocks.leavesColorized.get().blockID, 2, 2); - var1.setBlock(var3 + 4, var4 + 10, var5, Blocks.leavesColorized.get().blockID, 2, 2); - var1.setBlock(var3 + 2, var4 + 10, var5 - 2, Blocks.leavesColorized.get().blockID, 2, 2); - var1.setBlock(var3 + 2, var4 + 10, var5 + 2, Blocks.leavesColorized.get().blockID, 2, 2); - } - - if (var99 == 1) - { - var1.setBlock(var3, var4, var5, Block.dirt.blockID); - var1.setBlock(var3, var4 + 1, var5, Blocks.logs2.get().blockID, 3, 2); - var1.setBlock(var3, var4 + 2, var5, Blocks.logs2.get().blockID, 3, 2); - var1.setBlock(var3, var4 + 3, var5, Blocks.logs2.get().blockID, 3, 2); - var1.setBlock(var3, var4 + 4, var5, Blocks.logs2.get().blockID, 3, 2); - var1.setBlock(var3 - 1, var4 + 5, var5, Blocks.logs2.get().blockID, 3, 2); - var1.setBlock(var3 - 1, var4 + 6, var5, Blocks.logs2.get().blockID, 3, 2); - var1.setBlock(var3 - 2, var4 + 7, var5, Blocks.logs2.get().blockID, 3, 2); - var1.setBlock(var3 - 2, var4 + 8, var5, Blocks.logs2.get().blockID, 3, 2); - - var1.setBlock(var3 - 4, var4 + 7, var5, Blocks.leavesColorized.get().blockID, 2, 2); - var1.setBlock(var3, var4 + 7, var5, Blocks.leavesColorized.get().blockID, 2, 2); - var1.setBlock(var3 - 2, var4 + 7, var5 - 2, Blocks.leavesColorized.get().blockID, 2, 2); - var1.setBlock(var3 - 2, var4 + 7, var5 + 2, Blocks.leavesColorized.get().blockID, 2, 2); - - var1.setBlock(var3 - 3, var4 + 8, var5, Blocks.leavesColorized.get().blockID, 2, 2); - var1.setBlock(var3 - 1, var4 + 8, var5, Blocks.leavesColorized.get().blockID, 2, 2); - var1.setBlock(var3 - 2, var4 + 8, var5 - 1, Blocks.leavesColorized.get().blockID, 2, 2); - var1.setBlock(var3 - 2, var4 + 8, var5 + 1, Blocks.leavesColorized.get().blockID, 2, 2); - - var1.setBlock(var3 - 4, var4 + 8, var5 - 2, Blocks.leavesColorized.get().blockID, 2, 2); - var1.setBlock(var3, var4 + 8, var5 - 2, Blocks.leavesColorized.get().blockID, 2, 2); - var1.setBlock(var3 - 4, var4 + 8, var5 + 2, Blocks.leavesColorized.get().blockID, 2, 2); - var1.setBlock(var3, var4 + 8, var5 + 2, Blocks.leavesColorized.get().blockID, 2, 2); - - var1.setBlock(var3 - 3, var4 + 9, var5 - 1, Blocks.leavesColorized.get().blockID, 2, 2); - var1.setBlock(var3 - 1, var4 + 9, var5 - 1, Blocks.leavesColorized.get().blockID, 2, 2); - var1.setBlock(var3 - 3, var4 + 9, var5 + 1, Blocks.leavesColorized.get().blockID, 2, 2); - var1.setBlock(var3 - 1, var4 + 9, var5 + 1, Blocks.leavesColorized.get().blockID, 2, 2); - - var1.setBlock(var3 - 2, var4 + 9, var5, Blocks.leavesColorized.get().blockID, 2, 2); - - var1.setBlock(var3 - 4, var4 + 10, var5, Blocks.leavesColorized.get().blockID, 2, 2); - var1.setBlock(var3, var4 + 10, var5, Blocks.leavesColorized.get().blockID, 2, 2); - var1.setBlock(var3 - 2, var4 + 10, var5 - 2, Blocks.leavesColorized.get().blockID, 2, 2); - var1.setBlock(var3 - 2, var4 + 10, var5 + 2, Blocks.leavesColorized.get().blockID, 2, 2); - } - - if (var99 == 2) - { - var1.setBlock(var3, var4, var5, Block.dirt.blockID); - var1.setBlock(var3, var4 + 1, var5, Blocks.logs2.get().blockID, 3, 2); - var1.setBlock(var3, var4 + 2, var5, Blocks.logs2.get().blockID, 3, 2); - var1.setBlock(var3, var4 + 3, var5, Blocks.logs2.get().blockID, 3, 2); - var1.setBlock(var3, var4 + 4, var5, Blocks.logs2.get().blockID, 3, 2); - var1.setBlock(var3, var4 + 5, var5 + 1, Blocks.logs2.get().blockID, 3, 2); - var1.setBlock(var3, var4 + 6, var5 + 1, Blocks.logs2.get().blockID, 3, 2); - var1.setBlock(var3, var4 + 7, var5 + 2, Blocks.logs2.get().blockID, 3, 2); - var1.setBlock(var3, var4 + 8, var5 + 2, Blocks.logs2.get().blockID, 3, 2); - - var1.setBlock(var3 - 2, var4 + 7, var5 + 2, Blocks.leavesColorized.get().blockID, 2, 2); - var1.setBlock(var3 + 2, var4 + 7, var5 + 2, Blocks.leavesColorized.get().blockID, 2, 2); - var1.setBlock(var3, var4 + 7, var5, Blocks.leavesColorized.get().blockID, 2, 2); - var1.setBlock(var3, var4 + 7, var5 + 4, Blocks.leavesColorized.get().blockID, 2, 2); - - var1.setBlock(var3 - 1, var4 + 8, var5 + 2, Blocks.leavesColorized.get().blockID, 2, 2); - var1.setBlock(var3 + 1, var4 + 8, var5 + 2, Blocks.leavesColorized.get().blockID, 2, 2); - var1.setBlock(var3, var4 + 8, var5 + 1, Blocks.leavesColorized.get().blockID, 2, 2); - var1.setBlock(var3, var4 + 8, var5 + 3, Blocks.leavesColorized.get().blockID, 2, 2); - - var1.setBlock(var3 - 2, var4 + 8, var5, Blocks.leavesColorized.get().blockID, 2, 2); - var1.setBlock(var3 + 2, var4 + 8, var5, Blocks.leavesColorized.get().blockID, 2, 2); - var1.setBlock(var3 - 2, var4 + 8, var5 + 4, Blocks.leavesColorized.get().blockID, 2, 2); - var1.setBlock(var3 + 2, var4 + 8, var5 + 4, Blocks.leavesColorized.get().blockID, 2, 2); - - var1.setBlock(var3 - 1, var4 + 9, var5 + 1, Blocks.leavesColorized.get().blockID, 2, 2); - var1.setBlock(var3 + 1, var4 + 9, var5 + 1, Blocks.leavesColorized.get().blockID, 2, 2); - var1.setBlock(var3 - 1, var4 + 9, var5 + 3, Blocks.leavesColorized.get().blockID, 2, 2); - var1.setBlock(var3 + 1, var4 + 9, var5 + 3, Blocks.leavesColorized.get().blockID, 2, 2); - - var1.setBlock(var3, var4 + 9, var5 + 2, Blocks.leavesColorized.get().blockID, 2, 2); - - var1.setBlock(var3 - 2, var4 + 10, var5 + 2, Blocks.leavesColorized.get().blockID, 2, 2); - var1.setBlock(var3 + 2, var4 + 10, var5 + 2, Blocks.leavesColorized.get().blockID, 2, 2); - var1.setBlock(var3, var4 + 10, var5, Blocks.leavesColorized.get().blockID, 2, 2); - var1.setBlock(var3, var4 + 10, var5 + 4, Blocks.leavesColorized.get().blockID, 2, 2); - } - - if (var99 == 3) - { - var1.setBlock(var3, var4, var5, Block.dirt.blockID); - var1.setBlock(var3, var4 + 1, var5, Blocks.logs2.get().blockID, 3, 2); - var1.setBlock(var3, var4 + 2, var5, Blocks.logs2.get().blockID, 3, 2); - var1.setBlock(var3, var4 + 3, var5, Blocks.logs2.get().blockID, 3, 2); - var1.setBlock(var3, var4 + 4, var5, Blocks.logs2.get().blockID, 3, 2); - var1.setBlock(var3, var4 + 5, var5 - 1, Blocks.logs2.get().blockID, 3, 2); - var1.setBlock(var3, var4 + 6, var5 - 1, Blocks.logs2.get().blockID, 3, 2); - var1.setBlock(var3, var4 + 7, var5 - 2, Blocks.logs2.get().blockID, 3, 2); - var1.setBlock(var3, var4 + 8, var5 - 2, Blocks.logs2.get().blockID, 3, 2); - - var1.setBlock(var3 - 2, var4 + 7, var5 - 2, Blocks.leavesColorized.get().blockID, 2, 2); - var1.setBlock(var3 + 2, var4 + 7, var5 - 2, Blocks.leavesColorized.get().blockID, 2, 2); - var1.setBlock(var3, var4 + 7, var5 - 4, Blocks.leavesColorized.get().blockID, 2, 2); - var1.setBlock(var3, var4 + 7, var5, Blocks.leavesColorized.get().blockID, 2, 2); - - var1.setBlock(var3 - 1, var4 + 8, var5 - 2, Blocks.leavesColorized.get().blockID, 2, 2); - var1.setBlock(var3 + 1, var4 + 8, var5 - 2, Blocks.leavesColorized.get().blockID, 2, 2); - var1.setBlock(var3, var4 + 8, var5 - 3, Blocks.leavesColorized.get().blockID, 2, 2); - var1.setBlock(var3, var4 + 8, var5 - 1, Blocks.leavesColorized.get().blockID, 2, 2); - - var1.setBlock(var3 - 2, var4 + 8, var5 - 4, Blocks.leavesColorized.get().blockID, 2, 2); - var1.setBlock(var3 + 2, var4 + 8, var5 - 4, Blocks.leavesColorized.get().blockID, 2, 2); - var1.setBlock(var3 - 2, var4 + 8, var5, Blocks.leavesColorized.get().blockID, 2, 2); - var1.setBlock(var3 + 2, var4 + 8, var5, Blocks.leavesColorized.get().blockID, 2, 2); - - var1.setBlock(var3 - 1, var4 + 9, var5 - 3, Blocks.leavesColorized.get().blockID, 2, 2); - var1.setBlock(var3 + 1, var4 + 9, var5 - 3, Blocks.leavesColorized.get().blockID, 2, 2); - var1.setBlock(var3 - 1, var4 + 9, var5 - 1, Blocks.leavesColorized.get().blockID, 2, 2); - var1.setBlock(var3 + 1, var4 + 9, var5 - 1, Blocks.leavesColorized.get().blockID, 2, 2); - - var1.setBlock(var3, var4 + 9, var5 - 2, Blocks.leavesColorized.get().blockID, 2, 2); - - var1.setBlock(var3 - 2, var4 + 10, var5 - 2, Blocks.leavesColorized.get().blockID, 2, 2); - var1.setBlock(var3 + 2, var4 + 10, var5 - 2, Blocks.leavesColorized.get().blockID, 2, 2); - var1.setBlock(var3, var4 + 10, var5 - 4, Blocks.leavesColorized.get().blockID, 2, 2); - var1.setBlock(var3, var4 + 10, var5, Blocks.leavesColorized.get().blockID, 2, 2); + buildBlock(var1, var3 + ((int) Math.floor(xoff)), var4 + h, var5 + ((int) Math.floor(yoff)), Blocks.logs2.get().blockID, 3); + if(b == 7) + { + generateTop(var1, var3 + ((int) Math.floor(xoff)), var4 + h, var5 + ((int) Math.floor(yoff))); + } + else + { + h++; + xoff *= 1.5D; + yoff *= 1.5D; + } } return true; } } + + public void generateTop(World world, int x, int y, int z) + { + buildBlock(world, x + 2, y - 1, z, Blocks.leavesColorized.get().blockID, 2); + buildBlock(world, x - 2, y - 1, z, Blocks.leavesColorized.get().blockID, 2); + buildBlock(world, x, y - 1, z + 2, Blocks.leavesColorized.get().blockID, 2); + buildBlock(world, x, y - 1, z - 2, Blocks.leavesColorized.get().blockID, 2); + + buildBlock(world, x + 1, y, z, Blocks.leavesColorized.get().blockID, 2); + buildBlock(world, x - 1, y, z, Blocks.leavesColorized.get().blockID, 2); + buildBlock(world, x, y, z + 1, Blocks.leavesColorized.get().blockID, 2); + buildBlock(world, x, y, z - 1, Blocks.leavesColorized.get().blockID, 2); + buildBlock(world, x + 2, y, z + 2, Blocks.leavesColorized.get().blockID, 2); + buildBlock(world, x - 2, y, z - 2, Blocks.leavesColorized.get().blockID, 2); + buildBlock(world, x + 2, y, z - 2, Blocks.leavesColorized.get().blockID, 2); + buildBlock(world, x - 2, y, z + 2, Blocks.leavesColorized.get().blockID, 2); + + buildBlock(world, x + 1, y + 1, z - 1, Blocks.leavesColorized.get().blockID, 2); + buildBlock(world, x - 1, y + 1, z + 1, Blocks.leavesColorized.get().blockID, 2); + buildBlock(world, x + 1, y + 1, z + 1, Blocks.leavesColorized.get().blockID, 2); + buildBlock(world, x - 1, y + 1, z - 1, Blocks.leavesColorized.get().blockID, 2); + buildBlock(world, x, y + 1, z, Blocks.leavesColorized.get().blockID, 2); + + buildBlock(world, x + 2, y + 2, z, Blocks.leavesColorized.get().blockID, 2); + buildBlock(world, x - 2, y + 2, z, Blocks.leavesColorized.get().blockID, 2); + buildBlock(world, x, y + 2, z + 2, Blocks.leavesColorized.get().blockID, 2); + buildBlock(world, x, y + 2, z - 2, Blocks.leavesColorized.get().blockID, 2); + } + + public void buildBlock(World world, int x, int y, int z, int id, int meta) + { + Material m = world.getBlockMaterial(x, y, z); + if(m == Material.air || m == Material.leaves) + { + world.setBlock(x, y, z, id, meta, 2); + } + } } From 096c3a995edcfed7ce7986ad86af7a501a524034 Mon Sep 17 00:00:00 2001 From: Matt Caughey Date: Sun, 29 Sep 2013 07:46:20 -0400 Subject: [PATCH 15/15] Tweaked the Tropics biome --- .../biomesoplenty/biomes/BiomeGenTropics.java | 7 +- .../configuration/BOPBiomes.java | 4 +- .../worldgen/WorldGenTropicsShrub.java | 106 ++++++++++++++++++ 3 files changed, 112 insertions(+), 5 deletions(-) create mode 100644 common/biomesoplenty/worldgen/WorldGenTropicsShrub.java diff --git a/common/biomesoplenty/biomes/BiomeGenTropics.java b/common/biomesoplenty/biomes/BiomeGenTropics.java index 34a8d17c0..8f9cd1421 100644 --- a/common/biomesoplenty/biomes/BiomeGenTropics.java +++ b/common/biomesoplenty/biomes/BiomeGenTropics.java @@ -11,6 +11,7 @@ import net.minecraft.world.gen.feature.WorldGenerator; import biomesoplenty.api.Blocks; import biomesoplenty.configuration.configfile.BOPConfigurationMisc; import biomesoplenty.entities.EntityJungleSpider; +import biomesoplenty.worldgen.WorldGenTropicsShrub; import biomesoplenty.worldgen.tree.WorldGenPalmTree1; import biomesoplenty.worldgen.tree.WorldGenPalmTree3; @@ -24,7 +25,7 @@ public class BiomeGenTropics extends BiomeGenBase super(par1); theBiomeDecorator = new BiomeDecoratorBOP(this); customBiomeDecorator = (BiomeDecoratorBOP)theBiomeDecorator; - customBiomeDecorator.treesPerChunk = 4; + customBiomeDecorator.treesPerChunk = 6; customBiomeDecorator.grassPerChunk = 7; customBiomeDecorator.wheatGrassPerChunk = 4; customBiomeDecorator.flowersPerChunk = 10; @@ -67,7 +68,7 @@ public class BiomeGenTropics extends BiomeGenBase @Override public WorldGenerator getRandomWorldGenForTrees(Random par1Random) { - return par1Random.nextInt(3) == 0 ? new WorldGenPalmTree1() : new WorldGenPalmTree3(); + return par1Random.nextInt(3) == 0 ? new WorldGenPalmTree1() : (par1Random.nextInt(2) == 0 ? new WorldGenTropicsShrub() : new WorldGenPalmTree3()); } /** @@ -77,7 +78,7 @@ public class BiomeGenTropics extends BiomeGenBase public int getSkyColorByTemp(float par1) { if (BOPConfigurationMisc.skyColors) - return 3333631; + return 507391; else { par1 /= 3.0F; diff --git a/common/biomesoplenty/configuration/BOPBiomes.java b/common/biomesoplenty/configuration/BOPBiomes.java index 5775c4f55..56da119ba 100644 --- a/common/biomesoplenty/configuration/BOPBiomes.java +++ b/common/biomesoplenty/configuration/BOPBiomes.java @@ -285,8 +285,8 @@ public class BOPBiomes { Biomes.timberThin = Optional.of((new BiomeGenTimberThin(BOPConfigurationIDs.timberThinID)).setColor(353825).setBiomeName("Thinned Timber").func_76733_a(5159473).setTemperatureRainfall(0.7F, 0.8F).setMinMaxHeight(0.3F, 0.4F)); Biomes.tropicalRainforest = Optional.of((new BiomeGenTropicalRainforest(BOPConfigurationIDs.tropicalRainforestID)).setColor(9286496).setBiomeName("Tropical Rainforest").setTemperatureRainfall(1.2F, 0.9F).setMinMaxHeight(0.3F, 0.7F)); - Biomes.tropics = Optional.of((new BiomeGenTropics(BOPConfigurationIDs.tropicsID)).setColor(9286496).setBiomeName("Tropics").setTemperatureRainfall(2.0F, 2.0F).setMinMaxHeight(0.1F, 0.5F)); - Biomes.tropicsMountain = Optional.of((new BiomeGenTropics(BOPConfigurationIDs.tropicsMountainID)).setColor(9286496).setBiomeName("Tropics Mountain").setTemperatureRainfall(2.0F, 2.0F).setMinMaxHeight(0.5F, 1.1F)); + Biomes.tropics = Optional.of((new BiomeGenTropics(BOPConfigurationIDs.tropicsID)).setColor(9286496).setBiomeName("Tropics").setTemperatureRainfall(2.0F, 2.0F).setMinMaxHeight(0.0F, 0.4F)); + Biomes.tropicsMountain = Optional.of((new BiomeGenTropics(BOPConfigurationIDs.tropicsMountainID)).setColor(9286496).setBiomeName("Tropics Mountain").setTemperatureRainfall(2.0F, 2.0F).setMinMaxHeight(0.4F, 1.2F)); Biomes.tundra = Optional.of((new BiomeGenTundra(BOPConfigurationIDs.tundraID)).setColor(14090235).setBiomeName("Tundra").setTemperatureRainfall(0.2F, 0.8F).setMinMaxHeight(0.1F, 0.3F)); Biomes.volcano = Optional.of((new BiomeGenVolcano(BOPConfigurationIDs.volcanoID)).setColor(9286496).setBiomeName("Volcano").setDisableRain().setMinMaxHeight(0.6F, 0.9F).setTemperatureRainfall(2.0F, 0.05F)); diff --git a/common/biomesoplenty/worldgen/WorldGenTropicsShrub.java b/common/biomesoplenty/worldgen/WorldGenTropicsShrub.java new file mode 100644 index 000000000..7bae5b1f5 --- /dev/null +++ b/common/biomesoplenty/worldgen/WorldGenTropicsShrub.java @@ -0,0 +1,106 @@ +package biomesoplenty.worldgen; + +import java.util.Random; + +import net.minecraft.block.Block; +import net.minecraft.world.World; +import net.minecraft.world.gen.feature.WorldGenerator; + +public class WorldGenTropicsShrub extends WorldGenerator +{ + @Override + public boolean generate(World var1, Random var2, int var3, int var4, int var5) + { + while (var1.isAirBlock(var3, var4, var5) && var4 > 2) + { + --var4; + } + + int var6 = var1.getBlockId(var3, var4, var5); + + if (var6 != Block.grass.blockID && var6 != Block.sand.blockID) + return false; + else + { + for (int var7 = -2; var7 <= 2; ++var7) + { + for (int var8 = -2; var8 <= 2; ++var8) + { + if (var1.isAirBlock(var3 + var7, var4 - 1, var5 + var8) && var1.isAirBlock(var3 + var7, var4 - 2, var5 + var8)) + return false; + } + } + + var1.setBlock(var3, var4, var5, Block.dirt.blockID); + var1.setBlock(var3, var4 + 1, var5, Block.wood.blockID, 3, 2); + var1.setBlock(var3, var4 + 2, var5, Block.wood.blockID, 3, 2); + var1.setBlock(var3 + 1, var4 + 2, var5, Block.leaves.blockID, 3, 2); + var1.setBlock(var3 - 1, var4 + 2, var5, Block.leaves.blockID, 3, 2); + var1.setBlock(var3, var4 + 2, var5 + 1, Block.leaves.blockID, 3, 2); + var1.setBlock(var3, var4 + 2, var5 - 1, Block.leaves.blockID, 3, 2); + var1.setBlock(var3, var4 + 3, var5, Block.leaves.blockID, 3, 2); + + int var999 = var2.nextInt(12); + int var998 = var2.nextInt(4); + + if (var998 == 0) + { + if (var999 == 0) + { + var1.setBlock(var3 - 1, var4 + 1, var5, Block.cocoaPlant.blockID, 11, 2); + } + if (var999 == 1) + { + var1.setBlock(var3 + 1, var4 + 1, var5, Block.cocoaPlant.blockID, 9, 2); + } + if (var999 == 2) + { + var1.setBlock(var3, var4 + 1, var5 - 1, Block.cocoaPlant.blockID, 8, 2); + } + if (var999 == 3) + { + var1.setBlock(var3, var4 + 1, var5 + 1, Block.cocoaPlant.blockID, 10, 2); + } + } + else if (var998 == 1) + { + if (var999 == 0) + { + var1.setBlock(var3 - 1, var4 + 1, var5, Block.cocoaPlant.blockID, 7, 2); + } + if (var999 == 1) + { + var1.setBlock(var3 + 1, var4 + 1, var5, Block.cocoaPlant.blockID, 5, 2); + } + if (var999 == 2) + { + var1.setBlock(var3, var4 + 1, var5 - 1, Block.cocoaPlant.blockID, 4, 2); + } + if (var999 == 3) + { + var1.setBlock(var3, var4 + 1, var5 + 1, Block.cocoaPlant.blockID, 6, 2); + } + } + else if (var998 == 2) + { + if (var999 == 0) + { + var1.setBlock(var3 - 1, var4 + 1, var5, Block.cocoaPlant.blockID, 3, 2); + } + if (var999 == 1) + { + var1.setBlock(var3 + 1, var4 + 1, var5, Block.cocoaPlant.blockID, 1, 2); + } + if (var999 == 2) + { + var1.setBlock(var3, var4 + 1, var5 - 1, Block.cocoaPlant.blockID, 0, 2); + } + if (var999 == 3) + { + var1.setBlock(var3, var4 + 1, var5 + 1, Block.cocoaPlant.blockID, 2, 2); + } + } + return true; + } + } +}