if(!world.isRemote) {
Block block = world.getBlock(x, y, z);
if(block instanceof IPneumaticWrenchable && (((ItemPneumaticWrench)Itemss.pneumaticWrench).getPressure(stack) > 0 || !Config.rotateUseEnergy)) {
if(((IPneumaticWrenchable)block).rotateBlock(world, player, x, y, z, ForgeDirection.getOrientation(side))) {
if(!player.capabilities.isCreativeMode && Config.rotateUseEnergy) ((ItemPneumaticWrench)Itemss.pneumaticWrench).addAir(stack, -PneumaticValues.USAGE_PNEUMATIC_WRENCH);
NetworkHandler.sendToAllAround(new PacketPlaySound(Sounds.PNEUMATIC_WRENCH, x, y, z, 1.0F, 1.0F, false), world);
return true;
}
} else if(block != null) {
//rotating normal blocks doesn't cost energy.
if(block.rotateBlock(world, x, y, z, ForgeDirection.getOrientation(side))) {
NetworkHandler.sendToAllAround(new PacketPlaySound(Sounds.PNEUMATIC_WRENCH, x, y, z, 1.0F, 1.0F, false), world);
return true;
}
}
return false;
} else {