Bukkit/CraftBukkit — pull request #807 by h31ix (2012-06-29 02:52:22+00:00)
Title: Fix canceling PlayerInteract with cake. Fixes BUKKIT-1863.

When plugins cancel PlayerInteractEvent and the player has interacted with cake, the following things will occur:

If the player has right-clicked on the cake, the event is cancelled properly, but the player's health still updates client-side, reflecting that they have consumed the cake. Upon relogging into the server, their health will decrease back to it's proper amount.

If the player has left-clicked the cake, they will see that the cake has been eaten, and their health will update incorrectly until they log back in, at which point they will see the cake has returned to it's un-eaten state and their health level has corrected itself.

This PR fixes both of those issues by properly notifying the client of the cancelled event, both with health and with the actual size of the cake block changing.