diff options
author | feildmaster <admin@feildmaster.com> | 2012-12-27 20:45:21 -0600 |
---|---|---|
committer | feildmaster <admin@feildmaster.com> | 2012-12-27 20:45:21 -0600 |
commit | 54b2707ba7ef53f7d7523387d3aeab296152d628 (patch) | |
tree | f191b64b3d4db33993be61898dcf066d5590bef5 /src/main/java/net/minecraft/server/ItemStack.java | |
parent | 25732f0487570d17615c42560d36e85b9100518e (diff) | |
download | craftbukkit-54b2707ba7ef53f7d7523387d3aeab296152d628.tar craftbukkit-54b2707ba7ef53f7d7523387d3aeab296152d628.tar.gz craftbukkit-54b2707ba7ef53f7d7523387d3aeab296152d628.tar.lz craftbukkit-54b2707ba7ef53f7d7523387d3aeab296152d628.tar.xz craftbukkit-54b2707ba7ef53f7d7523387d3aeab296152d628.zip |
Fix discrepancies in NBT and ItemMeta. Fixes BUKKIT-3279
An ItemStack gains the tag name "tag" when the stack is serialized
to NBT, however items don't have a tag *until* they are serialized at
least once. So to solve this, we remove the tag name when loading the
NBT data.
Another problem with NBT are TagLists, when transferring tag lists
between the server and the client the names are lost, and so we
simply don't add a name to the tag.
Diffstat (limited to 'src/main/java/net/minecraft/server/ItemStack.java')
-rw-r--r-- | src/main/java/net/minecraft/server/ItemStack.java | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/src/main/java/net/minecraft/server/ItemStack.java b/src/main/java/net/minecraft/server/ItemStack.java index a09d8d89..453ca4ac 100644 --- a/src/main/java/net/minecraft/server/ItemStack.java +++ b/src/main/java/net/minecraft/server/ItemStack.java @@ -106,7 +106,8 @@ public final class ItemStack { this.count = nbttagcompound.getByte("Count"); this.damage = nbttagcompound.getShort("Damage"); if (nbttagcompound.hasKey("tag")) { - this.tag = nbttagcompound.getCompound("tag"); + // CraftBukkit - clear name from compound + this.tag = (NBTTagCompound) nbttagcompound.getCompound("tag").setName(""); } } |