summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authormd_5 <git@md-5.net>2017-12-03 08:55:19 +1100
committermd_5 <git@md-5.net>2017-12-03 08:55:19 +1100
commit22564a917750bb36aefbbffee6b07b3bc2b67e69 (patch)
tree1796465ee65a379cdd9425261aa6a139fc1719d7
parent809c399a62f65a3277f70ce3d43c30aac5045434 (diff)
downloadcraftbukkit-22564a917750bb36aefbbffee6b07b3bc2b67e69.tar
craftbukkit-22564a917750bb36aefbbffee6b07b3bc2b67e69.tar.gz
craftbukkit-22564a917750bb36aefbbffee6b07b3bc2b67e69.tar.lz
craftbukkit-22564a917750bb36aefbbffee6b07b3bc2b67e69.tar.xz
craftbukkit-22564a917750bb36aefbbffee6b07b3bc2b67e69.zip
SPIGOT-3674: Take into account max stack size for PlayerDropItemEvent
-rw-r--r--nms-patches/EntityHuman.patch2
1 files changed, 1 insertions, 1 deletions
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);