From 22564a917750bb36aefbbffee6b07b3bc2b67e69 Mon Sep 17 00:00:00 2001 From: md_5 Date: Sun, 3 Dec 2017 08:55:19 +1100 Subject: [PATCH] SPIGOT-3674: Take into account max stack size for PlayerDropItemEvent --- nms-patches/EntityHuman.patch | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/nms-patches/EntityHuman.patch b/nms-patches/EntityHuman.patch index 3542492d03..42eff8f35a 100644 --- a/nms-patches/EntityHuman.patch +++ b/nms-patches/EntityHuman.patch @@ -94,7 +94,7 @@ + if (flag1 && (cur == null || cur.getAmount() == 0)) { + // The complete stack was dropped + player.getInventory().setItemInHand(drop.getItemStack()); -+ } else if (flag1 && cur.isSimilar(drop.getItemStack()) && drop.getItemStack().getAmount() == 1) { ++ } else if (flag1 && cur.isSimilar(drop.getItemStack()) && cur.getAmount() < cur.getMaxStackSize() && drop.getItemStack().getAmount() == 1) { + // Only one item is dropped + cur.setAmount(cur.getAmount() + 1); + player.getInventory().setItemInHand(cur);