summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authormd_5 <git@md-5.net>2015-02-15 12:54:18 +1100
committermd_5 <git@md-5.net>2015-02-15 12:54:18 +1100
commit726656b864cfff0851926df4fe95a2d51e911897 (patch)
tree46e571444a85678ee044e89d8f6e139439b0cdc3
parent0483f0f4144f8147b8c032c7728abc87886a1449 (diff)
downloadcraftbukkit-726656b864cfff0851926df4fe95a2d51e911897.tar
craftbukkit-726656b864cfff0851926df4fe95a2d51e911897.tar.gz
craftbukkit-726656b864cfff0851926df4fe95a2d51e911897.tar.lz
craftbukkit-726656b864cfff0851926df4fe95a2d51e911897.tar.xz
craftbukkit-726656b864cfff0851926df4fe95a2d51e911897.zip
Fix hashcode / equals / formatting.
-rw-r--r--src/main/java/org/bukkit/craftbukkit/inventory/CraftMetaItem.java36
1 files changed, 19 insertions, 17 deletions
diff --git a/src/main/java/org/bukkit/craftbukkit/inventory/CraftMetaItem.java b/src/main/java/org/bukkit/craftbukkit/inventory/CraftMetaItem.java
index 28871ab3..dd97fff5 100644
--- a/src/main/java/org/bukkit/craftbukkit/inventory/CraftMetaItem.java
+++ b/src/main/java/org/bukkit/craftbukkit/inventory/CraftMetaItem.java
@@ -625,6 +625,7 @@ class CraftMetaItem implements ItemMeta, Repairable {
&& (this.hasLore() ? that.hasLore() && this.lore.equals(that.lore) : !that.hasLore())
&& (this.hasAttributes() ? that.hasAttributes() && this.attributes.equals(that.attributes) : !that.hasAttributes())
&& (this.hasRepairCost() ? that.hasRepairCost() && this.repairCost == that.repairCost : !that.hasRepairCost())
+ && (this.unhandledTags.equals(that.unhandledTags))
&& (this.hideFlag == that.hideFlag);
}
@@ -651,6 +652,7 @@ class CraftMetaItem implements ItemMeta, Repairable {
hash = 61 * hash + (hasEnchants() ? this.enchantments.hashCode() : 0);
hash = 61 * hash + (hasAttributes() ? this.attributes.hashCode() : 0);
hash = 61 * hash + (hasRepairCost() ? this.repairCost : 0);
+ hash = 61 * hash + unhandledTags.hashCode();
hash = 61 * hash + hideFlag;
return hash;
}
@@ -767,24 +769,24 @@ class CraftMetaItem implements ItemMeta, Repairable {
synchronized (HANDLED_TAGS) {
if (HANDLED_TAGS.isEmpty()) {
HANDLED_TAGS.addAll(Arrays.asList(
- DISPLAY.NBT,
- REPAIR.NBT,
- ATTRIBUTES.NBT,
- ENCHANTMENTS.NBT,
- CraftMetaMap.MAP_SCALING.NBT,
- CraftMetaPotion.POTION_EFFECTS.NBT,
- CraftMetaSkull.SKULL_OWNER.NBT,
- CraftMetaTileEntity.BLOCK_ENTITY_TAG.NBT,
- CraftMetaBook.BOOK_TITLE.NBT,
- CraftMetaBook.BOOK_AUTHOR.NBT,
- CraftMetaBook.BOOK_PAGES.NBT,
- CraftMetaBook.RESOLVED.NBT,
- CraftMetaBook.GENERATION.NBT,
- CraftMetaFirework.FIREWORKS.NBT,
- CraftMetaEnchantedBook.STORED_ENCHANTMENTS.NBT,
- CraftMetaCharge.EXPLOSION.NBT
+ DISPLAY.NBT,
+ REPAIR.NBT,
+ ATTRIBUTES.NBT,
+ ENCHANTMENTS.NBT,
+ CraftMetaMap.MAP_SCALING.NBT,
+ CraftMetaPotion.POTION_EFFECTS.NBT,
+ CraftMetaSkull.SKULL_OWNER.NBT,
+ CraftMetaTileEntity.BLOCK_ENTITY_TAG.NBT,
+ CraftMetaBook.BOOK_TITLE.NBT,
+ CraftMetaBook.BOOK_AUTHOR.NBT,
+ CraftMetaBook.BOOK_PAGES.NBT,
+ CraftMetaBook.RESOLVED.NBT,
+ CraftMetaBook.GENERATION.NBT,
+ CraftMetaFirework.FIREWORKS.NBT,
+ CraftMetaEnchantedBook.STORED_ENCHANTMENTS.NBT,
+ CraftMetaCharge.EXPLOSION.NBT
));
-}
+ }
return HANDLED_TAGS;
}
}