Class ItemManager


  • @Singleton
    public class ItemManager
    extends Object
    • Method Detail

      • getItemPrice

        public int getItemPrice​(int itemID)
        Look up an item's price
        Parameters:
        itemID - item id
        Returns:
        item price
      • getItemPriceWithSource

        public int getItemPriceWithSource​(int itemID,
                                          boolean useWikiPrice)
        Look up an item's price
        Parameters:
        itemID - item id
        useWikiPrice - use the actively traded/wiki price
        Returns:
        item price
      • getWikiPrice

        public int getWikiPrice​(net.runelite.http.api.item.ItemPrice itemPrice)
        Get the wiki price for an item, with checks to try and avoid excessive price manipulation
        Parameters:
        itemPrice -
        Returns:
      • getItemStats

        @Nullable
        public net.runelite.http.api.item.ItemStats getItemStats​(int itemId,
                                                                 boolean allowNote)
        Look up an item's stats
        Parameters:
        itemId - item id
        Returns:
        item stats
      • search

        public List<net.runelite.http.api.item.ItemPrice> search​(String itemName)
        Search for tradeable items based on item name
        Parameters:
        itemName - item name
        Returns:
      • getItemComposition

        @Nonnull
        public ItemComposition getItemComposition​(int itemId)
        Look up an item's composition
        Parameters:
        itemId - item id
        Returns:
        item composition
      • canonicalize

        public int canonicalize​(int itemID)
        Get an item's un-noted, un-placeholdered ID
      • getImage

        public AsyncBufferedImage getImage​(int itemId)
        Get item sprite image as BufferedImage.

        This method may return immediately with a blank image if not called on the game thread. The image will be filled in later. If this is used for a UI label/button, it should be added using AsyncBufferedImage::addTo to ensure it is painted properly

        Parameters:
        itemId -
        Returns:
      • getImage

        public AsyncBufferedImage getImage​(int itemId,
                                           int quantity,
                                           boolean stackable)
        Get item sprite image as BufferedImage.

        This method may return immediately with a blank image if not called on the game thread. The image will be filled in later. If this is used for a UI label/button, it should be added using AsyncBufferedImage::addTo to ensure it is painted properly

        Parameters:
        itemId -
        quantity -
        Returns:
      • getItemOutline

        public BufferedImage getItemOutline​(int itemId,
                                            int itemQuantity,
                                            Color outlineColor)
        Get item outline with a specific color.
        Parameters:
        itemId - item id
        itemQuantity - item quantity
        outlineColor - outline color
        Returns:
        image