From 47c7562765bb2c02984275de885659629b5b25de Mon Sep 17 00:00:00 2001 From: CraftBukkit/Spigot Date: Sat, 12 Jun 2021 20:19:41 +1000 Subject: [PATCH] Restore 1.16.5 behaviour of InventoryDragEvent being called even when a single item is 'dragged' to its own slot Ideally this would now be an InventoryClickEvent instead, but that is not so easy with the current structure. See https://www.spigotmc.org/threads/510208/page-9#post-4185501 for further info. By: md_5 --- .../net/minecraft/world/inventory/Container.patch | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/paper-server/nms-patches/net/minecraft/world/inventory/Container.patch b/paper-server/nms-patches/net/minecraft/world/inventory/Container.patch index 23abb214e2..49454f40d7 100644 --- a/paper-server/nms-patches/net/minecraft/world/inventory/Container.patch +++ b/paper-server/nms-patches/net/minecraft/world/inventory/Container.patch @@ -74,6 +74,15 @@ public void b(ICrafting icrafting) { this.containerListeners.remove(icrafting); } +@@ -338,7 +382,7 @@ + } + } else if (this.quickcraftStatus == 2) { + if (!this.quickcraftSlots.isEmpty()) { +- if (this.quickcraftSlots.size() == 1) { ++ if (false && this.quickcraftSlots.size() == 1) { // CraftBukkit - treat everything as a drag since we are unable to easily call InventoryClickEvent instead + k = ((Slot) this.quickcraftSlots.iterator().next()).index; + this.e(); + this.b(k, this.quickcraftType, InventoryClickType.PICKUP, entityhuman); @@ -349,6 +393,7 @@ l = this.getCarried().getCount(); Iterator iterator = this.quickcraftSlots.iterator();