MinecraftForge/MinecraftForge — pull request #1121 by copygirl (2014-06-04 02:28:36+00:00)
Title: Fire PlayerInteractEvent on client + more changes

This pull request makes PlayerInteractEvent more consistent and useful, mostly making the event available on the client. The following changes are included:

- PlayerInteractEvent fires on the client.
- Cancelling the event on the client will prevent packets from being sent to the server.
- Setting useItem to DENY on the client will make blocks appear unbreakable.
- Setting useItem to ALLOW will allow blocks to be broken even in adventure mode.
- Right clicking air without an item will send a packet to the server, causing a right click air event.
- Left click block will fire regardless of game mode, as long as the block isn't broken instantly.

And as a little added bonus:

- Added "documentation" to PlayerInteractEvent.
- Fires PlayerDestroyItemEvent on client too when item is used up in onItemUseFirst.
- Current item is not wrongly set to null on client if the passed item has a stack size of 0, even though the current item was set to a new stack.