Bukkit/CraftBukkit — pull request #1074 by TriPhoenix (2013-03-20 18:41:49+00:00)
Title: [B+C] Add InventoryMoveItemEvent. Adds BUKKIT-3765

**The Issue:**
Currently there is no event to monitor or cancel hoppers moving items between inventories.

**Justification for this PR:**
This PR implements an InventoryMoveEvent for hoppers and hopper minecarts, that can be used to track automatic movements between inventories. This applies to hoppers but may as well be used for droppers when they have a fully functional Inventory interface.

**PR Breakdown:**
The PR hooks into two methods in the NMS class TileEntityHopper. One method handles hoppers retrieving items, the other handles putting items into other containers. There is some safety logic involved as some containers currently do not support the InventoryHolder/Inventory interface (e.h. Droppers). The call to the c()-method on cancellation is somewhat required as to avoid quick repeated event firing by the hopper. This way the hopper maintains its 8-tick check interval.

**Testing Results and Materials:**
A simple test plugin can be found at https://gist.github.com/TriPhoenix/5207263 It simply catches and displayes the events and cancels all events that try to move dirt.

**Relevant PR(s):**
B-808 - https://github.com/Bukkit/Bukkit/pull/808 - accompanying implementation for hoppers and hopper minecarts

**JIRA Ticket:**
BUKKIT-3765 - https://bukkit.atlassian.net/browse/BUKKIT-3765