Fix unique nbt tag being applied to virtual inventory items

This commit is contained in:
NichtStudioCode 2023-03-04 18:40:47 +01:00
parent d437d5eef6
commit a0e588a6f1

@ -79,8 +79,10 @@ public abstract class AbstractWindow implements Window, GuiParent {
itemStack = background == null ? null : background.get(getLang());
} else {
itemStack = element.getItemStack(getLang());
SlotElement holdingElement = element.getHoldingElement();
itemStack = holdingElement.getItemStack(getLang());
if (holdingElement instanceof SlotElement.ItemSlotElement) {
// This makes every item unique to prevent Shift-DoubleClick "clicking" multiple items at the same time.
if (itemStack.hasItemMeta()) {
// clone ItemStack in order to not modify the original
@ -91,6 +93,7 @@ public abstract class AbstractWindow implements Window, GuiParent {
itemStack.setItemMeta(itemMeta);
}
}
}
setInvItem(index, itemStack);
if (setItem) {