Class Item

java.lang.Object
org.rspeer.game.component.Item
All Implemented Interfaces:
Actionable, Defined<ItemDefinition>, Identifiable, Interactable, Nameable

public class Item extends Object implements Identifiable, Nameable, Interactable, Defined<ItemDefinition>
Represents an Item in game
  • Constructor Details

    • Item

      public Item(int index, int id, int stackSize, InterfaceAddress address)
  • Method Details

    • unbound

      public static Item unbound(int index, int id, int stackSize)
    • combine

      public static Item combine(jag.oldscape.RSInventory inv, InterfaceComponent component, int index)
    • parent

      public static Item parent(jag.oldscape.RSInventory inv, InterfaceComponent component)
    • from

      public static Item from(InterfaceComponent component)
    • direct

      public static Item direct(jag.oldscape.RSInventory inv, InterfaceComponent component)
    • direct

      public static Item direct(boolean forceComponent, jag.oldscape.RSInventory inv, InterfaceComponent component)
    • isNullId

      public static boolean isNullId(int id)
    • getParameter

      public int getParameter(int parameter)
    • getParameter

      public int getParameter(ItemParameter parameter)
    • getComponent

      public InterfaceComponent getComponent()
    • isUnbound

      public boolean isUnbound()
    • getName

      public String getName()
      Specified by:
      getName in interface Nameable
    • getId

      public int getId()
      Specified by:
      getId in interface Identifiable
    • getIndex

      public int getIndex()
    • getStackSize

      public int getStackSize()
    • getDefinition

      public ItemDefinition getDefinition()
      Specified by:
      getDefinition in interface Defined<ItemDefinition>
    • isStackable

      public boolean isStackable()
    • isNoted

      public boolean isNoted()
    • isPlaceholder

      public boolean isPlaceholder()
    • actionOf

      public MenuAction actionOf(String action)
      Specified by:
      actionOf in interface Interactable
    • getRawActions

      public String[] getRawActions()
      Specified by:
      getRawActions in interface Actionable
    • getSubMenuActions

      public String[] getSubMenuActions(int parentActionIndex)
      Specified by:
      getSubMenuActions in interface Actionable
    • getActions

      public List<String> getActions()
      Specified by:
      getActions in interface Actionable
    • getSprite

      public Sprite getSprite(int border, int shadow, int stackable, boolean noted)
      Parameters:
      stackable - 0 = Never show item quantity number 1 = Always show item quantity number 2 = Only show item quantity number if it's greater than 1
    • toString

      public String toString()
      Overrides:
      toString in class Object
    • getBounds

      public Rectangle getBounds()
    • equals

      public boolean equals(Object o)
      Overrides:
      equals in class Object
    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class Object
    • setActionOverride

      public void setActionOverride(BiFunction<Item, String, MenuAction> actionOverride)
    • setActionSupplier

      public void setActionSupplier(Function<Item, List<String>> actionSupplier)