Class Equipment
- java.lang.Object
- 
- org.dreambot.api.methods.container.impl.equipment.Equipment
 
- 
 public class Equipment extends java.lang.Object
- 
- 
Method SummaryAll Methods Static Methods Concrete Methods Deprecated Methods Modifier and Type Method Description static voidadd(int index, Item t)static booleanadd(Item t)static @NonNull java.util.List<@Nullable Item>all()static @NonNull java.util.List<@NonNull Item>all(@NonNull Filter<Item> filter)A list of all the filtered items.static intcapacity()Gets the capacity for the equipment interfacestatic booleancontains(int id)Contains boolean.static booleancontains(int[] ids)static booleancontains(@NonNull java.lang.Object o)static booleancontains(@NonNull Filter<Item> filter)Checks if your equipment contains one item which meets the specified filter.static booleancontains(java.lang.Integer... ids)Checks if your equipment contains one item which meets one of the specified ids.static booleancontains(java.lang.String string)Determines if collection contains item with specified name.static booleancontains(java.lang.String... names)Checks if your equipment contains one item which meets one of the specified names.static booleancontainsAll(int... ids)Checks if your equipment contains all of the items with specified IDsstatic booleancontainsAll(@NonNull java.util.Collection<?> collection)Checks if your equipment contains all of the items in the collectionsstatic booleancontainsAll(java.lang.String... names)Checks if your equipment contains all of the items with names specifiedstatic intcount(int id)Count of all the items that match the search.static intcount(@NonNull Filter<Item> filter)Count of all the items that match the search.static intcount(java.lang.String name)Count of all the items that match the search.static intemptySlotCount()Gets the number of slots that do not contain itemsstatic booleanequip(@NonNull EquipmentSlot slot, int[] ids)static booleanequip(@NonNull EquipmentSlot slot, @NonNull Filter<Item> filter)Equips the first item that matches the given filter in the slot providedstatic booleanequip(@NonNull EquipmentSlot slot, java.lang.Integer... ids)Equips the first item that matches one of the given IDs in the slot providedstatic booleanequip(@NonNull EquipmentSlot slot, java.lang.String... names)Equips the first item that matches one of the given names in the slot providedstatic @NonNull java.util.List<@NonNull Item>except(@NonNull Filter<Item> filter)Get all items which do not fit the given criteria.static intfullSlotCount()Gets the number of slots that contains itemsstatic @Nullable Itemget(int id)static @Nullable Itemget(int[] ids)static @Nullable Itemget(@NonNull Filter<Item> filter)static @Nullable Itemget(java.lang.Integer... ids)static @Nullable Itemget(java.lang.String name)Get item for specified name.static @Nullable Itemget(java.lang.String... names)static intgetFirstEmptySlot()Gets the first empty slot in your equipment.static intgetFirstFullSlot()Gets the next full slot in your equipmentstatic intgetIdForSlot(int slot)Gets the Id of the Item in the slot.static intgetIdForSlot(@NonNull EquipmentSlot slot)Gets the ID of theItemin theEquipmentSlotstatic @Nullable ItemgetItemInSlot(int slot)Gets item in specified slot.static @Nullable ItemgetItemInSlot(@NonNull EquipmentSlot equipmentSlot)Gets item in specified slot.static @NonNull java.lang.StringgetNameForSlot(int slot)Gets the Name for the Item in the slot.static @NonNull java.lang.StringgetNameForSlot(@NonNull EquipmentSlot slot)Gets the Name for theItemin theEquipmentSlot.static @Nullable java.awt.RectanglegetSlotBounds(@NonNull EquipmentSlot slot)Gets the rectangular bounds of theWidgetChildfor the givenEquipmentSlotstatic @Nullable EquipmentSlotgetSlotForItem(@NonNull Filter<Item> filter)Gets theEquipmentSlotfor a given item filterstatic @Nullable WidgetChildgetWidgetForSlot(@NonNull EquipmentSlot slot)Gets theWidgetChildfor theEquipmentSlotgivenstatic booleaninteract(@NonNull EquipmentSlot slot, @Nullable java.lang.String action)Interacts with the slot specified with the action specified Opens theTab.EQUIPMENTtab if neededstatic booleanisEmpty()static booleanisFull()Determines if equipment full.static booleanisLoaded()Checks if the internal equipment tables have been loaded Used primarily for ItemEventManagersstatic booleanisOpen()static booleanisSlotEmpty(int slot)Checks if the given slot is empty Uses the values fromEquipmentSlot.getSlot()static booleanisSlotEmpty(@NonNull EquipmentSlot slot)Checks if the givenEquipmentSlotis emptystatic booleanisSlotFull(int slot)Checks if the slot has an Item in it slot is based onEquipmentSlot.getSlot()static booleanisSlotFull(@NonNull EquipmentSlot slot)Checks if the givenEquipmentSlotis fullstatic booleanonlyContains(int[] ids)static booleanonlyContains(@NonNull Filter<Item> filter)Checks if your Equipment only contains items that match the Filterstatic booleanonlyContains(java.lang.Integer... ids)Checks if your Equipment only contains items with specified IDsstatic booleanonlyContains(java.lang.String... names)Checks if your equipment only contains items with specified namesstatic booleanopen()Opens the equipment tabstatic @Nullable Itemset(int index, Item element)static intsize()static intslot(int id)Gets the slot for the item with specified ID.static intslot(@NonNull java.lang.String name)Gets the slot for the item with specified name.static intslot(@NonNull Filter<Item> filter)Gets the slot for the item with specified name.static booleanslotContains(int slot, int[] ids)static booleanslotContains(int slot, @NonNull Filter<Item> filter)Checks if the slot contains items that matches the filter.static booleanslotContains(int slot, @NonNull Item item)Checks if the slot contains the givenItemslot based onEquipmentSlot.getSlot()static booleanslotContains(int slot, java.lang.Integer... ids)Checks if the slot contains an item that matches any the given ids.static booleanslotContains(int slot, java.lang.String name)Checks if the slot contains anItemthat matches the given name.static booleanslotContains(int slot, java.lang.String... names)Checks if the slot contains any items that match the given names.static booleanslotContains(@NonNull EquipmentSlot slot, int[] ids)static booleanslotContains(@NonNull EquipmentSlot slot, @NonNull Filter<Item> filter)Checks if theEquipmentSlotcontains items that matches the given filter.static booleanslotContains(@NonNull EquipmentSlot slot, @NonNull Item item)Checks if theEquipmentSlotcontains the givenItemstatic booleanslotContains(@NonNull EquipmentSlot slot, java.lang.Integer... ids)Checks if theEquipmentSlotcontains an item that matches any the given ids.static booleanslotContains(@NonNull EquipmentSlot slot, java.lang.String name)Checks if theEquipmentSlotcontains an item that matches the given name.static booleanslotContains(@NonNull EquipmentSlot slot, java.lang.String... names)Checks if theEquipmentSlotcontains any items that match the given names.static booleanslotNameContains(int slot, @NonNull java.lang.String sub)Deprecated.static booleanslotNameContains(@NonNull EquipmentSlot slot, @NonNull java.lang.String sub)Deprecated.static @Nullable java.lang.Object @NonNull []toArray()static booleanunequip(@NonNull EquipmentSlot slot)Unequips the equipment from the equipment slotstatic booleanunequip(@NonNull Filter<Item> filter)Unequips an item that matches the given Filterstatic intwidgetChildId()Gets the child ID of theWidgetChildfor the equipment interfacestatic intwidgetParentId()Gets the ID of the parentWidgetfor the Equipment Interface
 
- 
- 
- 
Method Detail- 
widgetParentIdpublic static int widgetParentId() Gets the ID of the parentWidgetfor the Equipment Interface- Returns:
- ID of the parent widget for equipment interface
 
 - 
widgetChildIdpublic static int widgetChildId() Gets the child ID of theWidgetChildfor the equipment interface- Returns:
- Child ID of the WidgetChild for equipment interface
 
 - 
capacitypublic static int capacity() Gets the capacity for the equipment interface
 - 
allpublic static @NonNull java.util.List<@Nullable Item> all() 
 - 
isLoadedpublic static boolean isLoaded() Checks if the internal equipment tables have been loaded Used primarily for ItemEventManagers- Returns:
- True if the equipment tables have been loaded
 
 - 
equippublic static boolean equip(@NonNull EquipmentSlot slot, java.lang.Integer... ids) Equips the first item that matches one of the given IDs in the slot provided- Parameters:
- slot-- EquipmentSlotof the item to equip
- ids- IDs of the Items to search for to equip
- Returns:
- true if equipped successfully or already equipped, else false
 
 - 
equippublic static boolean equip(@NonNull EquipmentSlot slot, int[] ids) 
 - 
equippublic static boolean equip(@NonNull EquipmentSlot slot, java.lang.String... names) Equips the first item that matches one of the given names in the slot provided- Parameters:
- slot-- EquipmentSlotof the item to equip
- names- names of the Items to search for to equip
- Returns:
- true if equipped successfully or already equipped, else false
 
 - 
equippublic static boolean equip(@NonNull EquipmentSlot slot, @NonNull Filter<Item> filter) Equips the first item that matches the given filter in the slot provided- Parameters:
- slot-- EquipmentSlotof the item to equip
- filter- filter of the Items to search for to equip
- Returns:
- true if equipped successfully or already equipped, else false
 
 - 
getSlotForItempublic static @Nullable EquipmentSlot getSlotForItem(@NonNull Filter<Item> filter) Gets theEquipmentSlotfor a given item filter- Parameters:
- filter- Filter to match an item with
- Returns:
- the EquipmentSlotof the item if found, otherwise null
 
 - 
unequippublic static boolean unequip(@NonNull EquipmentSlot slot) Unequips the equipment from the equipment slot- Parameters:
- slot-- EquipmentSlotto unequip from
- Returns:
- true if successfully unequipped
 
 - 
unequippublic static boolean unequip(@NonNull Filter<Item> filter) Unequips an item that matches the given Filter- Parameters:
- filter- Filter of the item to unequip
- Returns:
- True if can't find item slot or successfully unequipped
 
 - 
openpublic static boolean open() Opens the equipment tab- Returns:
- true if successfully opened or already open
 
 - 
interactpublic static boolean interact(@NonNull EquipmentSlot slot, @Nullable java.lang.String action) Interacts with the slot specified with the action specified Opens theTab.EQUIPMENTtab if needed- Parameters:
- slot-- EquipmentSlotto interact with
- action- Action to use for the interaction
- Returns:
- True if EquipmentSlotcontains an item and interaction is successful, else false
 
 - 
getWidgetForSlotpublic static @Nullable WidgetChild getWidgetForSlot(@NonNull EquipmentSlot slot) Gets theWidgetChildfor theEquipmentSlotgiven- Parameters:
- slot- slot to get WidgetChild of
- Returns:
- WidgetChild of the given equipment slot
 
 - 
getSlotBoundspublic static @Nullable java.awt.Rectangle getSlotBounds(@NonNull EquipmentSlot slot) Gets the rectangular bounds of theWidgetChildfor the givenEquipmentSlot- Parameters:
- slot- Slot to get the bounds of
- Returns:
- Rectangular bounds of the slot, null if WidgetChildis not found.
 
 - 
fullSlotCountpublic static int fullSlotCount() Gets the number of slots that contains items
 - 
emptySlotCountpublic static int emptySlotCount() Gets the number of slots that do not contain items
 - 
isSlotEmptypublic static boolean isSlotEmpty(int slot) Checks if the given slot is empty Uses the values fromEquipmentSlot.getSlot()- Parameters:
- slot- slot to check, based on- EquipmentSlot.getSlot()
- Returns:
- True if slot empty or if given slot is larger than the number of available slots, else false.
 
 - 
isSlotEmptypublic static boolean isSlotEmpty(@NonNull EquipmentSlot slot) Checks if the givenEquipmentSlotis empty- Parameters:
- slot- EquipmentSlot to check if empty
- Returns:
- True if empty, else false.
 
 - 
isSlotFullpublic static boolean isSlotFull(int slot) Checks if the slot has an Item in it slot is based onEquipmentSlot.getSlot()- Parameters:
- slot- slot to check
- Returns:
- True if there's an item there, else False
 
 - 
isSlotFullpublic static boolean isSlotFull(@NonNull EquipmentSlot slot) Checks if the givenEquipmentSlotis full- Parameters:
- slot- EquipmentSlot to check
- Returns:
- True if given slot contains an item, else false.
 
 - 
onlyContainspublic static boolean onlyContains(java.lang.String... names) Checks if your equipment only contains items with specified names- Parameters:
- names- Names of items to look for
- Returns:
- True if Equipment only contains items with the given names, else False
 
 - 
onlyContainspublic static boolean onlyContains(java.lang.Integer... ids) Checks if your Equipment only contains items with specified IDs- Parameters:
- ids- IDs of items to check for
- Returns:
- True if Equipment only contains items with specified IDs, else False
 
 - 
onlyContainspublic static boolean onlyContains(int[] ids) 
 - 
onlyContainspublic static boolean onlyContains(@NonNull Filter<Item> filter) Checks if your Equipment only contains items that match the Filter- Parameters:
- filter- Filter to pass items through
- Returns:
- True if Equipment only contains items matching Filter, else False
 
 - 
slotContainspublic static boolean slotContains(int slot, java.lang.String... names)Checks if the slot contains any items that match the given names. slot is based onEquipmentSlot.getSlot()- Parameters:
- slot- slot to check, based on- EquipmentSlot.getSlot()
- names- names of the items to check
- Returns:
- true if the given slot contains an item that matches any of the given names, else false
 
 - 
slotContainspublic static boolean slotContains(@NonNull EquipmentSlot slot, java.lang.String... names) Checks if theEquipmentSlotcontains any items that match the given names.- Parameters:
- slot- EquipmentSlot to check
- names- names of the items to check
- Returns:
- true if given slot contains any items matching the given names, else false
 
 - 
slotContainspublic static boolean slotContains(int slot, java.lang.String name)Checks if the slot contains anItemthat matches the given name. slot is based onEquipmentSlot.getSlot()- Parameters:
- slot- slot to check, based on- EquipmentSlot.getSlot()
- name- name of the item to check
- Returns:
- true if the given slot contains an item that contains the given name, else false
 
 - 
slotContainspublic static boolean slotContains(@NonNull EquipmentSlot slot, java.lang.String name) Checks if theEquipmentSlotcontains an item that matches the given name.- Parameters:
- slot- EquipmentSlot to check
- name- name of the item to check
- Returns:
- true if given slot contains an item that contains the given name, else false
 
 - 
slotNameContains@Deprecated public static boolean slotNameContains(int slot, @NonNull java.lang.String sub)Deprecated.
 - 
slotNameContains@Deprecated public static boolean slotNameContains(@NonNull EquipmentSlot slot, @NonNull java.lang.String sub) Deprecated.
 - 
slotContainspublic static boolean slotContains(int slot, java.lang.Integer... ids)Checks if the slot contains an item that matches any the given ids. slot based onEquipmentSlot.getSlot()- Parameters:
- slot- slot to check
- ids- ids of the items to check.
- Returns:
- True if slot contains an item that matches any of the given ids, else false.
 
 - 
slotContainspublic static boolean slotContains(int slot, int[] ids)
 - 
slotContainspublic static boolean slotContains(@NonNull EquipmentSlot slot, java.lang.Integer... ids) Checks if theEquipmentSlotcontains an item that matches any the given ids.- Parameters:
- slot- slot to check
- ids- ids of the items to check.
- Returns:
- True if slot contains an item that matches any of the given ids, else false.
 
 - 
slotContainspublic static boolean slotContains(@NonNull EquipmentSlot slot, int[] ids) 
 - 
slotContainspublic static boolean slotContains(int slot, @NonNull Item item)Checks if the slot contains the givenItemslot based onEquipmentSlot.getSlot()- Parameters:
- slot- slot to check
- item- The Item to check.
- Returns:
- True if slot contains the given item, else false.
 
 - 
slotContainspublic static boolean slotContains(@NonNull EquipmentSlot slot, @NonNull Item item) Checks if theEquipmentSlotcontains the givenItem- Parameters:
- slot- slot to check
- item- The Item to check.
- Returns:
- True if slot contains the given item, else false.
 
 - 
slotContainspublic static boolean slotContains(int slot, @NonNull Filter<Item> filter)Checks if the slot contains items that matches the filter. slot based onEquipmentSlot.getSlot()- Parameters:
- slot- slot to check for the given filter
- filter- Filter to check
- Returns:
- True if slot contains an Item matching the given filter, else false.
 
 - 
slotContainspublic static boolean slotContains(@NonNull EquipmentSlot slot, @NonNull Filter<Item> filter) Checks if theEquipmentSlotcontains items that matches the given filter.- Parameters:
- slot- slot to check for the given filter
- filter- Filter to check
- Returns:
- True if slot contains an Item matching the given filter, else false.
 
 - 
getFirstEmptySlotpublic static int getFirstEmptySlot() Gets the first empty slot in your equipment.- Returns:
- slot number, if equipment is full -1.
 
 - 
getFirstFullSlotpublic static int getFirstFullSlot() Gets the next full slot in your equipment- Returns:
- slot number, if equipment is empty -1
 
 - 
getIdForSlotpublic static int getIdForSlot(int slot) Gets the Id of the Item in the slot. slot based onEquipmentSlot.getSlot()- Parameters:
- slot- Slot to get item id of.
- Returns:
- Item ID or -1 if no item.
 
 - 
getIdForSlotpublic static int getIdForSlot(@NonNull EquipmentSlot slot) Gets the ID of theItemin theEquipmentSlot- Parameters:
- slot- slot to get item id of
- Returns:
- Item ID or -1 if slot does not contain an item
 
 - 
getNameForSlotpublic static @NonNull java.lang.String getNameForSlot(int slot) Gets the Name for the Item in the slot. slot based onEquipmentSlot.getSlot()- Parameters:
- slot- Slot to get item name of.
- Returns:
- Item name or "" if item is null.
 
 - 
getNameForSlotpublic static @NonNull java.lang.String getNameForSlot(@NonNull EquipmentSlot slot) Gets the Name for theItemin theEquipmentSlot. NOTE: Does not return null if slot is empty.- Parameters:
- slot- Slot to get item name of.
- Returns:
- Item name or empty String if slot does not contain an item
 
 - 
slotpublic static int slot(int id) Gets the slot for the item with specified ID.- Parameters:
- id- ID of item to get slot of.
- Returns:
- Item slot or -1 if Item is null.
 
 - 
slotpublic static int slot(@NonNull java.lang.String name) Gets the slot for the item with specified name.- Parameters:
- name- Name of item to get slot of.
- Returns:
- Item slot or -1 if Item is null.
 
 - 
slotpublic static int slot(@NonNull Filter<Item> filter) Gets the slot for the item with specified name.- Parameters:
- filter- filter of the item to get slot of.
- Returns:
- Item slot or -1 if Item is null.
 
 - 
addpublic static boolean add(Item t) 
 - 
toArraypublic static @Nullable java.lang.Object @NonNull [] toArray() 
 - 
addpublic static void add(int index, Item t)
 - 
allpublic static @NonNull java.util.List<@NonNull Item> all(@NonNull Filter<Item> filter) A list of all the filtered items.- Parameters:
- filter- the filter to search with.
- Returns:
- the list of all filtered items.
 
 - 
getItemInSlotpublic static @Nullable Item getItemInSlot(int slot) Gets item in specified slot. slot based onEquipmentSlot.getSlot()- Parameters:
- slot- the index.
- Returns:
- the item in slot.
 
 - 
getItemInSlotpublic static @Nullable Item getItemInSlot(@NonNull EquipmentSlot equipmentSlot) Gets item in specified slot.- Parameters:
- equipmentSlot- the- EquipmentSlot.
- Returns:
- the item in slot.
 
 - 
getpublic static @Nullable Item get(int id) 
 - 
getpublic static @Nullable Item get(java.lang.Integer... ids) 
 - 
getpublic static @Nullable Item get(int[] ids) 
 - 
getpublic static @Nullable Item get(java.lang.String name) Get item for specified name.- Parameters:
- name- the name of the item.
- Returns:
- the item if list contains it, otherwise null.
 
 - 
getpublic static @Nullable Item get(java.lang.String... names) 
 - 
exceptpublic static @NonNull java.util.List<@NonNull Item> except(@NonNull Filter<Item> filter) Get all items which do not fit the given criteria.- Parameters:
- filter- The filter of the items to ignore.
- Returns:
- The list of items found which do not match the given criteria.
 
 - 
sizepublic static int size() 
 - 
isEmptypublic static boolean isEmpty() 
 - 
containspublic static boolean contains(int id) Contains boolean.- Parameters:
- id- the id
- Returns:
- the boolean
 
 - 
containspublic static boolean contains(java.lang.String string) Determines if collection contains item with specified name.- Parameters:
- string- the name of the item.
- Returns:
- true if collection contains item, otherwise false.
 
 - 
containsAllpublic static boolean containsAll(java.lang.String... names) Checks if your equipment contains all of the items with names specified- Parameters:
- names- Names of items to check for
- Returns:
- True if equipment contains all names, else False
 
 - 
containsAllpublic static boolean containsAll(int... ids) Checks if your equipment contains all of the items with specified IDs- Parameters:
- ids- IDs of items to check for
- Returns:
- True if equipment contains all IDs, else false.
 
 - 
containsAllpublic static boolean containsAll(@NonNull java.util.Collection<?> collection) Checks if your equipment contains all of the items in the collections- Parameters:
- collection- The collection of items to compare against
- Returns:
- True if equipment contains all of the items, else false.
 
 - 
containspublic static boolean contains(java.lang.Integer... ids) Checks if your equipment contains one item which meets one of the specified ids.- Parameters:
- ids- Item IDs to check for
- Returns:
- True if equipment contains one of, else false
 
 - 
containspublic static boolean contains(int[] ids) 
 - 
containspublic static boolean contains(java.lang.String... names) Checks if your equipment contains one item which meets one of the specified names.- Parameters:
- names- names to check for
- Returns:
- true if equipment contains one of, else false.
 
 - 
containspublic static boolean contains(@NonNull Filter<Item> filter) Checks if your equipment contains one item which meets the specified filter.- Parameters:
- filter- the filter to search with.
- Returns:
- true if equipment contains one of, else false.
 
 - 
containspublic static boolean contains(@NonNull java.lang.Object o) 
 - 
isFullpublic static boolean isFull() Determines if equipment full.
 - 
countpublic static int count(java.lang.String name) Count of all the items that match the search.- Parameters:
- name- the name of the item.
- Returns:
- the total count of matching items.
 
 - 
countpublic static int count(int id) Count of all the items that match the search.- Parameters:
- id- the id of them item.
- Returns:
- the total count of matching items.
 
 - 
countpublic static int count(@NonNull Filter<Item> filter) Count of all the items that match the search.- Parameters:
- filter- the filter to count with
- Returns:
- the total count of matching items.
 
 - 
isOpenpublic static boolean isOpen() 
 
- 
 
-