add local loot saving for chests, clue scrolls, etc

Signed-off-by: PKLite <stonewall@pklite.xyz>
This commit is contained in:
PKLite
2019-06-28 02:38:53 -04:00
parent 20b0035828
commit 94c1bc57a1

View File

@@ -518,14 +518,19 @@ public class LootTrackerPlugin extends Plugin
}
final LootTrackerItem[] entries = buildEntries(stack(items));
SwingUtilities.invokeLater(() -> panel.add(eventType, client.getLocalPlayer().getName(), -1, entries));
LootRecord lootRecord = new LootRecord(eventType, client.getLocalPlayer().getName(), LootRecordType.EVENT,
toGameItems(items), Instant.now());
if (lootTrackerClient != null && config.saveLoot())
{
LootRecord lootRecord = new LootRecord(eventType, client.getLocalPlayer().getName(), LootRecordType.EVENT,
toGameItems(items), Instant.now());
lootTrackerClient.submit(lootRecord);
}
if (config.localPersistence())
{
saveLocalLootRecord(lootRecord);
}
}
@Subscribe
@@ -744,13 +749,18 @@ public class LootTrackerPlugin extends Plugin
final LootTrackerItem[] entries = buildEntries(stack(items));
SwingUtilities.invokeLater(() -> panel.add(chestType, client.getLocalPlayer().getName(), -1, entries));
LootRecord lootRecord = new LootRecord(chestType, client.getLocalPlayer().getName(),
LootRecordType.EVENT, toGameItems(items), Instant.now());
if (lootTrackerClient != null && config.saveLoot())
{
LootRecord lootRecord = new LootRecord(chestType, client.getLocalPlayer().getName(),
LootRecordType.EVENT, toGameItems(items), Instant.now());
lootTrackerClient.submit(lootRecord);
}
if (config.localPersistence())
{
saveLocalLootRecord(lootRecord);
}
inventorySnapshot = null;
}
}