From 0f4e33e9c7a5b3fc9912c67265b725db43fc92cb Mon Sep 17 00:00:00 2001 From: md_5 Date: Tue, 24 Jul 2018 08:57:17 +1000 Subject: SPIGOT-4122: Fix an instance of legacy item inequalities --- src/main/java/org/bukkit/inventory/ItemStack.java | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/main/java/org/bukkit/inventory/ItemStack.java b/src/main/java/org/bukkit/inventory/ItemStack.java index 73f79b22..41a43053 100644 --- a/src/main/java/org/bukkit/inventory/ItemStack.java +++ b/src/main/java/org/bukkit/inventory/ItemStack.java @@ -254,7 +254,8 @@ public class ItemStack implements Cloneable, ConfigurationSerializable { if (stack == this) { return true; } - return getType()== stack.getType()&& getDurability() == stack.getDurability() && hasItemMeta() == stack.hasItemMeta() && (hasItemMeta() ? Bukkit.getItemFactory().equals(getItemMeta(), stack.getItemMeta()) : true); + Material comparisonType = Bukkit.getUnsafe().fromLegacy(this.getType()); // This may be called from legacy item stacks, try to get the right material + return comparisonType == stack.getType() && getDurability() == stack.getDurability() && hasItemMeta() == stack.hasItemMeta() && (hasItemMeta() ? Bukkit.getItemFactory().equals(getItemMeta(), stack.getItemMeta()) : true); } @Override -- cgit v1.2.3