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 TypeMethodDescriptionbooleanPerforms the given action on the component wrapped by this RSItem if possible.booleanPerforms the given action on the component wrapped by this RSItem if possible.booleandoAction(Predicate<RSMenuNode> predicate) booleandoClick()booleandoClick(boolean left) Clicks the component wrapped by this RSItem if possible.booleandoHover()Gets the component wrapped by this RSItem.net.runelite.api.ItemCompositionGets this item's definition if available.String[]intgetID()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.intGets this item's stack size.booleanReturns whether this item has an available definition.booleanbooleanChecks whether a valid component is being wrapped.booleanChecks 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
nullif 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:
trueif 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:
trueif there is a visible wrapped component.
-
isItemValid
public boolean isItemValid()Checks whether a valid item is being wrapped.- Returns:
trueif 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
nullif 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:
isClickablein interfaceClickable07
-