Fixed bonemeal and holy grass dependancies on Holy and Magic saplings

This commit is contained in:
Adubbz 2013-04-06 23:01:50 +11:00
parent 8c1984c967
commit 7bea89c24f
3 changed files with 19 additions and 3 deletions

View file

@ -2,6 +2,7 @@ package tdwp_ftw.biomesop.helpers;
import tdwp_ftw.biomesop.mod_BiomesOPlenty; import tdwp_ftw.biomesop.mod_BiomesOPlenty;
import tdwp_ftw.biomesop.blocks.BlockFirSapling; import tdwp_ftw.biomesop.blocks.BlockFirSapling;
import tdwp_ftw.biomesop.blocks.BlockHolySapling;
import tdwp_ftw.biomesop.blocks.BlockRedwoodSapling; import tdwp_ftw.biomesop.blocks.BlockRedwoodSapling;
import tdwp_ftw.biomesop.blocks.BlockPalmSapling; import tdwp_ftw.biomesop.blocks.BlockPalmSapling;
import tdwp_ftw.biomesop.blocks.BlockRedSapling; 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) if (event.ID == BOPBlocks.magicSapling.blockID)
{ {
event.setResult(Result.ALLOW); event.setResult(Result.ALLOW);
if (!event.world.isRemote) 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); ((BlockMagicSapling)BOPBlocks.magicSapling).growTree(event.world, event.X, event.Y, event.Z, event.world.rand);
} }

View file

@ -2,6 +2,8 @@ package tdwp_ftw.biomesop.worldgen;
import java.util.Random; import java.util.Random;
import tdwp_ftw.biomesop.declarations.BOPBlocks;
import net.minecraft.block.Block; import net.minecraft.block.Block;
import net.minecraft.world.World; import net.minecraft.world.World;
import net.minecraft.world.gen.feature.WorldGenerator; import net.minecraft.world.gen.feature.WorldGenerator;
@ -70,7 +72,7 @@ public class WorldGenMystic1 extends WorldGenerator
{ {
var11 = par1World.getBlockId(par3, par4 - 1, par5); 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); this.setBlock(par1World, par3, par4 - 1, par5, Block.dirt.blockID);
var21 = par2Random.nextInt(2); var21 = par2Random.nextInt(2);

View file

@ -71,7 +71,7 @@ public class WorldGenMystic2 extends WorldGenerator
{ {
var11 = var1.getBlockId(var3, var4 - 1, var5); 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); var1.setBlock(var3, var4 - 1, var5, Block.dirt.blockID);
var21 = var2.nextInt(2); var21 = var2.nextInt(2);