Update BlockBOPPlant.java
Fixed null itemStack causing crash. Fixes #529 and #519
This commit is contained in:
parent
0a502a54f1
commit
a953962f6b
|
@ -183,7 +183,7 @@ public class BlockBOPPlant extends BOPBlockWorldDecor implements IShearable
|
|||
@Override
|
||||
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)
|
||||
return this.isValidPosition(world, x, y, z, metadata);
|
||||
|
|
Loading…
Reference in New Issue