Class BaseItem

java.lang.Object
dev.twilite.game.wrapper.BaseItem
All Implemented Interfaces:
Id
Direct Known Subclasses:
Item, TileItem

public abstract class BaseItem extends Object implements Id
Base representation of an item stack with helpers for cache-backed item metadata.
  • Constructor Summary

    Constructors
    Constructor
    Description
     
  • Method Summary

    Modifier and Type
    Method
    Description
    Returns the generated gameval constant name for Id.id(), or the numeric id as text when no constant is known.
    abstract int
    id()
    Returns the item id.
    Returns an integer cache parameter from this item's definition.
    boolean
    Returns whether this item can be traded on the Grand Exchange.
    Returns the standardized item name when the cache definition is available.
    int
    Returns the noted variant id for this item.
    boolean
    Returns whether this item is a noted item variant.
    Returns a raw cache parameter from this item's definition.
    boolean
    Returns whether this item is a placeholder item variant.
    boolean
    Returns whether this item is stackable.
    abstract int
    Returns the stack size.
    boolean
    Returns whether this item can be traded between players.
    int
    Returns the unnoted variant id for this item.

    Methods inherited from class java.lang.Object

    equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Constructor Details

    • BaseItem

      public BaseItem()
  • Method Details

    • id

      public abstract int id()
      Returns the item id.
      Specified by:
      id in interface Id
    • constantName

      public String constantName()
      Description copied from interface: Id
      Returns the generated gameval constant name for Id.id(), or the numeric id as text when no constant is known.

      This is intended for logs and diagnostics where a stable symbolic name is easier to read than a raw number.

      Specified by:
      constantName in interface Id
    • stackSize

      public abstract int stackSize()
      Returns the stack size.
    • name

      public String name()
      Returns the standardized item name when the cache definition is available. Standardized text is tag-stripped, trimmed, and lowercased.
    • noted

      public boolean noted()
      Returns whether this item is a noted item variant.
    • note

      public int note()
      Returns the noted variant id for this item.
      Returns:
      noted item id, or this item's id when no separate noted variant is available
    • unnote

      public int unnote()
      Returns the unnoted variant id for this item.
      Returns:
      unnoted item id, or this item's id when no separate unnoted variant is available
    • placeholder

      public boolean placeholder()
      Returns whether this item is a placeholder item variant.
    • stackable

      public boolean stackable()
      Returns whether this item is stackable.
    • tradeable

      public boolean tradeable()
      Returns whether this item can be traded between players.
    • marketable

      public boolean marketable()
      Returns whether this item can be traded on the Grand Exchange.
    • integerParameter

      public OptionalInt integerParameter(int id)
      Returns an integer cache parameter from this item's definition.
    • objectParameter

      public Optional<Object> objectParameter(int id)
      Returns a raw cache parameter from this item's definition.