diff options
author | Thinkofdeath <thinkofdeath@spigotmc.org> | 2014-12-07 10:48:14 +0000 |
---|---|---|
committer | Thinkofdeath <thinkofdeath@spigotmc.org> | 2014-12-07 10:48:14 +0000 |
commit | 1227934d578a6866a21c000743a00b4f0f8a6850 (patch) | |
tree | c77a1dc72423027296fd2937a8c3198c629a1643 /src/main/java | |
parent | fbda3a7c991e50b65f6d5a8b923897d91adade8d (diff) | |
download | craftbukkit-1227934d578a6866a21c000743a00b4f0f8a6850.tar craftbukkit-1227934d578a6866a21c000743a00b4f0f8a6850.tar.gz craftbukkit-1227934d578a6866a21c000743a00b4f0f8a6850.tar.lz craftbukkit-1227934d578a6866a21c000743a00b4f0f8a6850.tar.xz craftbukkit-1227934d578a6866a21c000743a00b4f0f8a6850.zip |
Make CraftMetaItem's attribute handling less strict on types
Diffstat (limited to 'src/main/java')
-rw-r--r-- | src/main/java/org/bukkit/craftbukkit/inventory/CraftMetaItem.java | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/src/main/java/org/bukkit/craftbukkit/inventory/CraftMetaItem.java b/src/main/java/org/bukkit/craftbukkit/inventory/CraftMetaItem.java index 1f7b5239..e658e4a3 100644 --- a/src/main/java/org/bukkit/craftbukkit/inventory/CraftMetaItem.java +++ b/src/main/java/org/bukkit/craftbukkit/inventory/CraftMetaItem.java @@ -259,10 +259,10 @@ class CraftMetaItem implements ItemMeta, Repairable { } NBTTagCompound nbttagcompound = (NBTTagCompound) nbttaglist.get(i); - if (!(nbttagcompound.get(ATTRIBUTES_UUID_HIGH.NBT) instanceof NBTTagLong)) { + if (!nbttagcompound.hasKeyOfType(ATTRIBUTES_UUID_HIGH.NBT, 99)) { continue; } - if (!(nbttagcompound.get(ATTRIBUTES_UUID_LOW.NBT) instanceof NBTTagLong)) { + if (!nbttagcompound.hasKeyOfType(ATTRIBUTES_UUID_LOW.NBT, 99)) { continue; } if (!(nbttagcompound.get(ATTRIBUTES_IDENTIFIER.NBT) instanceof NBTTagString) || !CraftItemFactory.KNOWN_NBT_ATTRIBUTE_NAMES.contains(nbttagcompound.getString(ATTRIBUTES_IDENTIFIER.NBT))) { @@ -271,10 +271,10 @@ class CraftMetaItem implements ItemMeta, Repairable { if (!(nbttagcompound.get(ATTRIBUTES_NAME.NBT) instanceof NBTTagString) || nbttagcompound.getString(ATTRIBUTES_NAME.NBT).isEmpty()) { continue; } - if (!(nbttagcompound.get(ATTRIBUTES_VALUE.NBT) instanceof NBTTagDouble)) { + if (!nbttagcompound.hasKeyOfType(ATTRIBUTES_VALUE.NBT, 99)) { continue; } - if (!(nbttagcompound.get(ATTRIBUTES_TYPE.NBT) instanceof NBTTagInt) || nbttagcompound.getInt(ATTRIBUTES_TYPE.NBT) < 0 || nbttagcompound.getInt(ATTRIBUTES_TYPE.NBT) > 2) { + if (!nbttagcompound.hasKeyOfType(ATTRIBUTES_TYPE.NBT, 99) || nbttagcompound.getInt(ATTRIBUTES_TYPE.NBT) < 0 || nbttagcompound.getInt(ATTRIBUTES_TYPE.NBT) > 2) { continue; } |