From 6880e5277f990d9852bfd3cd2186c71908f27a47 Mon Sep 17 00:00:00 2001 From: Thinkofdeath Date: Sun, 7 Dec 2014 11:42:37 +0000 Subject: [PATCH] Fix isEmpty and hashCode for CraftMetaItem --- .../java/org/bukkit/craftbukkit/inventory/CraftMetaItem.java | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/main/java/org/bukkit/craftbukkit/inventory/CraftMetaItem.java b/src/main/java/org/bukkit/craftbukkit/inventory/CraftMetaItem.java index 9fb42563b6..466580ced0 100644 --- a/src/main/java/org/bukkit/craftbukkit/inventory/CraftMetaItem.java +++ b/src/main/java/org/bukkit/craftbukkit/inventory/CraftMetaItem.java @@ -438,7 +438,7 @@ class CraftMetaItem implements ItemMeta, Repairable { @Overridden boolean isEmpty() { - return !(hasDisplayName() || hasEnchants() || hasLore() || hasAttributes() || hasRepairCost()); + return !(hasDisplayName() || hasEnchants() || hasLore() || hasAttributes() || hasRepairCost() || blockEntityTag != null); } public String getDisplayName() { @@ -582,6 +582,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 + (blockEntityTag != null ? this.blockEntityTag.hashCode() : 0); return hash; }