Fix shops resetting itemstack size to qty 1

This commit is contained in:
Len
2026-01-18 20:49:06 +01:00
parent 49fb85229d
commit e554e2643d
3 changed files with 19 additions and 19 deletions
@@ -154,7 +154,7 @@ public class PlayerShop {
}
public boolean isInitialized() {
return type != ShopType.NONE && itemStack != null;
return type != ShopType.NONE;
}
public void updateSign() {
@@ -368,8 +368,12 @@ public class PlayerShop {
if (Util.callCancellableEvent(shopItemChangeEvent))
return; // cancelled by another plugin, does this need logging?
this.itemStack = itemStack;
this.itemStack.setAmount(this.amount != 0 ? this.amount : 1);
if (itemStack == null) {
this.itemStack = null;
} else {
this.itemStack = itemStack.clone();
this.itemStack.setAmount(this.amount != 0 ? this.amount : 1);
}
setDirty(true);
update();
}