Bukkit/Bukkit — pull request #747 by psycowithespn (2012-12-27 22:15:47+00:00)
Title: Update to new BlockItemSwitch packet standards, Fixes BUKKIT-3318

This pull adds in player.getInventory().setHeldItemSlot(int) which allows plugins to change the active item slot. The int needs to be validated otherwise the player can not interact using an item in their hand (ex. Flint and Steel) and no PlayerItemHeldEvents are sent.

It also allows PlayerItemHeldEvent to implement Cancellable, sending a BlockItemSwitch packet to the client of the old index.

Corresponding craftbukkit pull: