From c4a67eed9964aebb7add1686b044277cad42dbd4 Mon Sep 17 00:00:00 2001 From: md_5 Date: Mon, 31 Dec 2018 10:13:02 +1100 Subject: [PATCH] SPIGOT-4556: Fix plugins closing inventory during drop events --- nms-patches/Container.patch | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) diff --git a/nms-patches/Container.patch b/nms-patches/Container.patch index ae9b1e78c9..71abe39460 100644 --- a/nms-patches/Container.patch +++ b/nms-patches/Container.patch @@ -126,7 +126,20 @@ } } } else if (inventoryclicktype == InventoryClickType.SWAP && j >= 0 && j < 9) { -@@ -565,6 +637,7 @@ +@@ -356,8 +428,11 @@ + PlayerInventory playerinventory = entityhuman.inventory; + + if (!playerinventory.getCarried().isEmpty()) { +- entityhuman.drop(playerinventory.getCarried(), false); ++ // CraftBukkit start - SPIGOT-4556 ++ ItemStack carried = playerinventory.getCarried(); + playerinventory.setCarried(ItemStack.a); ++ entityhuman.drop(carried, false); ++ // CraftBukkit end + } + + } +@@ -565,6 +640,7 @@ if (inventorycraftresult.a(world, entityplayer, irecipe) && irecipe != null) { itemstack = irecipe.craftItem(iinventory); }