Fix isEmpty and hashCode for CraftMetaItem
This commit is contained in:
parent
6268eb5a3e
commit
6880e5277f
@ -438,7 +438,7 @@ class CraftMetaItem implements ItemMeta, Repairable {
|
|||||||
|
|
||||||
@Overridden
|
@Overridden
|
||||||
boolean isEmpty() {
|
boolean isEmpty() {
|
||||||
return !(hasDisplayName() || hasEnchants() || hasLore() || hasAttributes() || hasRepairCost());
|
return !(hasDisplayName() || hasEnchants() || hasLore() || hasAttributes() || hasRepairCost() || blockEntityTag != null);
|
||||||
}
|
}
|
||||||
|
|
||||||
public String getDisplayName() {
|
public String getDisplayName() {
|
||||||
@ -582,6 +582,7 @@ class CraftMetaItem implements ItemMeta, Repairable {
|
|||||||
hash = 61 * hash + (hasEnchants() ? this.enchantments.hashCode() : 0);
|
hash = 61 * hash + (hasEnchants() ? this.enchantments.hashCode() : 0);
|
||||||
hash = 61 * hash + (hasAttributes() ? this.attributes.hashCode() : 0);
|
hash = 61 * hash + (hasAttributes() ? this.attributes.hashCode() : 0);
|
||||||
hash = 61 * hash + (hasRepairCost() ? this.repairCost : 0);
|
hash = 61 * hash + (hasRepairCost() ? this.repairCost : 0);
|
||||||
|
hash = 61 * hash + (blockEntityTag != null ? this.blockEntityTag.hashCode() : 0);
|
||||||
return hash;
|
return hash;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user