diff options
Diffstat (limited to 'src/main')
-rw-r--r-- | src/main/java/at/hannibal2/skyhanni/SkyHanniMod.kt | 1 | ||||
-rw-r--r-- | src/main/java/at/hannibal2/skyhanni/data/SackAPI.kt | 8 |
2 files changed, 4 insertions, 5 deletions
diff --git a/src/main/java/at/hannibal2/skyhanni/SkyHanniMod.kt b/src/main/java/at/hannibal2/skyhanni/SkyHanniMod.kt index 4bb551f87..83ef3360f 100644 --- a/src/main/java/at/hannibal2/skyhanni/SkyHanniMod.kt +++ b/src/main/java/at/hannibal2/skyhanni/SkyHanniMod.kt @@ -423,7 +423,6 @@ class SkyHanniMod { initLogging() Runtime.getRuntime().addShutdownHook(Thread { configManager.saveConfig("shutdown-hook") - configManager.saveSackData("shutdown-hook") }) repo = RepoManager(configManager.configDirectory) try { diff --git a/src/main/java/at/hannibal2/skyhanni/data/SackAPI.kt b/src/main/java/at/hannibal2/skyhanni/data/SackAPI.kt index e2102c6ec..89363fd7c 100644 --- a/src/main/java/at/hannibal2/skyhanni/data/SackAPI.kt +++ b/src/main/java/at/hannibal2/skyhanni/data/SackAPI.kt @@ -270,20 +270,20 @@ object SackAPI { sackData = sackData.editCopy { this[item] = SackItem(amount, 0, 0) } } - fun fetchSackItem(item: NEUInternalName): SackItem? { + fun fetchSackItem(item: NEUInternalName): SackItem { sackData = ProfileStorageData.sackProfiles?.sackContents ?: return SackItem(0, 0, -1) if (sackData.containsKey(item)) { - return sackData[item] + return sackData[item] ?: return SackItem(0, 0, -1) } sackData = sackData.editCopy { this[item] = SackItem(0, 0, 2) } - return sackData[item] + return sackData[item] ?: return SackItem(0, 0, -1) } private fun saveSackData() { ProfileStorageData.sackProfiles?.sackContents = sackData - SkyHanniMod.configManager.saveSackData("shutdown-hook") + SkyHanniMod.configManager.saveSackData("saving-data") } data class SackGemstone( |