Update BlockBOPPlant.java

Fixed null itemStack causing crash. Fixes #529 and #519
This commit is contained in:
wwrpg 2015-09-02 21:18:47 -07:00
parent 0a502a54f1
commit a953962f6b

View file

@ -183,7 +183,7 @@ public class BlockBOPPlant extends BOPBlockWorldDecor implements IShearable
@Override @Override
public boolean canReplace(World world, int x, int y, int z, int side, ItemStack itemStack) public boolean canReplace(World world, int x, int y, int z, int side, ItemStack itemStack)
{ {
int metadata = itemStack.getItemDamage(); int metadata = itemStack != null ? itemStack.getItemDamage() : 0;
if (metadata == 5 || metadata == 13 || metadata == 15) if (metadata == 5 || metadata == 13 || metadata == 15)
return this.isValidPosition(world, x, y, z, metadata); return this.isValidPosition(world, x, y, z, metadata);