From db5f80448243809986a4f06eb611d87dd7f7fc55 Mon Sep 17 00:00:00 2001 From: Celtic Minstrel Date: Tue, 13 Mar 2012 20:33:43 -0400 Subject: [PATCH] [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. --- src/main/java/net/minecraft/server/NetServerHandler.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/main/java/net/minecraft/server/NetServerHandler.java b/src/main/java/net/minecraft/server/NetServerHandler.java index 18293eb7c3..58724a31cc 100644 --- a/src/main/java/net/minecraft/server/NetServerHandler.java +++ b/src/main/java/net/minecraft/server/NetServerHandler.java @@ -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);