Package net.runelite.client.game
Class ItemManager
- java.lang.Object
-
- net.runelite.client.game.ItemManager
-
@Singleton public class ItemManager extends Object
-
-
Constructor Summary
Constructors Constructor Description ItemManager(Client client, ScheduledExecutorService scheduledExecutorService, ClientThread clientThread, ItemClient itemClient, RuneLiteConfig runeLiteConfig)
-
Method Summary
All Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method Description int
canonicalize(int itemID)
Get an item's un-noted, un-placeholdered IDAsyncBufferedImage
getImage(int itemId)
Get item sprite image as BufferedImage.AsyncBufferedImage
getImage(int itemId, int quantity, boolean stackable)
Get item sprite image as BufferedImage.ItemComposition
getItemComposition(int itemId)
Look up an item's compositionBufferedImage
getItemOutline(int itemId, int itemQuantity, Color outlineColor)
Get item outline with a specific color.int
getItemPrice(int itemID)
Look up an item's priceint
getItemPriceWithSource(int itemID, boolean useWikiPrice)
Look up an item's priceItemStats
getItemStats(int itemId)
Look up an item's statsnet.runelite.http.api.item.ItemStats
getItemStats(int itemId, boolean allowNote)
Deprecated.int
getWikiPrice(net.runelite.http.api.item.ItemPrice itemPrice)
Get the wiki price for an item, with checks to try and avoid excessive price manipulationList<net.runelite.http.api.item.ItemPrice>
search(String itemName)
Search for tradeable items based on item name
-
-
-
Constructor Detail
-
ItemManager
@Inject public ItemManager(Client client, 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 iduseWikiPrice
- 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 ItemStats getItemStats(int itemId)
Look up an item's stats- Parameters:
itemId
- item id- Returns:
- item stats
-
getItemStats
@Nullable @Deprecated public net.runelite.http.api.item.ItemStats getItemStats(int itemId, boolean allowNote)
Deprecated.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 iditemQuantity
- item quantityoutlineColor
- outline color- Returns:
- image
-
-