From 88ea700cf947e902436d39535911e40fdb780e9b Mon Sep 17 00:00:00 2001 From: CraftBukkit/Spigot Date: Thu, 10 Oct 2013 17:54:29 -0500 Subject: [PATCH] Force item data to use a tag name. Fixes BUKKIT-4809 The recent Minecraft update rendered the e20e50f85083dc53cb5456254bcf5781ef750daa fix incorrect by adding a compound name to the base tag in some code. This fix changes all uses of tag changes to explicitly use a name. By: feildmaster --- .../org/bukkit/craftbukkit/inventory/CraftItemStack.java | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) 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 c70d41bd63..51d5beb77b 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 @@ -191,10 +191,11 @@ public final class CraftItemStack extends ItemStack { if (item == null) { return false; } - if (item.tag != null) { - return true; + + if (item.tag == null) { + item.setTag(new NBTTagCompound("tag")); } - item.tag = new NBTTagCompound(); + return true; } @@ -350,7 +351,7 @@ public final class CraftItemStack extends ItemStack { return false; } - NBTTagCompound tag = new NBTTagCompound(); + NBTTagCompound tag = new NBTTagCompound("tag"); item.setTag(tag); ((CraftMetaItem) itemMeta).applyToItem(tag);