Package rsb.wrappers
Class RSItem
java.lang.Object
rsb.methods.MethodProvider
rsb.wrappers.RSItem
- All Implemented Interfaces:
Clickable
,Clickable07
Represents an item (with an id and stack size). May or may not
wrap a component.
-
Field Summary
Fields inherited from class rsb.methods.MethodProvider
methods
-
Constructor Summary
ConstructorsConstructorDescriptionRSItem
(MethodContext ctx, net.runelite.api.TileItem item) RSItem
(MethodContext ctx, RSWidget item) RSItem
(MethodContext ctx, RSWidgetItem item) -
Method Summary
Modifier and TypeMethodDescriptionboolean
Performs the given action on the component wrapped by this RSItem if possible.boolean
Performs the given action on the component wrapped by this RSItem if possible.boolean
doAction
(Predicate<RSMenuNode> predicate) boolean
doClick()
boolean
doClick
(boolean left) Clicks the component wrapped by this RSItem if possible.boolean
doHover()
Gets the component wrapped by this RSItem.net.runelite.api.ItemComposition
Gets this item's definition if available.String[]
int
getID()
Gets this item's id.String[]
Provides a list of inventory actions for the given item.getItem()
Gets the item wrapped by this RSItemgetName()
Gets the name of this item using the wrapped component's name if available, otherwise the definition if available.int
Gets this item's stack size.boolean
Returns whether this item has an available definition.boolean
boolean
Checks whether a valid component is being wrapped.boolean
Checks whether a valid item is being wrapped.
-
Constructor Details
-
RSItem
-
RSItem
-
RSItem
-
-
Method Details
-
getDefinition
public net.runelite.api.ItemComposition getDefinition()Gets this item's definition if available.- Returns:
- The RSItemDef; or
null
if unavailable.
-
getID
public int getID()Gets this item's id.- Returns:
- The id.
-
getStackSize
public int getStackSize()Gets this item's stack size.- Returns:
- The stack size.
-
hasDefinition
public boolean hasDefinition()Returns whether this item has an available definition.- Returns:
true
if an item definition is available; otherwisefalse
.
-
getItem
Gets the item wrapped by this RSItem- Returns:
- The wrapped item or
null
-
getComponent
Gets the component wrapped by this RSItem.- Returns:
- The wrapped component or
null
.
-
isComponentValid
public boolean isComponentValid()Checks whether a valid component is being wrapped.- Returns:
true
if there is a visible wrapped component.
-
isItemValid
public boolean isItemValid()Checks whether a valid item is being wrapped.- Returns:
true
if there is a visible wrapped item
-
getName
Gets the name of this item using the wrapped component's name if available, otherwise the definition if available.- Returns:
- The item's name or
null
if not found.
-
getInventoryActions
Provides a list of inventory actions for the given item.- Returns:
- The list of inventory actions for the item
-
getGroundActions
-
doAction
Performs the given action on the component wrapped by this RSItem if possible. -
doAction
Performs the given action on the component wrapped by this RSItem if possible. -
doAction
-
doClick
public boolean doClick(boolean left) Clicks the component wrapped by this RSItem if possible. -
doClick
public boolean doClick() -
doHover
public boolean doHover() -
isClickable
public boolean isClickable()- Specified by:
isClickable
in interfaceClickable07
-