Class Equipment
- java.lang.Object
-
- net.eternalclient.api.containers.equipment.Equipment
-
public class Equipment extends java.lang.Object
A class to manage equipment related functionality.
-
-
Constructor Summary
Constructors Constructor Description Equipment()
-
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 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(EquipmentSlot... slots)
Counts the total number of items in the given equipment slots.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
equip(int id)
Equips an item with the specified ID.static boolean
equip(java.lang.String name)
Equips an item with the specified name.static boolean
equip(java.util.function.Predicate<Item> predicate)
Equips an item from the inventory based on 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 boolean
forceInteract(EquipmentSlot slot, java.lang.String action, int index)
Forces an interaction on the specified equipment slot.static boolean
forceUnEquip(EquipmentSlot slot)
Checks if the given equipment slot is empty and returns true.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 java.lang.String[]
getActionsForSlot(EquipmentSlot slot)
Returns the actions associated with the given EquipmentSlot.static ItemContainerCache
getCache()
static RSItemContainer
getContainer()
Returns the item container 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(EquipmentSlot slot)
Returns the ID of the item in the specified equipment slot.static Item
getItemInSlot(EquipmentSlot slot)
Retrieves the item in the specified equipment slot.static java.lang.String
getNameForSlot(EquipmentSlot slot)
Returns the name of the item in the specified equipment slot.static int
getSize()
static java.awt.Rectangle
getSlotBounds(EquipmentSlot slot)
Returns the bounds of the specified equipment slot.static EquipmentSlot
getSlotForItem(java.util.function.Predicate<Item> predicate)
Returns the EquipmentSlot for the specified item predicate.static boolean
interact(java.util.function.Predicate<Item> itemPredicate, int index)
Interacts with an item based on the given predicate and index.static boolean
interact(java.util.function.Predicate<Item> itemPredicate, java.lang.String action)
Interacts with an item that matches the given predicate using the specified action.static boolean
interact(java.util.function.Predicate<Item> itemPredicate, java.util.function.Predicate<java.lang.String> actionPredicate)
Interacts with an item in the inventory using a specified item predicate and action predicate.static boolean
interact(EquipmentSlot slot, java.lang.String action)
Interacts with a specific equipment slot by performing a given action.static boolean
isEmpty()
Checks if the container is empty.static boolean
isEquipmentInterfaceOpen()
Checks if the equipment interface is open.static boolean
isFull()
Checks if the container is full.static boolean
isSlotEmpty(EquipmentSlot slot)
Checks if a given equipment slot is empty.static boolean
isSlotFull(EquipmentSlot slot)
Checks if the specified equipment slot is occupied.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 boolean
open()
Opens the equipment tab and returns true if successful.static boolean
unEquip(EquipmentSlot slot)
Unequips an item from the specified equipment slot.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 item container with the specified node ID.- Returns:
- the item container
-
getSlotBounds
public static java.awt.Rectangle getSlotBounds(EquipmentSlot slot)
Returns the bounds of the specified equipment slot.- Parameters:
slot
- the equipment slot to retrieve the bounds for- Returns:
- the bounds of the equipment slot
-
getActionsForSlot
public static java.lang.String[] getActionsForSlot(EquipmentSlot slot)
Returns the actions associated with the given EquipmentSlot.- Parameters:
slot
- the EquipmentSlot to retrieve actions for- Returns:
- an array of actions associated with the EquipmentSlot, or null if no actions are found
-
getItemInSlot
public static Item getItemInSlot(EquipmentSlot slot)
Retrieves the item in the specified equipment slot.- Parameters:
slot
- The equipment slot to retrieve the item from.- Returns:
- The item in the equipment slot, or null if there is no item.
-
getIdForSlot
public static int getIdForSlot(EquipmentSlot slot)
Returns the ID of the item in the specified equipment slot.- Parameters:
slot
- the equipment slot to get the ID from- Returns:
- the ID of the item in the slot, or -1 if the slot is empty
-
getNameForSlot
public static java.lang.String getNameForSlot(EquipmentSlot slot)
Returns the name of the item in the specified equipment slot.- Parameters:
slot
- the equipment slot to retrieve the item from- Returns:
- the name of the item in the slot, or null if no item is present
-
getSlotForItem
public static EquipmentSlot getSlotForItem(java.util.function.Predicate<Item> predicate)
Returns the EquipmentSlot for the specified item predicate.- Parameters:
predicate
- the predicate used to filter the items- Returns:
- the EquipmentSlot for the matching item, or null if not found
-
isSlotFull
public static boolean isSlotFull(EquipmentSlot slot)
Checks if the specified equipment slot is occupied.- Parameters:
slot
- the equipment slot to be checked- Returns:
- true if the slot is occupied, false otherwise
-
isSlotEmpty
public static boolean isSlotEmpty(EquipmentSlot slot)
Checks if a given equipment slot is empty.- Parameters:
slot
- the equipment slot to check- Returns:
- true if the slot is empty, false otherwise
-
open
public static boolean open()
Opens the equipment tab and returns true if successful.- Returns:
- true if the equipment tab is successfully opened, otherwise false.
-
interact
public static boolean interact(EquipmentSlot slot, java.lang.String action)
Interacts with a specific equipment slot by performing a given action.- Parameters:
slot
- the equipment slot to interact withaction
- the action to perform on the equipment slot- Returns:
- true if the interaction is successful, false otherwise
-
interact
public static boolean interact(java.util.function.Predicate<Item> itemPredicate, java.lang.String action)
Interacts with an item that matches the given predicate using the specified action.- Parameters:
itemPredicate
- the predicate used to determine if an item matchesaction
- the action to be performed on the matched item- Returns:
- true if the item was found and interacted with successfully, false otherwise
-
interact
public static boolean interact(java.util.function.Predicate<Item> itemPredicate, java.util.function.Predicate<java.lang.String> actionPredicate)
Interacts with an item in the inventory using a specified item predicate and action predicate.- Parameters:
itemPredicate
- the predicate used to filter the items in the inventoryactionPredicate
- the predicate used to filter the available actions for the item- Returns:
- true if the item was successfully interacted with, false otherwise
-
interact
public static boolean interact(java.util.function.Predicate<Item> itemPredicate, int index)
Interacts with an item based on the given predicate and index.- Parameters:
itemPredicate
- the predicate to determine the item to interact withindex
- the index of the action to perform- Returns:
- true if the interaction was successful, false otherwise
-
unEquip
public static boolean unEquip(EquipmentSlot slot)
Unequips an item from the specified equipment slot.- Parameters:
slot
- the equipment slot to be un-equipped from- Returns:
- true if the slot is empty or un-equipping is successful, false otherwise
-
forceUnEquip
public static boolean forceUnEquip(EquipmentSlot slot)
Checks if the given equipment slot is empty and returns true. Otherwise, forces an interaction to remove the equipped item and returns the result.- Parameters:
slot
- the equipment slot to unequip from- Returns:
- true if the slot is empty, or the result of the force interaction to remove the equipped item
-
forceInteract
public static boolean forceInteract(EquipmentSlot slot, java.lang.String action, int index)
Forces an interaction on the specified equipment slot.- Parameters:
slot
- the equipment slot to interact withaction
- the action to performindex
- the index of the action- Returns:
- true if interaction was successful, false otherwise
-
equip
public static boolean equip(int id)
Equips an item with the specified ID.- Parameters:
id
- the ID of the item to be equipped- Returns:
- true if the item was successfully equipped, false otherwise
-
equip
public static boolean equip(java.lang.String name)
Equips an item with the specified name.- Parameters:
name
- the name of the item to be equipped- Returns:
- true if the item was successfully equipped, false otherwise
-
equip
public static boolean equip(java.util.function.Predicate<Item> predicate)
Equips an item from the inventory based on the given predicate.- Parameters:
predicate
- the condition to identify the item to be equipped- Returns:
- true if the item was successfully equipped, false otherwise
-
isEquipmentInterfaceOpen
public static boolean isEquipmentInterfaceOpen()
Checks if the equipment interface is open.- Returns:
- true if the equipment interface is open, false otherwise.
-
count
public static int count(EquipmentSlot... slots)
Counts the total number of items in the given equipment slots.- Parameters:
slots
- Array of equipment slots.- Returns:
- Total number of items in the equipment slots.
-
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
-
-