[Bleeding] Check top inventory type when determining whether a click event is a craft event. Fixes BUKKIT-1112

- Credit to Taufiq Hoven for locating the root cause of the issue.
This commit is contained in:
Celtic Minstrel 2012-03-13 20:33:43 -04:00 committed by EvilSeph
parent f7da5d2ad7
commit db5f804482

View File

@ -1147,8 +1147,8 @@ public class NetServerHandler extends NetHandler implements ICommandListener {
SlotType type = CraftInventoryView.getSlotType(inventory, packet102windowclick.slot);
InventoryClickEvent event;
if (inventory instanceof CraftingInventory) {
Recipe recipe = ((CraftingInventory)inventory.getTopInventory()).getRecipe();
if (packet102windowclick.slot == 0 && inventory.getTopInventory() instanceof CraftingInventory) {
Recipe recipe = ((CraftingInventory) inventory.getTopInventory()).getRecipe();
event = new CraftItemEvent(recipe, inventory, type, packet102windowclick.slot, packet102windowclick.button != 0, packet102windowclick.shift);
} else {
event = new InventoryClickEvent(inventory, type, packet102windowclick.slot, packet102windowclick.button != 0, packet102windowclick.shift);