From 7bea89c24fd3b72ccc893574b54a028b702849bc Mon Sep 17 00:00:00 2001 From: Adubbz Date: Sat, 6 Apr 2013 23:01:50 +1100 Subject: [PATCH] Fixed bonemeal and holy grass dependancies on Holy and Magic saplings --- .../tdwp_ftw/biomesop/helpers/BonemealUse.java | 16 +++++++++++++++- .../biomesop/worldgen/WorldGenMystic1.java | 4 +++- .../biomesop/worldgen/WorldGenMystic2.java | 2 +- 3 files changed, 19 insertions(+), 3 deletions(-) diff --git a/src/minecraft/tdwp_ftw/biomesop/helpers/BonemealUse.java b/src/minecraft/tdwp_ftw/biomesop/helpers/BonemealUse.java index d8a05b207..b85f93f0f 100644 --- a/src/minecraft/tdwp_ftw/biomesop/helpers/BonemealUse.java +++ b/src/minecraft/tdwp_ftw/biomesop/helpers/BonemealUse.java @@ -2,6 +2,7 @@ package tdwp_ftw.biomesop.helpers; import tdwp_ftw.biomesop.mod_BiomesOPlenty; import tdwp_ftw.biomesop.blocks.BlockFirSapling; +import tdwp_ftw.biomesop.blocks.BlockHolySapling; import tdwp_ftw.biomesop.blocks.BlockRedwoodSapling; import tdwp_ftw.biomesop.blocks.BlockPalmSapling; import tdwp_ftw.biomesop.blocks.BlockRedSapling; @@ -200,13 +201,26 @@ public class BonemealUse } } + if (event.ID == BOPBlocks.holySapling.blockID) + { + event.setResult(Result.ALLOW); + + if (!event.world.isRemote) + { + if ((double)event.world.rand.nextFloat() < 0.15D) + { + ((BlockHolySapling)BOPBlocks.holySapling).growTree(event.world, event.X, event.Y, event.Z, event.world.rand); + } + } + } + if (event.ID == BOPBlocks.magicSapling.blockID) { event.setResult(Result.ALLOW); if (!event.world.isRemote) { - if ((double)event.world.rand.nextFloat() < 0.45D) + if ((double)event.world.rand.nextFloat() < 0.10D) { ((BlockMagicSapling)BOPBlocks.magicSapling).growTree(event.world, event.X, event.Y, event.Z, event.world.rand); } diff --git a/src/minecraft/tdwp_ftw/biomesop/worldgen/WorldGenMystic1.java b/src/minecraft/tdwp_ftw/biomesop/worldgen/WorldGenMystic1.java index dc3b356c0..1f3e23649 100644 --- a/src/minecraft/tdwp_ftw/biomesop/worldgen/WorldGenMystic1.java +++ b/src/minecraft/tdwp_ftw/biomesop/worldgen/WorldGenMystic1.java @@ -2,6 +2,8 @@ package tdwp_ftw.biomesop.worldgen; import java.util.Random; +import tdwp_ftw.biomesop.declarations.BOPBlocks; + import net.minecraft.block.Block; import net.minecraft.world.World; import net.minecraft.world.gen.feature.WorldGenerator; @@ -70,7 +72,7 @@ public class WorldGenMystic1 extends WorldGenerator { var11 = par1World.getBlockId(par3, par4 - 1, par5); - if ((var11 == Block.grass.blockID || var11 == Block.dirt.blockID) && par4 < 256 - var6 - 1) + if ((var11 == BOPBlocks.holyGrass.blockID) && par4 < 256 - var6 - 1) { this.setBlock(par1World, par3, par4 - 1, par5, Block.dirt.blockID); var21 = par2Random.nextInt(2); diff --git a/src/minecraft/tdwp_ftw/biomesop/worldgen/WorldGenMystic2.java b/src/minecraft/tdwp_ftw/biomesop/worldgen/WorldGenMystic2.java index 506ba7ae7..d290e2ccc 100644 --- a/src/minecraft/tdwp_ftw/biomesop/worldgen/WorldGenMystic2.java +++ b/src/minecraft/tdwp_ftw/biomesop/worldgen/WorldGenMystic2.java @@ -71,7 +71,7 @@ public class WorldGenMystic2 extends WorldGenerator { var11 = var1.getBlockId(var3, var4 - 1, var5); - if ((var11 == Block.grass.blockID || var11 == Block.dirt.blockID) && var4 < 256 - var6 - 1) + if ((var11 == BOPBlocks.holyGrass.blockID) && var4 < 256 - var6 - 1) { var1.setBlock(var3, var4 - 1, var5, Block.dirt.blockID); var21 = var2.nextInt(2);