Fixed potential loop with breaking reeds

This commit is contained in:
Adubbz 2013-09-10 19:26:43 +10:00
parent 55f5d983bc
commit 4469ae02ad
1 changed files with 3 additions and 1 deletions

View File

@ -193,14 +193,16 @@ public class BlockBOPPlant extends BlockFlower implements IShearable
@Override
public boolean canBlockStay(World world, int x, int y, int z)
{
int id = world.getBlockId(x, y, z);
int meta = world.getBlockMetadata(x, y, z);
Block block = Block.blocksList[id];
if (world.getBlockId(x, y, z) != blockID)
{
if (meta == 5)
return this.canThisPlantGrowOnThisBlockID(world.getBlockId(x, y - 1, z));
else if (meta == 8)
return this.canPlaceBlockAt(world, x, y, z);
return block == null || block.isBlockReplaceable(world, x, y, z);
else
return (world.getFullBlockLightValue(x, y, z) >= 8 || world.canBlockSeeTheSky(x, y, z)) && this.canThisPlantGrowOnThisBlockID(world.getBlockId(x, y - 1, z));
}