Block block = user.worldObj.getBlock(x, y, z);
if (user.isSneaking() && block instanceof IDismantleable && user instanceof EntityPlayer) {
EntityPlayer player = (EntityPlayer) user;
IDismantleable machine = (IDismantleable) block;
if (machine.canDismantle(player, player.worldObj, x, y, z) && !player.worldObj.isRemote) {
machine.dismantleBlock(player, player.worldObj, x, y, z, false);
}
}
}
/* IResourceTooltipProvider */