Make examineplugin stop running getItemComposition on executor thread (#461)

This commit is contained in:
Lucwousin
2019-05-31 16:25:52 +01:00
committed by Kyleeld
parent 84ed36f2cb
commit e4787b595a
2 changed files with 15 additions and 1 deletions
@@ -412,6 +412,20 @@ public class ItemManager
return price;
}
public int getAlchValue(ItemComposition composition)
{
if (composition.getId() == ItemID.COINS_995)
{
return 1;
}
if (composition.getId() == ItemID.PLATINUM_TOKEN)
{
return 1000;
}
return (int) Math.max(1, composition.getPrice() * HIGH_ALCHEMY_CONSTANT);
}
public int getAlchValue(int itemID)
{
if (itemID == ItemID.COINS_995)
@@ -322,7 +322,7 @@ public class ExaminePlugin extends Plugin
quantity = Math.max(1, quantity);
int itemCompositionPrice = itemComposition.getPrice();
final int gePrice = itemManager.getItemPrice(id);
final int alchPrice = itemCompositionPrice <= 0 ? 0 : itemManager.getAlchValue(id);
final int alchPrice = itemCompositionPrice <= 0 ? 0 : itemManager.getAlchValue(itemComposition);
if (gePrice > 0 || alchPrice > 0)
{