Class ItemDefinition

    • Constructor Detail

      • ItemDefinition

        public ItemDefinition()
    • 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()
        Specified by:
        getName in interface Onymous
      • 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 interface Identifiable
      • 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 the Equipment.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.
      • toString

        public java.lang.String toString()
        Overrides:
        toString in class java.lang.Object