mirror of
https://github.com/ChestShop-authors/ChestShop-3.git
synced 2024-11-26 20:16:12 +01:00
Fix shop removal with partial transactions (Fixes #307)
This commit is contained in:
parent
7fbf50cefe
commit
a427c8c5a0
@ -52,7 +52,19 @@ public class EmptyShopDeleter implements Listener {
|
||||
}
|
||||
|
||||
private static boolean shopShouldBeRemoved(Inventory inventory, ItemStack[] stock) {
|
||||
return Properties.REMOVE_EMPTY_SHOPS && !ChestShopSign.isAdminShop(inventory) && !InventoryUtil.hasItems(stock, inventory);
|
||||
if (Properties.REMOVE_EMPTY_SHOPS && !ChestShopSign.isAdminShop(inventory)) {
|
||||
if (Properties.ALLOW_PARTIAL_TRANSACTIONS) {
|
||||
for (ItemStack itemStack : stock) {
|
||||
if (inventory.containsAtLeast(itemStack, 1)) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
return true;
|
||||
} else if (!InventoryUtil.hasItems(stock, inventory)) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
private static boolean isInRemoveWorld(Sign sign) {
|
||||
|
Loading…
Reference in New Issue
Block a user