Adds GP value to untradables lost on pvp death, removes debug logging msg
Signed-off-by: PKLite <stonewall@pklite.xyz>
This commit is contained in:
@@ -39,8 +39,6 @@ public enum LootRecordSortType implements Comparator<LootTrackerRecord>
|
|||||||
}
|
}
|
||||||
int sum = Arrays.stream(o1.getItems()).flatMapToInt(lootTrackerItem ->
|
int sum = Arrays.stream(o1.getItems()).flatMapToInt(lootTrackerItem ->
|
||||||
IntStream.of((int) lootTrackerItem.getPrice() * lootTrackerItem.getQuantity())).sum();
|
IntStream.of((int) lootTrackerItem.getPrice() * lootTrackerItem.getQuantity())).sum();
|
||||||
log.info(String.valueOf(sum + Arrays.stream(o2.getItems()).flatMapToInt(lootTrackerItem ->
|
|
||||||
IntStream.of((int) lootTrackerItem.getPrice() * lootTrackerItem.getQuantity())).sum()));
|
|
||||||
return sum + Arrays.stream(o2.getItems()).flatMapToInt(lootTrackerItem ->
|
return sum + Arrays.stream(o2.getItems()).flatMapToInt(lootTrackerItem ->
|
||||||
IntStream.of((int) lootTrackerItem.getPrice() * lootTrackerItem.getQuantity())).sum();
|
IntStream.of((int) lootTrackerItem.getPrice() * lootTrackerItem.getQuantity())).sum();
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -446,7 +446,6 @@ class LootTrackerPanel extends PluginPanel
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
buildBox(records.get(i));
|
buildBox(records.get(i));
|
||||||
log.info(String.valueOf(Arrays.stream(records.get(i).getItems()).flatMapToInt(a -> IntStream.of(a.getQuantity() * (int) a.getPrice())).sum()));
|
|
||||||
|
|
||||||
}
|
}
|
||||||
boxes.forEach(LootTrackerBox::rebuild);
|
boxes.forEach(LootTrackerBox::rebuild);
|
||||||
|
|||||||
@@ -743,14 +743,23 @@ public class LootTrackerPlugin extends Plugin
|
|||||||
@VisibleForTesting
|
@VisibleForTesting
|
||||||
private LootTrackerItem buildLootTrackerItem(int itemId, int quantity)
|
private LootTrackerItem buildLootTrackerItem(int itemId, int quantity)
|
||||||
{
|
{
|
||||||
final ItemDefinition itemComposition = itemManager.getItemDefinition(itemId);
|
final ItemDefinition itemDefinition = itemManager.getItemDefinition(itemId);
|
||||||
final int realItemId = itemComposition.getNote() != -1 ? itemComposition.getLinkedNoteId() : itemId;
|
final int realItemId = itemDefinition.getNote() != -1 ? itemDefinition.getLinkedNoteId() : itemId;
|
||||||
final long price = (long) itemManager.getItemPrice(realItemId) * (long) quantity;
|
final long price;
|
||||||
final boolean ignored = ignoredItems.contains(itemComposition.getName());
|
// If it's a death we want to get a coin value for untradeables lost
|
||||||
|
if (!itemDefinition.isTradeable() && quantity < 0)
|
||||||
|
{
|
||||||
|
price = (long) itemDefinition.getPrice() *(long) quantity;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
price =(long) itemManager.getItemPrice(realItemId) * (long) quantity;
|
||||||
|
}
|
||||||
|
final boolean ignored = ignoredItems.contains(itemDefinition.getName());
|
||||||
|
|
||||||
return new LootTrackerItem(
|
return new LootTrackerItem(
|
||||||
itemId,
|
itemId,
|
||||||
itemComposition.getName(),
|
itemDefinition.getName(),
|
||||||
quantity,
|
quantity,
|
||||||
price,
|
price,
|
||||||
ignored);
|
ignored);
|
||||||
|
|||||||
Reference in New Issue
Block a user