From ab5c87e570d380c1015a597e1ed00c3e14189235 Mon Sep 17 00:00:00 2001 From: Hugo Manrique Date: Thu, 19 Jul 2018 17:51:55 +0200 Subject: [PATCH] Avoid item merge if stack size above max stack size (#1217) --- LICENSE.md | 1 + ...e-if-stack-size-above-max-stack-size.patch | 25 +++++++++++++++++++ 2 files changed, 26 insertions(+) create mode 100644 Spigot-Server-Patches/0330-Avoid-item-merge-if-stack-size-above-max-stack-size.patch diff --git a/LICENSE.md b/LICENSE.md index 8e01d0ba9..7d4663268 100644 --- a/LICENSE.md +++ b/LICENSE.md @@ -33,4 +33,5 @@ MiniDigger Brokkonaut vemacs stonar96 +Hugo Manrique ``` diff --git a/Spigot-Server-Patches/0330-Avoid-item-merge-if-stack-size-above-max-stack-size.patch b/Spigot-Server-Patches/0330-Avoid-item-merge-if-stack-size-above-max-stack-size.patch new file mode 100644 index 000000000..2d779e5e4 --- /dev/null +++ b/Spigot-Server-Patches/0330-Avoid-item-merge-if-stack-size-above-max-stack-size.patch @@ -0,0 +1,25 @@ +From 311e9503ab54d720ccf3304c144ea85fb9e4ca93 Mon Sep 17 00:00:00 2001 +From: Hugo Manrique +Date: Mon, 16 Jul 2018 12:42:20 +0200 +Subject: [PATCH] Avoid item merge if stack size above max stack size + + +diff --git a/src/main/java/net/minecraft/server/EntityItem.java b/src/main/java/net/minecraft/server/EntityItem.java +index 0b7fc327..099bc755 100644 +--- a/src/main/java/net/minecraft/server/EntityItem.java ++++ b/src/main/java/net/minecraft/server/EntityItem.java +@@ -177,6 +177,11 @@ public class EntityItem extends Entity implements HopperPusher { + // Spigot end + + private void x() { ++ // Paper start - avoid item merge if stack size above max stack size ++ ItemStack stack = getItemStack(); ++ if (stack.getCount() >= stack.getMaxStackSize()) return; ++ // Paper end ++ + // Spigot start + double radius = world.spigotConfig.itemMerge; + Iterator iterator = this.world.a(EntityItem.class, this.getBoundingBox().grow(radius, radius, radius)).iterator(); +-- +2.18.0.windows.1 +