Make examine plugin work with placeholders

Signed-off-by: Tomas Slusny <slusnucky@gmail.com>
This commit is contained in:
Tomas Slusny
2018-09-28 23:28:01 +02:00
parent 0fe6d4be3a
commit 4c01b0d260

View File

@@ -261,17 +261,13 @@ public class ExaminePlugin extends Plugin
if (itemComposition != null)
{
executor.submit(() -> getItemPrice(itemComposition, itemQuantity));
final int id = itemManager.canonicalize(itemComposition.getId());
executor.submit(() -> getItemPrice(id, itemComposition, itemQuantity));
}
}
private void getItemPrice(ItemComposition itemComposition, int quantity)
private void getItemPrice(int id, ItemComposition itemComposition, int quantity)
{
// convert to unnoted id
final boolean note = itemComposition.getNote() != -1;
final int id = note ? itemComposition.getLinkedNoteId() : itemComposition.getId();
int itemCompositionPrice = itemComposition.getPrice();
final int gePrice = itemManager.getItemPrice(id);
final int alchPrice = itemCompositionPrice <= 0 ? 0 : Math.round(itemCompositionPrice * HIGH_ALCHEMY_CONSTANT);