diff options
author | feildmaster <admin@feildmaster.com> | 2013-10-10 17:54:29 -0500 |
---|---|---|
committer | feildmaster <admin@feildmaster.com> | 2013-10-12 03:18:45 -0500 |
commit | f4277d7105c1b4b03b494084b2ad9519056003d4 (patch) | |
tree | 8020651beb9618a754c52b6afb124c09b028477b /src/main/java/org | |
parent | 159403e08529744ba305f3a1c87f4acf2f3a9e0d (diff) | |
download | craftbukkit-f4277d7105c1b4b03b494084b2ad9519056003d4.tar craftbukkit-f4277d7105c1b4b03b494084b2ad9519056003d4.tar.gz craftbukkit-f4277d7105c1b4b03b494084b2ad9519056003d4.tar.lz craftbukkit-f4277d7105c1b4b03b494084b2ad9519056003d4.tar.xz craftbukkit-f4277d7105c1b4b03b494084b2ad9519056003d4.zip |
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.
Diffstat (limited to 'src/main/java/org')
-rw-r--r-- | src/main/java/org/bukkit/craftbukkit/inventory/CraftItemStack.java | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/src/main/java/org/bukkit/craftbukkit/inventory/CraftItemStack.java b/src/main/java/org/bukkit/craftbukkit/inventory/CraftItemStack.java index c70d41bd..51d5beb7 100644 --- a/src/main/java/org/bukkit/craftbukkit/inventory/CraftItemStack.java +++ b/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); |