Class ItemManager


  • @Singleton
    public class ItemManager
    extends java.lang.Object
    • Constructor Summary

      Constructors 
      Constructor Description
      ItemManager​(net.runelite.api.Client client, java.util.concurrent.ScheduledExecutorService scheduledExecutorService, ClientThread clientThread, ItemClient itemClient, RuneLiteConfig runeLiteConfig)  
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      int canonicalize​(int itemID)
      Get an item's un-noted, un-placeholdered ID
      AsyncBufferedImage getImage​(int itemId)
      Get item sprite image as BufferedImage.
      AsyncBufferedImage getImage​(int itemId, int quantity, boolean stackable)
      Get item sprite image as BufferedImage.
      net.runelite.api.ItemComposition getItemComposition​(int itemId)
      Look up an item's composition
      java.awt.image.BufferedImage getItemOutline​(int itemId, int itemQuantity, java.awt.Color outlineColor)
      Get item outline with a specific color.
      int getItemPrice​(int itemID)
      Look up an item's price
      int getItemPriceWithSource​(int itemID, boolean useWikiPrice)
      Look up an item's price
      net.runelite.http.api.item.ItemStats getItemStats​(int itemId, boolean allowNote)
      Look up an item's stats
      java.util.List<net.runelite.http.api.item.ItemPrice> search​(java.lang.String itemName)
      Search for tradeable items based on item name
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • ItemManager

        @Inject
        public ItemManager​(net.runelite.api.Client client,
                           java.util.concurrent.ScheduledExecutorService scheduledExecutorService,
                           ClientThread clientThread,
                           ItemClient itemClient,
                           RuneLiteConfig runeLiteConfig)
    • 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
      • 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 java.util.List<net.runelite.http.api.item.ItemPrice> search​(java.lang.String itemName)
        Search for tradeable items based on item name
        Parameters:
        itemName - item name
        Returns:
      • getItemComposition

        @Nonnull
        public net.runelite.api.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 java.awt.image.BufferedImage getItemOutline​(int itemId,
                                                           int itemQuantity,
                                                           java.awt.Color outlineColor)
        Get item outline with a specific color.
        Parameters:
        itemId - item id
        itemQuantity - item quantity
        outlineColor - outline color
        Returns:
        image