Record Class ItemType
java.lang.Object
java.lang.Record
com.botwithus.bot.api.model.ItemType
- Record Components:
id- the item IDname- the item display namemembers- whether this is a members-only itemstackable- whether this item stacks in inventoryshopPrice- the base shop pricegeBuyLimit- the Grand Exchange buy limitcategory- the item category IDnotedId- the noted variant ID, or-1if nonewearpos- the equipment slot this item occupies, or-1if not wearablewearpos2- a second equipment slot this item blocks while worn, orNO_WEARPOSif nonewearpos3- a third equipment slot this item blocks while worn, orNO_WEARPOSif noneexchangeable- whether this item can be traded on the Grand ExchangegroundOptions- the right-click options when the item is on the groundinventoryOptions- the right-click options when the item is in inventoryparams- additional key-value parameters from the item definition
public record ItemType(int id, String name, boolean members, boolean stackable, int shopPrice, int geBuyLimit, int category, int notedId, int wearpos, int wearpos2, int wearpos3, boolean exchangeable, List<String> groundOptions, List<String> inventoryOptions, Map<String,Object> params)
extends Record
Item definition from the game cache.
An item can claim up to three equipment slots. wearpos is the slot it is worn
in; wearpos2 and wearpos3 are further slots the item blocks while worn.
A two-handed weapon is the common case: it is worn in the weapon slot and blocks the
shield slot through wearpos2 (cache item 36021, Camel staff, carries wearpos 3 and
wearpos2 5, while the one-handed Dragon mace, item 1434, carries wearpos 3 and wearpos2
-1). See isTwoHanded().
- See Also:
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final intThe cache's value for a wear position the item does not claim. -
Constructor Summary
ConstructorsConstructorDescriptionItemType(int id, String name, boolean members, boolean stackable, int shopPrice, int geBuyLimit, int category, int notedId, int wearpos, boolean exchangeable, List<String> groundOptions, List<String> inventoryOptions, Map<String, Object> params) ItemType(int id, String name, boolean members, boolean stackable, int shopPrice, int geBuyLimit, int category, int notedId, int wearpos, int wearpos2, int wearpos3, boolean exchangeable, List<String> groundOptions, List<String> inventoryOptions, Map<String, Object> params) Creates an instance of aItemTyperecord class. -
Method Summary
Modifier and TypeMethodDescriptionintcategory()Returns the value of thecategoryrecord component.final booleanIndicates whether some other object is "equal to" this one.booleanReturns the value of theexchangeablerecord component.intReturns the value of thegeBuyLimitrecord component.Returns the value of thegroundOptionsrecord component.final inthashCode()Returns a hash code value for this object.intid()Returns the value of theidrecord component.Returns the value of theinventoryOptionsrecord component.booleanWhether wearing this item also blocks the shield slot, so nothing can be worn in the off hand alongside it.booleanmembers()Returns the value of themembersrecord component.name()Returns the value of thenamerecord component.intnotedId()Returns the value of thenotedIdrecord component.params()Returns the value of theparamsrecord component.intReturns the value of theshopPricerecord component.booleanReturns the value of thestackablerecord component.final StringtoString()Returns a string representation of this record class.intwearpos()Returns the value of thewearposrecord component.intwearpos2()Returns the value of thewearpos2record component.intwearpos3()Returns the value of thewearpos3record component.
-
Field Details
-
NO_WEARPOS
public static final int NO_WEARPOSThe cache's value for a wear position the item does not claim.- See Also:
-
-
Constructor Details
-
ItemType
public ItemType(int id, String name, boolean members, boolean stackable, int shopPrice, int geBuyLimit, int category, int notedId, int wearpos, boolean exchangeable, List<String> groundOptions, List<String> inventoryOptions, Map<String, Object> params) Builds a definition that claims no extra wear positions;wearpos2andwearpos3areNO_WEARPOS. Kept so code written before the extra wear positions were exposed still compiles and links.- Parameters:
id- the item IDname- the item display namemembers- whether this is a members-only itemstackable- whether this item stacks in inventoryshopPrice- the base shop pricegeBuyLimit- the Grand Exchange buy limitcategory- the item category IDnotedId- the noted variant ID, or-1if nonewearpos- the equipment slot this item occupies, or-1exchangeable- whether this item can be traded on the Grand ExchangegroundOptions- the right-click options when the item is on the groundinventoryOptions- the right-click options when the item is in inventoryparams- additional key-value parameters from the item definition
-
ItemType
public ItemType(int id, String name, boolean members, boolean stackable, int shopPrice, int geBuyLimit, int category, int notedId, int wearpos, int wearpos2, int wearpos3, boolean exchangeable, List<String> groundOptions, List<String> inventoryOptions, Map<String, Object> params) Creates an instance of aItemTyperecord class.- Parameters:
id- the value for theidrecord componentname- the value for thenamerecord componentmembers- the value for themembersrecord componentstackable- the value for thestackablerecord componentshopPrice- the value for theshopPricerecord componentgeBuyLimit- the value for thegeBuyLimitrecord componentcategory- the value for thecategoryrecord componentnotedId- the value for thenotedIdrecord componentwearpos- the value for thewearposrecord componentwearpos2- the value for thewearpos2record componentwearpos3- the value for thewearpos3record componentexchangeable- the value for theexchangeablerecord componentgroundOptions- the value for thegroundOptionsrecord componentinventoryOptions- the value for theinventoryOptionsrecord componentparams- the value for theparamsrecord component
-
-
Method Details
-
isTwoHanded
public boolean isTwoHanded()Whether wearing this item also blocks the shield slot, so nothing can be worn in the off hand alongside it. True for two-handed weapons (Dragon 2h sword, Staff of light, Noxious scythe, Camel staff), false for one-handed ones (Abyssal whip, longswords, maces).- Returns:
trueifwearpos2orwearpos3is the shield slot
-
toString
-
hashCode
-
equals
Indicates whether some other object is "equal to" this one. The objects are equal if the other object is of the same class and if all the record components are equal. Reference components are compared withObjects::equals(Object,Object); primitive components are compared with thecomparemethod from their corresponding wrapper classes. -
id
-
name
-
members
-
stackable
-
shopPrice
-
geBuyLimit
public int geBuyLimit()Returns the value of thegeBuyLimitrecord component.- Returns:
- the value of the
geBuyLimitrecord component
-
category
-
notedId
-
wearpos
-
wearpos2
-
wearpos3
-
exchangeable
public boolean exchangeable()Returns the value of theexchangeablerecord component.- Returns:
- the value of the
exchangeablerecord component
-
groundOptions
Returns the value of thegroundOptionsrecord component.- Returns:
- the value of the
groundOptionsrecord component
-
inventoryOptions
Returns the value of theinventoryOptionsrecord component.- Returns:
- the value of the
inventoryOptionsrecord component
-
params
-