@Override public boolean onUseWrench( World world, BlockPos pos, EntityPlayer entityPlayer, EnumFacing side, float hitX, float hitY, float hitZ) { int metadata = getMetaFromState(world.getBlockState(pos)); int change = world.getBlockState(pos).getValue(FACING).rotateY().getHorizontalIndex(); world.setBlockState(pos, this.getStateFromMeta(metadata - (metadata % 4) + change), 3); TileEntity te = world.getTileEntity(pos); if (te instanceof TileBaseUniversalElectrical) { ((TileBaseUniversalElectrical) te).updateFacing(); } return true; }
@Override public boolean onUseWrench( World par1World, int x, int y, int z, EntityPlayer par5EntityPlayer, int side, float hitX, float hitY, float hitZ) { int change = 0; // Re-orient the block switch (par1World.getBlockMetadata(x, y, z)) { case 0: change = 3; break; case 3: change = 1; break; case 1: change = 2; break; case 2: change = 0; break; } TileEntity te = par1World.getTileEntity(x, y, z); if (te instanceof TileBaseUniversalElectrical) { ((TileBaseUniversalElectrical) te).updateFacing(); } par1World.setBlockMetadataWithNotify(x, y, z, change, 3); return true; }