Package dev.twilite.game.wrapper
Class BaseItem
java.lang.Object
dev.twilite.game.wrapper.BaseItem
- All Implemented Interfaces:
Id
Base representation of an item stack with helpers for cache-backed item metadata.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionReturns the generated gameval constant name forId.id(), or the numeric id as text when no constant is known.abstract intid()Returns the item id.integerParameter(int id) Returns an integer cache parameter from this item's definition.booleanReturns whether this item can be traded on the Grand Exchange.name()Returns the standardized item name when the cache definition is available.intnote()Returns the noted variant id for this item.booleannoted()Returns whether this item is a noted item variant.objectParameter(int id) Returns a raw cache parameter from this item's definition.booleanReturns whether this item is a placeholder item variant.booleanReturns whether this item is stackable.abstract intReturns the stack size.booleanReturns whether this item can be traded between players.intunnote()Returns the unnoted variant id for this item.
-
Constructor Details
-
BaseItem
public BaseItem()
-
-
Method Details
-
id
public abstract int id()Returns the item id. -
constantName
Description copied from interface:IdReturns the generated gameval constant name forId.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:
constantNamein interfaceId
-
stackSize
public abstract int stackSize()Returns the stack size. -
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
Returns an integer cache parameter from this item's definition. -
objectParameter
Returns a raw cache parameter from this item's definition.
-