Added itemstack null check on canReplace
Added null check for itemstack to prevent crashing when getting metadata from null itemstack. In response of simeonradivoev/MatterOverdrive#150
This commit is contained in:
parent
800587ac35
commit
326e93b85d
1 changed files with 2 additions and 2 deletions
|
@ -35,8 +35,8 @@ public abstract class BOPBlockWorldDecor extends BlockBush
|
|||
public boolean canReplace(World world, int x, int y, int z, int side, ItemStack itemStack)
|
||||
{
|
||||
if (world.getBlock(x, y - 1, z) == Blocks.air) return false;
|
||||
|
||||
return isValidPosition(world, x, y, z, itemStack.getItemDamage());
|
||||
|
||||
return isValidPosition(world, x, y, z, itemStack != null ? itemStack.getItemDamage() : 0);
|
||||
}
|
||||
|
||||
public void dropIfCantStay(World world, int x, int y, int z, ItemStack stack)
|
||||
|
|
Loading…
Reference in a new issue