From 593c01992afe4e8d5d4cd8aa61abbfb1d82e2a30 Mon Sep 17 00:00:00 2001 From: CalMWolfs <94038482+CalMWolfs@users.noreply.github.com> Date: Sun, 10 Sep 2023 18:40:56 +1000 Subject: SackAPI event and storing data #410 * implement SackChangeEvent * move SackAPI * handling events * fixed small errors * fetching item data * moved over sack display * it should work * saving gemstones * saving gemstones * new config file for sacks * saving last change amount * fix conflicts fully * implement SackChangeEvent * move SackAPI * handle 'other items' correctly * move sackAPI again * handling events * fixed small errors * fetching item data * moved over sack display * it should work * saving gemstones * saving gemstones * new config file for sacks * saving last change amount * Merge branch 'beta' into sack_storage * fix conflicts fully * Merge remote-tracking branch 'origin/sack_storage' into sack_storage * Merge branch 'hannibal002:beta' into sack_storage * Merge remote-tracking branch 'origin/sack_storage' into sack_storage * remove unnecessary thing --- src/main/java/at/hannibal2/skyhanni/SkyHanniMod.kt | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) (limited to 'src/main/java/at/hannibal2/skyhanni/SkyHanniMod.kt') diff --git a/src/main/java/at/hannibal2/skyhanni/SkyHanniMod.kt b/src/main/java/at/hannibal2/skyhanni/SkyHanniMod.kt index bc391ff91..d7c4a566a 100644 --- a/src/main/java/at/hannibal2/skyhanni/SkyHanniMod.kt +++ b/src/main/java/at/hannibal2/skyhanni/SkyHanniMod.kt @@ -3,6 +3,7 @@ package at.hannibal2.skyhanni import at.hannibal2.skyhanni.api.CollectionAPI import at.hannibal2.skyhanni.config.ConfigManager import at.hannibal2.skyhanni.config.Features +import at.hannibal2.skyhanni.config.SackData import at.hannibal2.skyhanni.config.commands.Commands.init import at.hannibal2.skyhanni.data.* import at.hannibal2.skyhanni.data.repo.RepoManager @@ -187,7 +188,7 @@ class SkyHanniMod { loadModule(SlayerAPI) loadModule(PurseAPI()) loadModule(RiftAPI) - loadModule(SackAPI()) + loadModule(SackAPI) // features loadModule(BazaarOrderHelper()) @@ -334,7 +335,7 @@ class SkyHanniMod { loadModule(BingoCardTips()) loadModule(GardenVisitorDropStatistics) loadModule(CaptureFarmingGear()) - loadModule(SackDisplay()) + loadModule(SackDisplay) loadModule(GardenStartLocation) loadModule(PetCandyUsedDisplay()) loadModule(ServerRestartTitle()) @@ -420,7 +421,10 @@ class SkyHanniMod { configManager = ConfigManager() configManager.firstLoad() initLogging() - Runtime.getRuntime().addShutdownHook(Thread { configManager.saveConfig("shutdown-hook") }) + Runtime.getRuntime().addShutdownHook(Thread { + configManager.saveConfig("shutdown-hook") + configManager.saveSackData("shutdown-hook") + }) repo = RepoManager(configManager.configDirectory) try { repo.loadRepoInformation() @@ -455,6 +459,7 @@ class SkyHanniMod { @JvmStatic val feature: Features get() = configManager.features + val sackData: SackData get() = configManager.sackData lateinit var repo: RepoManager lateinit var configManager: ConfigManager val logger: Logger = LogManager.getLogger("SkyHanni") -- cgit