if(world.isRemote)
{
return true;
}
TileEntityEnergyCube tileEntity = (TileEntityEnergyCube)world.getTileEntity(x, y, z);
if(entityplayer.getCurrentEquippedItem() != null)
{
Item tool = entityplayer.getCurrentEquippedItem().getItem();
if(MekanismUtils.hasUsableWrench(entityplayer, x, y, z))
{
if(entityplayer.isSneaking())
{
dismantleBlock(world, x, y, z, false);
return true;
}
if(ModAPIManager.INSTANCE.hasAPI("BuildCraftAPI|tools") && tool instanceof IToolWrench)
((IToolWrench)tool).wrenchUsed(entityplayer, x, y, z);
int change = ForgeDirection.ROTATION_MATRIX[side][tileEntity.facing];
tileEntity.setFacing((short)change);
world.notifyBlocksOfNeighborChange(x, y, z, this);
return true;
}
}