From 5715b3a6d98848d39c1e6bc6b0be6ba0ef8e2b76 Mon Sep 17 00:00:00 2001 From: md_5 Date: Mon, 2 Jan 2017 10:04:19 +1100 Subject: [PATCH] SPIGOT-2977: Pass setAmount(0) through to wrapped ItemStack. This class needs to be rewritten with more consistent semantics and alignment with Minecraft losing null, but that is probably a job for 1.12 --- .../java/org/bukkit/craftbukkit/inventory/CraftItemStack.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/main/java/org/bukkit/craftbukkit/inventory/CraftItemStack.java b/src/main/java/org/bukkit/craftbukkit/inventory/CraftItemStack.java index 8ed4b4bd3a..f12b67be43 100644 --- a/src/main/java/org/bukkit/craftbukkit/inventory/CraftItemStack.java +++ b/src/main/java/org/bukkit/craftbukkit/inventory/CraftItemStack.java @@ -147,10 +147,10 @@ public final class CraftItemStack extends ItemStack { if (handle == null) { return; } + + handle.setCount(amount); if (amount == 0) { handle = null; - } else { - handle.setCount(amount); } }