From d04ca26007663376ce7972e132d67997d160313b Mon Sep 17 00:00:00 2001 From: CraftBukkit/Spigot Date: Thu, 23 Jan 2014 23:02:40 -0600 Subject: [PATCH] Fix stacking for items after setting empty meta. Fixes BUKKIT-5331 ItemStacks do not stack if one has null for a tag, while the other has an empty tag. In CraftItemStack, if you set an item to an empty ItemMeta, it will create an empty tag for the internal ItemStack. This changes the setItemMeta function to check for empty meta, and then use null for the tag instead of an empty NBTTagCompound. By: Wesley Wolfe --- .../java/org/bukkit/craftbukkit/inventory/CraftItemStack.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/paper-server/src/main/java/org/bukkit/craftbukkit/inventory/CraftItemStack.java b/paper-server/src/main/java/org/bukkit/craftbukkit/inventory/CraftItemStack.java index 04ae4ec8b..704be690c 100644 --- a/paper-server/src/main/java/org/bukkit/craftbukkit/inventory/CraftItemStack.java +++ b/paper-server/src/main/java/org/bukkit/craftbukkit/inventory/CraftItemStack.java @@ -360,7 +360,7 @@ public final class CraftItemStack extends ItemStack { if (item == null) { return false; } - if (itemMeta == null) { + if (CraftItemFactory.instance().equals(itemMeta, null)) { item.tag = null; return true; }