item manager: use item mapping
This commit is contained in:
@@ -151,6 +151,8 @@ public class ItemManager
|
|||||||
*/
|
*/
|
||||||
public ItemPrice getItemPriceAsync(int itemId)
|
public ItemPrice getItemPriceAsync(int itemId)
|
||||||
{
|
{
|
||||||
|
itemId = ItemMapping.mapFirst(itemId);
|
||||||
|
|
||||||
ItemPrice itemPrice = itemPriceCache.getIfPresent(itemId);
|
ItemPrice itemPrice = itemPriceCache.getIfPresent(itemId);
|
||||||
if (itemPrice != null && itemPrice != EMPTY)
|
if (itemPrice != null && itemPrice != EMPTY)
|
||||||
{
|
{
|
||||||
@@ -173,14 +175,17 @@ public class ItemManager
|
|||||||
final List<ItemPrice> existing = new ArrayList<>();
|
final List<ItemPrice> existing = new ArrayList<>();
|
||||||
for (int itemId : itemIds)
|
for (int itemId : itemIds)
|
||||||
{
|
{
|
||||||
ItemPrice itemPrice = itemPriceCache.getIfPresent(itemId);
|
for (int mappedItemId : ItemMapping.map(itemId))
|
||||||
if (itemPrice != null)
|
|
||||||
{
|
{
|
||||||
existing.add(itemPrice);
|
ItemPrice itemPrice = itemPriceCache.getIfPresent(mappedItemId);
|
||||||
}
|
if (itemPrice != null)
|
||||||
else
|
{
|
||||||
{
|
existing.add(itemPrice);
|
||||||
lookup.add(itemId);
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
lookup.add(mappedItemId);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
// All cached?
|
// All cached?
|
||||||
@@ -234,6 +239,8 @@ public class ItemManager
|
|||||||
*/
|
*/
|
||||||
public ItemPrice getItemPrice(int itemId) throws IOException
|
public ItemPrice getItemPrice(int itemId) throws IOException
|
||||||
{
|
{
|
||||||
|
itemId = ItemMapping.mapFirst(itemId);
|
||||||
|
|
||||||
ItemPrice itemPrice = itemPriceCache.getIfPresent(itemId);
|
ItemPrice itemPrice = itemPriceCache.getIfPresent(itemId);
|
||||||
if (itemPrice != null && itemPrice != EMPTY)
|
if (itemPrice != null && itemPrice != EMPTY)
|
||||||
{
|
{
|
||||||
|
|||||||
Reference in New Issue
Block a user