mirror of
https://github.com/ChestShop-authors/ChestShop-3.git
synced 2024-12-25 17:37:34 +01:00
Does not validate invalid shops
This commit is contained in:
parent
2fca493dec
commit
39d3853802
@ -18,8 +18,23 @@ public class ShopValidator implements Listener {
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (isEmpty(event.getStock())) {
|
||||||
|
event.setCancelled(INVALID_SHOP);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
if (!ChestShopSign.isAdminShop(event.getSign()) && event.getOwnerInventory() == null) {
|
if (!ChestShopSign.isAdminShop(event.getSign()) && event.getOwnerInventory() == null) {
|
||||||
event.setCancelled(INVALID_SHOP);
|
event.setCancelled(INVALID_SHOP);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private static <A> boolean isEmpty(A[] array) {
|
||||||
|
for (A element : array) {
|
||||||
|
if (element != null) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return true;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user