Fix shops resetting itemstack size to qty 1
This commit is contained in:
@@ -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();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user