if(world.isRemote)
{
return true;
}
TileEntityElectricBlock tileEntity = (TileEntityElectricBlock)world.getTileEntity(x, y, z);
int metadata = world.getBlockMetadata(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[ForgeDirection.UP.ordinal()][tileEntity.facing];
tileEntity.setFacing((short)change);
world.notifyBlocksOfNeighborChange(x, y, z, this);
return true;
}
}