Gave apple leaves the use animation on being "picked"

This commit is contained in:
Adubbz 2013-05-18 08:44:28 +10:00
parent d661bb4b8c
commit 5cc2ed58a8

View file

@ -225,16 +225,15 @@ public class BlockBOPAppleLeaves extends BlockLeavesBase implements IShearable
@Override @Override
public boolean onBlockActivated (World world, int x, int y, int z, EntityPlayer player, int par6, float par7, float par8, float par9) public boolean onBlockActivated (World world, int x, int y, int z, EntityPlayer player, int par6, float par7, float par8, float par9)
{ {
if (world.isRemote)
return false;
int meta = world.getBlockMetadata(x, y, z); int meta = world.getBlockMetadata(x, y, z);
if ((meta & 3) == 3) if ((meta & 3) == 3)
{ {
world.setBlock(x, y, z, blockID, meta - 3, 3); world.setBlock(x, y, z, blockID, meta - 3, 3);
EntityItem entityitem = new EntityItem(world, player.posX, player.posY - 1.0D, player.posZ, new ItemStack(Item.appleRed, 1, 0)); EntityItem entityitem = new EntityItem(world, player.posX, player.posY - 1.0D, player.posZ, new ItemStack(Item.appleRed, 1, 0));
if (!world.isRemote) {
world.spawnEntityInWorld(entityitem); world.spawnEntityInWorld(entityitem);
entityitem.onCollideWithPlayer(player); entityitem.onCollideWithPlayer(player);
}
return true; return true;
} }
else else