Merge pull request #108 from Soxs/master
added boolean inventoryHasItems(boolean any, ItemQuantity... items)
This commit is contained in:
commit
0ed87c0304
|
@ -167,12 +167,16 @@ public abstract class UtilsScript extends Plugin {
|
|||
}
|
||||
|
||||
protected boolean inventoryHasItems(ItemQuantity... items) {
|
||||
return inventoryHasItems(false, items);
|
||||
}
|
||||
|
||||
protected boolean inventoryHasItems(boolean any, ItemQuantity... items) {
|
||||
for (var item : items) {
|
||||
if (game.inventory().withId(item.id).quantity() < item.quantity) {
|
||||
return false;
|
||||
if (any == (game.inventory().withId(item.id).quantity() >= item.quantity)) {
|
||||
return any;
|
||||
}
|
||||
}
|
||||
return true;
|
||||
return !any;
|
||||
}
|
||||
|
||||
protected boolean hasItems(ItemQuantity... items) {
|
||||
|
|
Loading…
Reference in New Issue