mirror of
https://github.com/PaperMC/Paper.git
synced 2026-11-25 10:29:41 -05:00
[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:
1 parent
f7da5d2ad7
commit
db5f804482
1 file changed
+2
-2
@@ -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);
|
||||
|
||||
Reference in new issue
Block a user