mirror of
https://hub.spigotmc.org/stash/scm/spigot/bukkit.git
synced 2025-08-20 05:14:15 +00:00
SPIGOT-4122: Fix an instance of legacy item inequalities
This commit is contained in:
parent
b7b10ad1c3
commit
0f4e33e9c7
1 changed files with 2 additions and 1 deletions
|
@ -254,7 +254,8 @@ public class ItemStack implements Cloneable, ConfigurationSerializable {
|
||||||
if (stack == this) {
|
if (stack == this) {
|
||||||
return true;
|
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
|
@Override
|
||||||
|
|
Loading…
Add table
Reference in a new issue