From b71903136f12b4c77fcf43f9c47abdbf050ac6ad Mon Sep 17 00:00:00 2001 From: hannibal2 <24389977+hannibal00212@users.noreply.github.com> Date: Fri, 8 Dec 2023 23:15:16 +0100 Subject: Saving minion craft helper crafted tier 1 minions per bingo session. --- src/main/java/at/hannibal2/skyhanni/config/Storage.java | 3 +++ src/main/java/at/hannibal2/skyhanni/features/bingo/BingoAPI.kt | 2 +- .../at/hannibal2/skyhanni/features/bingo/MinionCraftHelper.kt | 8 +------- 3 files changed, 5 insertions(+), 8 deletions(-) (limited to 'src') diff --git a/src/main/java/at/hannibal2/skyhanni/config/Storage.java b/src/main/java/at/hannibal2/skyhanni/config/Storage.java index d3796b767..3c47ecf9a 100644 --- a/src/main/java/at/hannibal2/skyhanni/config/Storage.java +++ b/src/main/java/at/hannibal2/skyhanni/config/Storage.java @@ -98,6 +98,9 @@ public class Storage { public static class BingoProfile { + @Expose + public List tierOneMinionsDone = new ArrayList<>(); + @Expose public Map goals = new HashMap<>(); } diff --git a/src/main/java/at/hannibal2/skyhanni/features/bingo/BingoAPI.kt b/src/main/java/at/hannibal2/skyhanni/features/bingo/BingoAPI.kt index dfc910ba3..70ff89127 100644 --- a/src/main/java/at/hannibal2/skyhanni/features/bingo/BingoAPI.kt +++ b/src/main/java/at/hannibal2/skyhanni/features/bingo/BingoAPI.kt @@ -44,7 +44,7 @@ object BingoAPI { tips[displayName] } - private val bingoStorage: BingoProfile by lazy { + val bingoStorage: BingoProfile by lazy { val playerSpecific = ProfileStorageData.playerSpecific ?: error("playerSpecific is null") playerSpecific.bingoProfiles.getOrPut(getStartOfMonthInMillis()) { BingoProfile() } } diff --git a/src/main/java/at/hannibal2/skyhanni/features/bingo/MinionCraftHelper.kt b/src/main/java/at/hannibal2/skyhanni/features/bingo/MinionCraftHelper.kt index 4428fd072..c4db6c1f6 100644 --- a/src/main/java/at/hannibal2/skyhanni/features/bingo/MinionCraftHelper.kt +++ b/src/main/java/at/hannibal2/skyhanni/features/bingo/MinionCraftHelper.kt @@ -5,7 +5,6 @@ import at.hannibal2.skyhanni.events.GuiRenderEvent import at.hannibal2.skyhanni.events.InventoryFullyOpenedEvent import at.hannibal2.skyhanni.events.LorenzTickEvent import at.hannibal2.skyhanni.events.LorenzWorldChangeEvent -import at.hannibal2.skyhanni.events.ProfileJoinEvent import at.hannibal2.skyhanni.utils.ItemUtils.getInternalName_old import at.hannibal2.skyhanni.utils.ItemUtils.hasEnchantments import at.hannibal2.skyhanni.utils.ItemUtils.name @@ -32,7 +31,7 @@ class MinionCraftHelper { private var hasMinionInInventory = false private var hasItemsForMinion = false private val tierOneMinions = mutableListOf() - private val tierOneMinionsDone = mutableListOf() + private val tierOneMinionsDone get() = BingoAPI.bingoStorage.tierOneMinionsDone private val allIngredients = mutableListOf() private val alreadyNotified = mutableListOf() @@ -85,11 +84,6 @@ class MinionCraftHelper { return newDisplay } - @SubscribeEvent - fun onProfileJoin(event: ProfileJoinEvent) { - tierOneMinionsDone.clear() - } - private fun loadFromInventory(mainInventory: Array): Pair, MutableMap> { init() -- cgit