Added checks for canPlaceOn and canDestroy sets in #isSimilar, changed emptiness check to Collection#isEmpty from != 0 in #hasNbtTag

This commit is contained in:
Németh Noel 2021-02-28 21:01:23 +01:00
parent 10ece83d75
commit bcfaf71c7c

View File

@ -191,7 +191,9 @@ public class ItemStack implements DataContainer, PublicCloneable<ItemStack> {
itemStack.attributes.equals(attributes) &&
itemStack.hideFlag == hideFlag &&
sameMeta &&
dataCheck;
dataCheck &&
itemStack.canPlaceOn.equals(canPlaceOn) &&
itemStack.canDestroy.equals(canDestroy);
}
}
@ -632,8 +634,8 @@ public class ItemStack implements DataContainer, PublicCloneable<ItemStack> {
customModelData != 0 ||
(itemMeta != null && itemMeta.hasNbt()) ||
(data != null && !data.isEmpty()) ||
canDestroy.size() != 0 ||
canPlaceOn.size() != 0;
!canDestroy.isEmpty() ||
!canPlaceOn.isEmpty();
}
/**