Update UtilsScript.java
This commit is contained in:
parent
43470feb1e
commit
a89766c8e7
|
@ -109,7 +109,9 @@ public abstract class UtilsScript extends Plugin {
|
|||
}
|
||||
|
||||
protected void obtain(List<ItemQuantity> items) {
|
||||
if (items.isEmpty() || hasItems(items)) {
|
||||
if (items.isEmpty() ||
|
||||
|
||||
Items(items)) {
|
||||
return;
|
||||
}
|
||||
obtain(items.toArray(ItemQuantity[]::new));
|
||||
|
@ -191,6 +193,30 @@ public abstract class UtilsScript extends Plugin {
|
|||
return bankItem == null ? 0 : bankItem.quantity();
|
||||
}
|
||||
|
||||
protected boolean equipmentHasItemsID(Integer items) {
|
||||
return game.equipment().withId(items).findFirst().isPresent();
|
||||
}
|
||||
protected boolean equipmentHasItemsID(Collection<Integer> items) {
|
||||
return game.equipment().withId(items).findFirst().isPresent();
|
||||
}
|
||||
|
||||
protected boolean inventoryHasItemsName(String items) {
|
||||
return game.inventory().withNamePart(items).findFirst().isPresent();
|
||||
}
|
||||
protected boolean inventoryHasItemsName(Collection<String> items) {
|
||||
for (String item : items) {
|
||||
return game.inventory().withNamePart(item).findFirst().isPresent();
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
protected boolean inventoryHasItems(Integer items) {
|
||||
return game.inventory().withId(items).findFirst().isPresent();
|
||||
}
|
||||
protected boolean inventoryHasItems(Collection<Integer> items) {
|
||||
return game.inventory().withId(items).findFirst().isPresent();
|
||||
}
|
||||
|
||||
protected boolean inventoryHasItems(ItemQuantity... items) {
|
||||
return inventoryHasItems(false, items);
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue