Fix bin crash when interacting with empty hand.

This commit is contained in:
Yip Rui Fung 2015-07-25 08:59:25 +08:00
parent 28165fecdf
commit 766f0d5302

View file

@ -469,10 +469,9 @@ public class BlockBasic extends Block implements IBlockCTM, ICustomBlockIcon
{ {
TileEntityBin bin = (TileEntityBin)world.getTileEntity(x, y, z); TileEntityBin bin = (TileEntityBin)world.getTileEntity(x, y, z);
Item tool = entityplayer.getCurrentEquippedItem().getItem(); if(entityplayer.getCurrentEquippedItem() != null && MekanismUtils.hasUsableWrench(entityplayer, x, y, z))
if(MekanismUtils.hasUsableWrench(entityplayer, x, y, z))
{ {
Item tool = entityplayer.getCurrentEquippedItem().getItem();
if(entityplayer.isSneaking()) if(entityplayer.isSneaking())
{ {
dismantleBlock(world, x, y, z, false); dismantleBlock(world, x, y, z, false);