From 22564a917750bb36aefbbffee6b07b3bc2b67e69 Mon Sep 17 00:00:00 2001 From: md_5 Date: Sun, 3 Dec 2017 08:55:19 +1100 Subject: SPIGOT-3674: Take into account max stack size for PlayerDropItemEvent --- nms-patches/EntityHuman.patch | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'nms-patches/EntityHuman.patch') diff --git a/nms-patches/EntityHuman.patch b/nms-patches/EntityHuman.patch index 3542492d..42eff8f3 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); -- cgit v1.2.3