Class ItemDefinition
- java.lang.Object
-
- com.runemate.game.api.hybrid.entities.definitions.ItemDefinition
-
- All Implemented Interfaces:
Identifiable
,Onymous
- Direct Known Subclasses:
CacheItemDefinition.Extended
public abstract class ItemDefinition extends java.lang.Object implements Onymous, Identifiable
The definition of an item
-
-
Constructor Summary
Constructors Constructor Description ItemDefinition()
-
Method Summary
All Methods Static Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description static ItemDefinition
get(int id)
Gets the ItemDefinition of the item with the specified id and stores it in a local cachestatic ItemDefinition
get(int id, boolean cache)
Gets the ItemDefinition of the item with the specified id and optionally stores it in a local cache.static java.util.List<ItemDefinition>
get(int first, int last)
A list of definitions in the range [first, last]static java.util.List<ItemDefinition>
get(int first, int last, java.util.function.Predicate<ItemDefinition> predicate)
A list of definitions in the range [first, last] that are accepted by the filter.abstract Attribute
getAttribute(long id)
Gets the attribute of this item with the specified id.abstract java.util.List<Attribute>
getAttributes()
The attributes of the item, contains things such as how much it can heal and what items are needed to create it.abstract java.util.Map<java.awt.Color,java.awt.Color>
getColorSubstitutions()
abstract ItemDefinition
getCosmeticBaseDefinition()
abstract ItemDefinition
getCosmeticDefinition()
abstract int
getCosmeticTemplateId()
abstract Equipment.Slot
getEquipmentSlot()
Gets the first valid equipment slot occupied by this item This is not guaranteed to be accurate (e.g Black mask will return null)abstract java.util.List<java.lang.Integer>
getFemaleHeadModelIds()
abstract java.util.List<java.lang.Integer>
getFemaleModelIds()
@NonNull java.util.List<java.lang.String>
getGroundActions()
abstract int
getGroundModelId()
abstract int
getHighLevelAlchemyValue()
Gets the high level alchemy value of the itemabstract int
getId()
Gets the id of the itemstatic java.util.function.Predicate<ItemDefinition>
getIdPredicate(int... acceptedIds)
java.util.List<java.lang.String>
getInventoryActions()
abstract int
getLowLevelAlchemyValue()
Gets the low level alchemy value of the itemabstract java.util.List<java.lang.Integer>
getMaleHeadModelIds()
abstract java.util.List<java.lang.Integer>
getMaleModelIds()
abstract java.util.Map<Material,Material>
getMaterialSubstitutions()
abstract @NonNull java.lang.String
getName()
static java.util.function.Predicate<ItemDefinition>
getNamePredicate(java.lang.String... acceptedNames)
abstract int
getNotedId()
Get the id of the item when it's noted (if available)abstract ItemDefinition
getPlaceholderBaseDefinition()
abstract ItemDefinition
getPlaceholderDefinition()
abstract int
getPlaceholderId()
abstract Equipment.Slot
getPrimaryEquipmentSlot()
Primary equipment slot used by this item, according to the cache.abstract java.lang.String[]
getRawGroundActions()
abstract java.lang.String[]
getRawInventoryActions()
abstract Equipment.Slot
getSecondaryEquipmentSlot()
abstract java.lang.String
getShiftClickAction()
On osrs, it returns the action that is triggered when a shift click style drop is used on this item.abstract int
getShopValue()
Gets the shop value of an itemabstract int
getTeamId()
abstract Equipment.Slot
getTertiaryEquipmentSlot()
ItemDefinition
getUnnotedDefinition()
abstract int
getUnnotedId()
Get the id of the item when it's unnoted (if available)abstract double
getWeight()
Gets the weight of the item in kg.java.util.List<java.lang.String>
getWornActions()
abstract boolean
isCosmetic()
abstract boolean
isEquipable()
abstract boolean
isMembersOnly()
Checks whether or not this item is members-onlyabstract boolean
isNoted()
abstract boolean
isPlaceholder()
abstract boolean
isTradeable()
Currently being rewritten to behave similarly to the way it's name implies and the way it used to perform.abstract boolean
isTradeableOnMarket()
Gets whether or not the item can be traded on the game's market in it's current state (currently, osrs and rs3 use the GrandExchange as it's market) Noted items will return false as should be expected since you're not actually buying and selling the notes themselves, but rather the items they represent/contain.abstract boolean
isTwoHanded()
static java.util.List<ItemDefinition>
loadAll()
Loads all definitionsstatic java.util.List<ItemDefinition>
loadAll(java.util.function.Predicate<ItemDefinition> filter)
Loads all definitions that are accepted by the filterabstract boolean
stacks()
Gets whether or not multiple of this item will stack into a single inventory slotjava.lang.String
toString()
-
-
-
Method Detail
-
get
public static java.util.List<ItemDefinition> get(int first, int last)
A list of definitions in the range [first, last]
-
get
public static java.util.List<ItemDefinition> get(int first, int last, java.util.function.Predicate<ItemDefinition> predicate)
A list of definitions in the range [first, last] that are accepted by the filter.
-
get
@Nullable public static ItemDefinition get(int id)
Gets the ItemDefinition of the item with the specified id and stores it in a local cache- Returns:
- The definition if available, otherwise null.
-
get
@Nullable public static ItemDefinition get(int id, boolean cache)
Gets the ItemDefinition of the item with the specified id and optionally stores it in a local cache.- Returns:
- The definition if available, otherwise null.
-
loadAll
public static java.util.List<ItemDefinition> loadAll()
Loads all definitions
-
loadAll
public static java.util.List<ItemDefinition> loadAll(java.util.function.Predicate<ItemDefinition> filter)
Loads all definitions that are accepted by the filter
-
getIdPredicate
public static java.util.function.Predicate<ItemDefinition> getIdPredicate(int... acceptedIds)
-
getNamePredicate
public static java.util.function.Predicate<ItemDefinition> getNamePredicate(java.lang.String... acceptedNames)
-
getName
@NonNull public abstract @NonNull java.lang.String getName()
-
getAttribute
@Nullable public abstract Attribute getAttribute(long id)
Gets the attribute of this item with the specified id.
-
getAttributes
public abstract java.util.List<Attribute> getAttributes()
The attributes of the item, contains things such as how much it can heal and what items are needed to create it.
-
getColorSubstitutions
public abstract java.util.Map<java.awt.Color,java.awt.Color> getColorSubstitutions()
-
getMaterialSubstitutions
public abstract java.util.Map<Material,Material> getMaterialSubstitutions()
-
getRawGroundActions
public abstract java.lang.String[] getRawGroundActions()
-
getGroundActions
@NonNull public final @NonNull java.util.List<java.lang.String> getGroundActions()
-
getId
public abstract int getId()
Gets the id of the item- Specified by:
getId
in interfaceIdentifiable
-
getRawInventoryActions
public abstract java.lang.String[] getRawInventoryActions()
-
getInventoryActions
public final java.util.List<java.lang.String> getInventoryActions()
-
getWornActions
public final java.util.List<java.lang.String> getWornActions()
-
getNotedId
public abstract int getNotedId()
Get the id of the item when it's noted (if available)
-
getPlaceholderDefinition
public abstract ItemDefinition getPlaceholderDefinition()
-
getPlaceholderBaseDefinition
public abstract ItemDefinition getPlaceholderBaseDefinition()
-
getEquipmentSlot
@Nullable public abstract Equipment.Slot getEquipmentSlot()
Gets the first valid equipment slot occupied by this item This is not guaranteed to be accurate (e.g Black mask will return null)
-
getPrimaryEquipmentSlot
@Nullable public abstract Equipment.Slot getPrimaryEquipmentSlot()
Primary equipment slot used by this item, according to the cache. Items in theEquipment.Slot.HEAD
contain this information in the secondary equipment slot
-
getSecondaryEquipmentSlot
@Nullable public abstract Equipment.Slot getSecondaryEquipmentSlot()
-
getTertiaryEquipmentSlot
@Nullable public abstract Equipment.Slot getTertiaryEquipmentSlot()
-
getLowLevelAlchemyValue
public abstract int getLowLevelAlchemyValue()
Gets the low level alchemy value of the item
-
getHighLevelAlchemyValue
public abstract int getHighLevelAlchemyValue()
Gets the high level alchemy value of the item
-
getShopValue
public abstract int getShopValue()
Gets the shop value of an item
-
getUnnotedId
public abstract int getUnnotedId()
Get the id of the item when it's unnoted (if available)
-
getGroundModelId
public abstract int getGroundModelId()
-
isEquipable
@RS3Only public abstract boolean isEquipable()
-
getWeight
public abstract double getWeight()
Gets the weight of the item in kg. Weight-reducing items will have negative weight.
-
getMaleModelIds
public abstract java.util.List<java.lang.Integer> getMaleModelIds()
-
getFemaleModelIds
public abstract java.util.List<java.lang.Integer> getFemaleModelIds()
-
getMaleHeadModelIds
public abstract java.util.List<java.lang.Integer> getMaleHeadModelIds()
-
getFemaleHeadModelIds
public abstract java.util.List<java.lang.Integer> getFemaleHeadModelIds()
-
isMembersOnly
public abstract boolean isMembersOnly()
Checks whether or not this item is members-only
-
isNoted
public abstract boolean isNoted()
-
getCosmeticTemplateId
public abstract int getCosmeticTemplateId()
-
isCosmetic
public abstract boolean isCosmetic()
-
isPlaceholder
@OSRSOnly public abstract boolean isPlaceholder()
-
isTradeable
public abstract boolean isTradeable()
Currently being rewritten to behave similarly to the way it's name implies and the way it used to perform.- See Also:
isTradeableOnMarket()
-
isTradeableOnMarket
public abstract boolean isTradeableOnMarket()
Gets whether or not the item can be traded on the game's market in it's current state (currently, osrs and rs3 use the GrandExchange as it's market) Noted items will return false as should be expected since you're not actually buying and selling the notes themselves, but rather the items they represent/contain.- Returns:
- true if you can buy and sell the item on the game's market in it's current state
-
isTwoHanded
public abstract boolean isTwoHanded()
-
getTeamId
public abstract int getTeamId()
-
getCosmeticDefinition
public abstract ItemDefinition getCosmeticDefinition()
-
getCosmeticBaseDefinition
public abstract ItemDefinition getCosmeticBaseDefinition()
-
getPlaceholderId
public abstract int getPlaceholderId()
-
getShiftClickAction
@OSRSOnly @Nullable public abstract java.lang.String getShiftClickAction()
On osrs, it returns the action that is triggered when a shift click style drop is used on this item.- Returns:
- a String or null if there is no shift click action defined.
-
stacks
public abstract boolean stacks()
Gets whether or not multiple of this item will stack into a single inventory slot- Returns:
- true if it can stack, otherwise false.
-
getUnnotedDefinition
public ItemDefinition getUnnotedDefinition()
-
toString
public java.lang.String toString()
- Overrides:
toString
in classjava.lang.Object
-
-