Package net.eternalclient.api.containers
Class Inventory
- java.lang.Object
-
- net.eternalclient.api.containers.Inventory
-
public class Inventory extends java.lang.Object
A class representing the inventory, providing methods to interact with items in the inventory.
-
-
Constructor Summary
Constructors Constructor Description Inventory()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static java.util.List<Item>
all()
Returns a list of all items in the container.static java.util.List<Item>
all(int... ids)
Returns a list of all items with the given IDs.static java.util.List<Item>
all(java.lang.String... names)
Returns a list of all items with the given names.static java.util.List<Item>
all(java.util.function.Predicate<Item> predicate)
Returns a list of all items that satisfy the given predicate.static java.util.List<Item>
all(Item... items)
Returns a list of all items with the given items.static java.util.List<Item>
all(ItemVariant itemVariant)
Returns a list of all items with the given variant.static java.util.List<Item>
allExcept(int... ids)
Returns a list of all items except those with the given IDs.static java.util.List<Item>
allExcept(java.lang.String... names)
Returns a list of all items except those with the given names.static java.util.List<Item>
allExcept(java.util.function.Predicate<Item> predicate)
Returns a list of all items except those that satisfy the given predicate.static java.util.List<Item>
allExcept(Item... items)
Returns a list of all items except those with the given items.static java.util.List<Item>
allExcept(ItemVariant itemVariant)
Returns a list of all items except those with the given variant.static java.awt.Rectangle
calculateSlotBounds(int slot)
Calculates the bounds for slot in the inventory regardless whether or not an item exists in the slot.static int
capacity()
Returns the capacity of the container.static boolean
contains(int id)
Checks if the container contains an item with the given ID.static boolean
contains(int... ids)
Checks if the container contains items with the given IDs.static boolean
contains(java.lang.String name)
Checks if the container contains an item with the given name.static boolean
contains(java.lang.String... names)
Checks if the container contains items with the given names.static boolean
contains(java.util.function.Predicate<Item> predicate)
Checks if the container contains an item that satisfies the given predicate.static boolean
contains(Item item)
Checks if the container contains the given item.static boolean
contains(Item... items)
Checks if the container contains the given items.static boolean
contains(ItemVariant itemVariant)
Checks if the container contains the given item variant.static boolean
containsAll(int id)
Checks if the container contains all items with the given ID.static boolean
containsAll(int... ids)
Checks if the container contains all items with the given IDs.static boolean
containsAll(java.lang.String name)
Checks if the container contains all items with the given name.static boolean
containsAll(java.lang.String... names)
Checks if the container contains all items with the given names.static boolean
containsAll(java.util.function.Predicate<Item> predicate)
Checks if the container contains all items that satisfy the given predicate.static boolean
containsAll(Item item)
Checks if the container contains all items with the given item.static boolean
containsAll(Item... items)
Checks if the container contains all items with the given items.static boolean
containsAll(ItemVariant itemVariant)
Checks if the container contains all items with the given item variant.static int
count(int id)
Returns the total amount of items in the container with the given ID.static int
count(int... ids)
Returns the total amount of items in the container with the given IDs.static int
count(java.lang.String name)
Returns the total amount of items in the container with the given name.static int
count(java.lang.String... names)
Returns the total amount of items in the container with the given names.static int
count(java.util.function.Predicate<Item> predicate)
Returns the total amount of items in the container that satisfy the given predicate.static int
count(Item item)
Returns the total amount of items in the container in which the item has the same ID as the given item.static int
count(Item... items)
Returns the total amount of items in the container in which the item has the same ID as the given items.static int
count(ItemVariant itemVariant)
Returns the total amount of items in the container in which the item matches the variant.static boolean
deselect()
Deselects an item if it is selected, by generating a random click on a specific widget.static boolean
drop(int id)
Drops an item with the specified ID.static boolean
drop(java.lang.String name)
Drops an item with the given name if it exists.static boolean
drop(java.util.function.Predicate<Item> predicate)
Drops the first item in the collection that satisfies the given predicate.static boolean
dropAll(int... ids)
Drops all items with specified IDs.static boolean
dropAll(java.lang.String... names)
Drops all given names.static boolean
dropAll(java.util.function.Predicate<Item> predicate)
Drops all items that satisfy the given predicate.static int
find(int... ids)
Returns the first item ID in the container that matches any of the given IDs, or -1 if no such item exists.static int
find(int[] ids, int defaultValue)
Returns the first item ID in the container that matches any of the given IDs, or the default value if no such item exists.static int
find(java.lang.String... names)
Returns the first item ID of an item in the container in which the name matches any of the given names, or -1 if no such item exists.static int
find(java.lang.String[] names, int defaultValue)
Returns the first item ID of an item in the container in which the name matches any of the given names, or the default value if no such item exists.static int
find(java.util.function.Predicate<Item> predicate)
Returns the first item ID in the container that satisfies the given predicate, or -1 if no such item exists.static int
find(java.util.function.Predicate<Item> predicate, int defaultValue)
Returns the first item ID in the container that satisfies the given predicate, or the default value if no such item exists.static int
find(ItemVariant variant)
Returns the first item ID in the container that matches the given variant, or -1 if no such item exists.static int
find(ItemVariant variant, int defaultValue)
Returns the first item ID in the container that matches the given variant, or the default value if no such item exists.static int
findForSlot(int slot)
Returns the item ID in the given slot, or -1 if no such item exists.static int
findForSlot(int slot, int defaultValue)
Returns the item ID in the given slot, or the default value if no such item exists.static int
freeSlots()
Returns the number of free slots in the container.static Item
get(int id)
Returns the item with the given ID.static Item
get(java.lang.String name)
Returns the item with the given name.static Item
get(java.util.function.Predicate<Item> predicate)
Returns the item that satisfies the given predicate.static Item
get(ItemVariant itemVariant)
Returns the item with the given variant.static ItemContainerCache
getCache()
static RSItemContainer
getContainer()
Returns the RSItemContainer associated with the specified NODE_ID.static int
getFirstEmptySlot()
Returns the first empty slot in the container.static int
getFirstFullSlot()
Returns the first full slot in the container.static Item
getForSlot(int slot)
Returns the item in the given slot.static int
getIdForSlot(int slot)
Returns the ID of the item associated with the given slot.static WidgetChild
getInventoryWidget()
Returns the inventory widget child.static java.lang.String
getNameForSlot(int slot)
Returns the name of the item associated with the specified slot.static int
getSelectedItemId()
Returns the selected item ID for the spell in the client.static java.lang.String
getSelectedItemName()
Retrieves the name of the currently selected item.static int
getSelectedItemSlot()
Returns the slot index of the currently selected item, or -1 if no item is selected.static int
getSize()
static java.awt.Rectangle
getSlotBounds(int slot)
Returns the inventory bounds of the item with the given slot, or null if no item exists.static java.awt.Rectangle
getSlotBounds(Item item)
Returns the inventory bounds of the item with the given slot, or null if no such item exists.static boolean
interact(int id, java.lang.String action)
Interacts with an item specified by its ID.static boolean
interact(int id, java.lang.String... actions)
Interacts with an item specified by the given id using the provided actions.static boolean
interact(int id, java.util.function.Predicate<java.lang.String> predicate)
Interacts with the item of the given ID using the specified predicate.static boolean
interact(java.lang.String name, java.lang.String action)
Interacts with an item by performing the specified action.static boolean
interact(java.lang.String name, java.lang.String... actions)
Interacts with an item by performing a series of actions.static boolean
interact(java.lang.String name, java.util.function.Predicate<java.lang.String> predicate)
Interacts with an item based on the given name and predicate.static boolean
interact(java.util.function.Predicate<Item> itemPredicate, java.lang.String action)
Interacts with an item that satisfies the given predicate using the specified action.static boolean
interact(java.util.function.Predicate<Item> itemPredicate, java.lang.String... actions)
Interacts with an item that matches the given predicate by performing the specified actions.static boolean
interact(java.util.function.Predicate<Item> itemPredicate, java.util.function.Predicate<java.lang.String> predicate)
Interacts with an item that matches the given item predicate, based on the given string predicate.static boolean
interact(Item item, java.lang.String action)
Executes the specified action on the given item in the inventory.static boolean
interact(Item item, java.lang.String... actions)
Interacts with an item by executing a series of actions.static boolean
interact(Item item, java.util.function.Predicate<java.lang.String> predicate)
Interacts with an item using a specified predicate.static boolean
isEmpty()
Checks if the container is empty.static boolean
isFull()
Checks if the container is full.static boolean
isItemSelected()
Checks if any item is currently selected.static boolean
onlyContains(int id)
Checks if the container only contains an item with the given ID.static boolean
onlyContains(int... ids)
Checks if the container only contains items with the given IDs.static boolean
onlyContains(java.lang.String name)
Checks if the container only contains an item with the given name.static boolean
onlyContains(java.lang.String... names)
Checks if the container only contains items with the given names.static boolean
onlyContains(java.util.function.Predicate<Item> predicate)
Checks if the container only contains items that satisfy the given predicate.static boolean
onlyContains(Item item)
Checks if the container only contains the given item.static boolean
onlyContains(Item... items)
Checks if the container only contains the given items.static boolean
onlyContains(ItemVariant itemVariant)
Checks if the container only contains the given item variant.static int
usedSlots()
Returns the number of used slots in the container.
-
-
-
Method Detail
-
getSize
public static int getSize()
-
getCache
public static ItemContainerCache getCache()
-
getContainer
public static RSItemContainer getContainer()
Returns the RSItemContainer associated with the specified NODE_ID.- Returns:
- the RSItemContainer for the given NODE_ID.
-
getInventoryWidget
public static WidgetChild getInventoryWidget()
Returns the inventory widget child.- Returns:
- the inventory widget child
-
interact
public static boolean interact(Item item, java.lang.String action)
Executes the specified action on the given item in the inventory.- Parameters:
item
- the item to interact withaction
- the action to be performed on the item- Returns:
- true if the action was successfully executed, false otherwise
-
interact
public static boolean interact(Item item, java.lang.String... actions)
Interacts with an item by executing a series of actions.- Parameters:
item
- The item to interact with.actions
- The actions to perform on the item.- Returns:
true
if the interactions were successfully executed,false
otherwise.
-
interact
public static boolean interact(Item item, java.util.function.Predicate<java.lang.String> predicate)
Interacts with an item using a specified predicate.- Parameters:
item
- the item to interact withpredicate
- the condition to be satisfied before executing the interaction- Returns:
- true if the interaction is successfully executed, false otherwise
-
interact
public static boolean interact(int id, java.util.function.Predicate<java.lang.String> predicate)
Interacts with the item of the given ID using the specified predicate.- Parameters:
id
- the ID of the item to interact withpredicate
- the predicate to use for interaction- Returns:
- true if interaction was successful, false otherwise
-
interact
public static boolean interact(int id, java.lang.String... actions)
Interacts with an item specified by the given id using the provided actions. Returns true if the interaction is successful, false otherwise.- Parameters:
id
- the id of the item to interact withactions
- the actions to perform on the item- Returns:
- true if the interaction is successful, false otherwise
-
interact
public static boolean interact(int id, java.lang.String action)
Interacts with an item specified by its ID.- Parameters:
id
- the ID of the item to interact withaction
- the action to perform on the item- Returns:
- true if the interaction is successful, false otherwise
-
interact
public static boolean interact(java.lang.String name, java.util.function.Predicate<java.lang.String> predicate)
Interacts with an item based on the given name and predicate.- Parameters:
name
- the name of the item to interact withpredicate
- the predicate used to determine the interaction- Returns:
- true if the interaction is successful, false otherwise
-
interact
public static boolean interact(java.lang.String name, java.lang.String... actions)
Interacts with an item by performing a series of actions.- Parameters:
name
- the name of the item to interact with.actions
- the actions to perform on the item.- Returns:
- true if the interaction was successful, false otherwise.
-
interact
public static boolean interact(java.lang.String name, java.lang.String action)
Interacts with an item by performing the specified action.- Parameters:
name
- the name of the item to interact withaction
- the action to perform on the item- Returns:
- true if the interaction was successful, false otherwise
-
interact
public static boolean interact(java.util.function.Predicate<Item> itemPredicate, java.util.function.Predicate<java.lang.String> predicate)
Interacts with an item that matches the given item predicate, based on the given string predicate.- Parameters:
itemPredicate
- the predicate to determine if an item matches the requirementspredicate
- the predicate to determine if a string matches the requirements- Returns:
- true if the item was found and successfully interacted with, false otherwise
-
interact
public static boolean interact(java.util.function.Predicate<Item> itemPredicate, java.lang.String... actions)
Interacts with an item that matches the given predicate by performing the specified actions.- Parameters:
itemPredicate
- the predicate to match the itemactions
- the actions to perform- Returns:
- true if the item was found and the interaction was successful; false otherwise
-
interact
public static boolean interact(java.util.function.Predicate<Item> itemPredicate, java.lang.String action)
Interacts with an item that satisfies the given predicate using the specified action.- Parameters:
itemPredicate
- the predicate used to locate the itemaction
- the action to perform on the item- Returns:
- true if the interaction was successful, false otherwise
-
deselect
public static boolean deselect()
Deselects an item if it is selected, by generating a random click on a specific widget.- Returns:
- true if the item is deselected successfully, false otherwise.
-
drop
public static boolean drop(java.util.function.Predicate<Item> predicate)
Drops the first item in the collection that satisfies the given predicate.- Parameters:
predicate
- the condition that an item must satisfy- Returns:
- true if an item is dropped, false otherwise
-
drop
public static boolean drop(int id)
Drops an item with the specified ID.- Parameters:
id
- the ID of the item to be dropped- Returns:
- true if the item was successfully dropped, false otherwise
-
drop
public static boolean drop(java.lang.String name)
Drops an item with the given name if it exists.- Parameters:
name
- the name of the item to be dropped- Returns:
- true if the item was dropped successfully, false otherwise
-
dropAll
public static boolean dropAll(java.util.function.Predicate<Item> predicate)
Drops all items that satisfy the given predicate.- Parameters:
predicate
- the condition to be satisfied by the items- Returns:
- true if all items were successfully dropped, false otherwise
-
dropAll
public static boolean dropAll(int... ids)
Drops all items with specified IDs.- Parameters:
ids
- the array of item IDs to drop- Returns:
- true if the drop event was successfully executed, false otherwise
-
dropAll
public static boolean dropAll(java.lang.String... names)
Drops all given names.- Parameters:
names
- the names to be dropped- Returns:
- true if all names were dropped successfully, false otherwise
-
getIdForSlot
public static int getIdForSlot(int slot)
Returns the ID of the item associated with the given slot.- Parameters:
slot
- the slot number to search for- Returns:
- the ID of the item in the slot, or -1 if not found
-
getNameForSlot
public static java.lang.String getNameForSlot(int slot)
Returns the name of the item associated with the specified slot.- Parameters:
slot
- the slot number- Returns:
- the name of the item for the slot or an empty string if no item is found
-
getSlotBounds
public static java.awt.Rectangle getSlotBounds(int slot)
Returns the inventory bounds of the item with the given slot, or null if no item exists.- Parameters:
slot
- the slot of the item- Returns:
- the inventory bounds of the item, or null if none found
-
getSlotBounds
public static java.awt.Rectangle getSlotBounds(Item item)
Returns the inventory bounds of the item with the given slot, or null if no such item exists.- Parameters:
item
- the item- Returns:
- the inventory bounds of the item, or null if none found
-
calculateSlotBounds
public static java.awt.Rectangle calculateSlotBounds(int slot)
Calculates the bounds for slot in the inventory regardless whether or not an item exists in the slot. Returns null if it's not able to find the inventory widget.- Parameters:
slot
- the slot to calculate the position for- Returns:
- the bounds of the slot, or null if the inventory widget is not found
-
isItemSelected
public static boolean isItemSelected()
Checks if any item is currently selected.- Returns:
- true if an item is selected, false otherwise.
-
getSelectedItemId
public static int getSelectedItemId()
Returns the selected item ID for the spell in the client.- Returns:
- the selected item ID for the spell in the client
-
getSelectedItemName
public static java.lang.String getSelectedItemName()
Retrieves the name of the currently selected item.- Returns:
- the name of the selected item as a string, or an empty string if no item is selected.
-
getSelectedItemSlot
public static int getSelectedItemSlot()
Returns the slot index of the currently selected item, or -1 if no item is selected.- Returns:
- the slot index of the selected item, or -1 if no item is selected.
-
isFull
public static boolean isFull()
Checks if the container is full.- Returns:
- true if the container is full, false otherwise
-
isEmpty
public static boolean isEmpty()
Checks if the container is empty.- Returns:
- true if the container is empty, false otherwise
-
capacity
public static int capacity()
Returns the capacity of the container.- Returns:
- the capacity of the container
-
freeSlots
public static int freeSlots()
Returns the number of free slots in the container.- Returns:
- the number of free slots in the container
-
usedSlots
public static int usedSlots()
Returns the number of used slots in the container.- Returns:
- the number of used slots in the container
-
getFirstEmptySlot
public static int getFirstEmptySlot()
Returns the first empty slot in the container.- Returns:
- the first empty slot in the container
-
getFirstFullSlot
public static int getFirstFullSlot()
Returns the first full slot in the container.- Returns:
- the first full slot in the container
-
get
public static Item get(int id)
Returns the item with the given ID.- Parameters:
id
- the ID of the item- Returns:
- the item with the given ID, or null if no such item exists
-
get
public static Item get(java.lang.String name)
Returns the item with the given name.- Parameters:
name
- the name of the item- Returns:
- the item with the given name, or null if no such item exists
-
get
public static Item get(ItemVariant itemVariant)
Returns the item with the given variant.- Parameters:
itemVariant
- the variant of the item- Returns:
- the item with the given variant, or null if no such item exists
-
get
public static Item get(java.util.function.Predicate<Item> predicate)
Returns the item that satisfies the given predicate.- Parameters:
predicate
- the condition to be satisfied by the item- Returns:
- the item that satisfies the given predicate, or null if no such item exists
-
getForSlot
public static Item getForSlot(int slot)
Returns the item in the given slot.- Parameters:
slot
- the slot of the item- Returns:
- the item in the given slot, or null if no such item exists
-
all
public static java.util.List<Item> all()
Returns a list of all items in the container.- Returns:
- a list of all items in the container
-
all
public static java.util.List<Item> all(int... ids)
Returns a list of all items with the given IDs.- Parameters:
ids
- the IDs of the items- Returns:
- a list of all items with the given IDs
-
all
public static java.util.List<Item> all(java.lang.String... names)
Returns a list of all items with the given names.- Parameters:
names
- the names of the items- Returns:
- a list of all items with the given names
-
all
public static java.util.List<Item> all(Item... items)
Returns a list of all items with the given items.- Parameters:
items
- the items to be returned- Returns:
- a list of all items with the given items
-
all
public static java.util.List<Item> all(ItemVariant itemVariant)
Returns a list of all items with the given variant.- Parameters:
itemVariant
- the variant of the items- Returns:
- a list of all items with the given variant
-
all
public static java.util.List<Item> all(java.util.function.Predicate<Item> predicate)
Returns a list of all items that satisfy the given predicate.- Parameters:
predicate
- the condition to be satisfied by the items- Returns:
- a list of all items that satisfy the given predicate
-
allExcept
public static java.util.List<Item> allExcept(int... ids)
Returns a list of all items except those with the given IDs.- Parameters:
ids
- the IDs of the items to be excluded- Returns:
- a list of all items except those with the given IDs
-
allExcept
public static java.util.List<Item> allExcept(java.lang.String... names)
Returns a list of all items except those with the given names.- Parameters:
names
- the names of the items to be excluded- Returns:
- a list of all items except those with the given names
-
allExcept
public static java.util.List<Item> allExcept(Item... items)
Returns a list of all items except those with the given items.- Parameters:
items
- the items to be excluded- Returns:
- a list of all items except those with the given items
-
allExcept
public static java.util.List<Item> allExcept(ItemVariant itemVariant)
Returns a list of all items except those with the given variant.- Parameters:
itemVariant
- the variant of the items to be excluded- Returns:
- a list of all items except those with the given variant
-
allExcept
public static java.util.List<Item> allExcept(java.util.function.Predicate<Item> predicate)
Returns a list of all items except those that satisfy the given predicate.- Parameters:
predicate
- the condition to be satisfied by the items to be excluded- Returns:
- a list of all items except those that satisfy the given predicate
-
find
public static int find(int... ids)
Returns the first item ID in the container that matches any of the given IDs, or -1 if no such item exists.- Parameters:
ids
- the IDs of the items- Returns:
- the first item ID in the container that matches any of the given IDs, or -1 if no such item exists
-
find
public static int find(int[] ids, int defaultValue)
Returns the first item ID in the container that matches any of the given IDs, or the default value if no such item exists.- Parameters:
ids
- the IDs of the itemsdefaultValue
- the default value to return if no such item exists- Returns:
- the first item ID in the container that matches any of the given IDs, or the default value if no such item exists
-
find
public static int find(ItemVariant variant)
Returns the first item ID in the container that matches the given variant, or -1 if no such item exists.- Parameters:
variant
- the variant of the item- Returns:
- the first item ID in the container that matches the given variant, or -1 if no such item exists
-
find
public static int find(ItemVariant variant, int defaultValue)
Returns the first item ID in the container that matches the given variant, or the default value if no such item exists.- Parameters:
variant
- the variant of the itemdefaultValue
- the default value to return if no such item exists- Returns:
- the first item ID in the container that matches the given variant, or the default value if no such item exists
-
find
public static int find(java.lang.String... names)
Returns the first item ID of an item in the container in which the name matches any of the given names, or -1 if no such item exists.- Parameters:
names
- the names of the items- Returns:
- the first item ID of an item in the container in which the name matches any of the given names, or -1 if no such item exists
-
find
public static int find(java.lang.String[] names, int defaultValue)
Returns the first item ID of an item in the container in which the name matches any of the given names, or the default value if no such item exists.- Parameters:
names
- the names of the itemsdefaultValue
- the default value to return if no such item exists- Returns:
- the first item ID of an item in the container in which the name matches any of the given names, or the default value if no such item exists
-
find
public static int find(java.util.function.Predicate<Item> predicate)
Returns the first item ID in the container that satisfies the given predicate, or -1 if no such item exists.- Parameters:
predicate
- the condition to be satisfied by the item- Returns:
- the first item ID in the container that satisfies the given predicate, or -1 if no such item exists
-
find
public static int find(java.util.function.Predicate<Item> predicate, int defaultValue)
Returns the first item ID in the container that satisfies the given predicate, or the default value if no such item exists.- Parameters:
predicate
- the condition to be satisfied by the itemdefaultValue
- the default value to return if no such item exists- Returns:
- the first item ID in the container that satisfies the given predicate, or the default value if no such item exists
-
findForSlot
public static int findForSlot(int slot)
Returns the item ID in the given slot, or -1 if no such item exists.- Parameters:
slot
- the slot of the item- Returns:
- the item ID in the given slot, or -1 if no such item exists
-
findForSlot
public static int findForSlot(int slot, int defaultValue)
Returns the item ID in the given slot, or the default value if no such item exists.- Parameters:
slot
- the slot of the itemdefaultValue
- the default value to return if no such item exists- Returns:
- the item ID in the given slot, or the default value if no such item exists
-
count
public static int count(int id)
Returns the total amount of items in the container with the given ID.- Parameters:
id
- the ID of the item- Returns:
- the total amount of items in the container with the given ID
-
count
public static int count(int... ids)
Returns the total amount of items in the container with the given IDs.- Parameters:
ids
- the IDs of the items- Returns:
- the total amount of items in the container with the given IDs
-
count
public static int count(java.lang.String name)
Returns the total amount of items in the container with the given name.- Parameters:
name
- the name of the item- Returns:
- the total amount of items in the container with the given name
-
count
public static int count(java.lang.String... names)
Returns the total amount of items in the container with the given names.- Parameters:
names
- the names of the items- Returns:
- the total amount of items in the container with the given names
-
count
public static int count(Item item)
Returns the total amount of items in the container in which the item has the same ID as the given item.- Parameters:
item
- the item- Returns:
- the total amount of items in the container in which the item has the same ID as the given item
-
count
public static int count(Item... items)
Returns the total amount of items in the container in which the item has the same ID as the given items.- Parameters:
items
- the items- Returns:
- the total amount of items in the container in which the item has the same ID as the given items
-
count
public static int count(ItemVariant itemVariant)
Returns the total amount of items in the container in which the item matches the variant.- Parameters:
itemVariant
- the variant of the item- Returns:
- the total amount of items in the container in which the item matches the variant
-
count
public static int count(java.util.function.Predicate<Item> predicate)
Returns the total amount of items in the container that satisfy the given predicate.- Parameters:
predicate
- the condition to be satisfied by the items- Returns:
- the total amount of items in the container that satisfy the given predicate
-
contains
public static boolean contains(int id)
Checks if the container contains an item with the given ID.- Parameters:
id
- the ID of the item- Returns:
- true if the container contains an item with the given ID, false otherwise
-
contains
public static boolean contains(int... ids)
Checks if the container contains items with the given IDs.- Parameters:
ids
- the IDs of the items- Returns:
- true if the container contains items with the given IDs, false otherwise
-
contains
public static boolean contains(java.lang.String name)
Checks if the container contains an item with the given name.- Parameters:
name
- the name of the item- Returns:
- true if the container contains an item with the given name, false otherwise
-
contains
public static boolean contains(java.lang.String... names)
Checks if the container contains items with the given names.- Parameters:
names
- the names of the items- Returns:
- true if the container contains items with the given names, false otherwise
-
contains
public static boolean contains(Item item)
Checks if the container contains the given item.- Parameters:
item
- the item- Returns:
- true if the container contains the given item, false otherwise
-
contains
public static boolean contains(Item... items)
Checks if the container contains the given items.- Parameters:
items
- the items- Returns:
- true if the container contains the given items, false otherwise
-
contains
public static boolean contains(ItemVariant itemVariant)
Checks if the container contains the given item variant.- Parameters:
itemVariant
- the variant of the item- Returns:
- true if the container contains the given item variant, false otherwise
-
contains
public static boolean contains(java.util.function.Predicate<Item> predicate)
Checks if the container contains an item that satisfies the given predicate.- Parameters:
predicate
- the condition to be satisfied by the item- Returns:
- true if the container contains an item that satisfies the given predicate, false otherwise
-
containsAll
public static boolean containsAll(int id)
Checks if the container contains all items with the given ID.- Parameters:
id
- the ID of the item- Returns:
- true if the container contains all items with the given ID, false otherwise
-
containsAll
public static boolean containsAll(int... ids)
Checks if the container contains all items with the given IDs.- Parameters:
ids
- the IDs of the items- Returns:
- true if the container contains all items with the given IDs, false otherwise
-
containsAll
public static boolean containsAll(java.lang.String name)
Checks if the container contains all items with the given name.- Parameters:
name
- the name of the item- Returns:
- true if the container contains all items with the given name, false otherwise
-
containsAll
public static boolean containsAll(java.lang.String... names)
Checks if the container contains all items with the given names.- Parameters:
names
- the names of the items- Returns:
- true if the container contains all items with the given names, false otherwise
-
containsAll
public static boolean containsAll(Item item)
Checks if the container contains all items with the given item.- Parameters:
item
- the item- Returns:
- true if the container contains all items with the given item, false otherwise
-
containsAll
public static boolean containsAll(Item... items)
Checks if the container contains all items with the given items.- Parameters:
items
- the items- Returns:
- true if the container contains all items with the given items, false otherwise
-
containsAll
public static boolean containsAll(ItemVariant itemVariant)
Checks if the container contains all items with the given item variant.- Parameters:
itemVariant
- the variant of the item- Returns:
- true if the container contains all items with the given item variant, false otherwise
-
containsAll
public static boolean containsAll(java.util.function.Predicate<Item> predicate)
Checks if the container contains all items that satisfy the given predicate.- Parameters:
predicate
- the condition to be satisfied by the items- Returns:
- true if the container contains all items that satisfy the given predicate, false otherwise
-
onlyContains
public static boolean onlyContains(int id)
Checks if the container only contains an item with the given ID.- Parameters:
id
- the ID of the item- Returns:
- true if the container only contains an item with the given ID, false otherwise
-
onlyContains
public static boolean onlyContains(int... ids)
Checks if the container only contains items with the given IDs.- Parameters:
ids
- the IDs of the items- Returns:
- true if the container only contains items with the given IDs, false otherwise
-
onlyContains
public static boolean onlyContains(java.lang.String name)
Checks if the container only contains an item with the given name.- Parameters:
name
- the name of the item- Returns:
- true if the container only contains an item with the given name, false otherwise
-
onlyContains
public static boolean onlyContains(java.lang.String... names)
Checks if the container only contains items with the given names.- Parameters:
names
- the names of the items- Returns:
- true if the container only contains items with the given names, false otherwise
-
onlyContains
public static boolean onlyContains(Item item)
Checks if the container only contains the given item.- Parameters:
item
- the item- Returns:
- true if the container only contains the given item, false otherwise
-
onlyContains
public static boolean onlyContains(Item... items)
Checks if the container only contains the given items.- Parameters:
items
- the items- Returns:
- true if the container only contains the given items, false otherwise
-
onlyContains
public static boolean onlyContains(ItemVariant itemVariant)
Checks if the container only contains the given item variant.- Parameters:
itemVariant
- the variant of the item- Returns:
- true if the container only contains the given item variant, false otherwise
-
onlyContains
public static boolean onlyContains(java.util.function.Predicate<Item> predicate)
Checks if the container only contains items that satisfy the given predicate.- Parameters:
predicate
- the condition to be satisfied by the items- Returns:
- true if the container only contains items that satisfy the given predicate, false otherwise
-
-