if (block.removedByPlayer(world, player, x, y, z, false))
block.onBlockDestroyedByPlayer(world, x, y, z, meta);
// send update to client
if (!world.isRemote) {
((EntityPlayerMP)player).playerNetServerHandler.sendPacket(new S23PacketBlockChange(x, y, z, world));
}
return;
}
// callback to the tool the player uses. Called on both sides. This damages the tool n stuff.
player.getCurrentEquippedItem().func_150999_a(world, block, x, y, z, player);
// server sided handling
if (!world.isRemote) {
// serverside we reproduce ItemInWorldManager.tryHarvestBlock
// ItemInWorldManager.removeBlock
block.onBlockHarvested(world, x,y,z, meta, player);
if(block.removedByPlayer(world, player, x,y,z, true)) // boolean is if block can be harvested, checked above
{
block.onBlockDestroyedByPlayer( world, x,y,z, meta);
block.harvestBlock(world, player, x,y,z, meta);
}
// always send block update to client
EntityPlayerMP mpPlayer = (EntityPlayerMP) player;
mpPlayer.playerNetServerHandler.sendPacket(new S23PacketBlockChange(x, y, z, world));
}
// client sided handling
else {
PlayerControllerMP pcmp = Minecraft.getMinecraft().playerController;
// clientside we do a "this clock has been clicked on long enough to be broken" call. This should not send any new packets