diff options
author | hannibal2 <24389977+hannibal002@users.noreply.github.com> | 2024-03-15 23:25:29 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-03-15 23:25:29 +0100 |
commit | 95cb1d7c7be44a6b7f9611e6420ff6b50146a830 (patch) | |
tree | 7302978e3e3f5195376e49d726167916be68a434 /src/main/java/at/hannibal2/skyhanni/data | |
parent | 951bb6a26559b6db288a68a00f83d9ea45b0c3d8 (diff) | |
download | skyhanni-95cb1d7c7be44a6b7f9611e6420ff6b50146a830.tar.gz skyhanni-95cb1d7c7be44a6b7f9611e6420ff6b50146a830.tar.bz2 skyhanni-95cb1d7c7be44a6b7f9611e6420ff6b50146a830.zip |
Backend: Storage Config Moving (#1171)
Co-authored-by: hannibal2 <24389977+hannibal00212@users.noreply.github.com>
Diffstat (limited to 'src/main/java/at/hannibal2/skyhanni/data')
-rw-r--r-- | src/main/java/at/hannibal2/skyhanni/data/ProfileStorageData.kt | 13 |
1 files changed, 7 insertions, 6 deletions
diff --git a/src/main/java/at/hannibal2/skyhanni/data/ProfileStorageData.kt b/src/main/java/at/hannibal2/skyhanni/data/ProfileStorageData.kt index 29a32d066..606928196 100644 --- a/src/main/java/at/hannibal2/skyhanni/data/ProfileStorageData.kt +++ b/src/main/java/at/hannibal2/skyhanni/data/ProfileStorageData.kt @@ -2,7 +2,8 @@ package at.hannibal2.skyhanni.data import at.hannibal2.skyhanni.SkyHanniMod import at.hannibal2.skyhanni.config.SackData -import at.hannibal2.skyhanni.config.Storage +import at.hannibal2.skyhanni.config.storage.PlayerSpecificStorage +import at.hannibal2.skyhanni.config.storage.ProfileSpecificStorage import at.hannibal2.skyhanni.events.ConfigLoadEvent import at.hannibal2.skyhanni.events.HypixelJoinEvent import at.hannibal2.skyhanni.events.LorenzTickEvent @@ -20,8 +21,8 @@ import kotlin.time.Duration.Companion.seconds object ProfileStorageData { - var playerSpecific: Storage.PlayerSpecific? = null - var profileSpecific: Storage.ProfileSpecific? = null + var playerSpecific: PlayerSpecificStorage? = null + var profileSpecific: ProfileSpecificStorage? = null var loaded = false private var noTabListTime = SimpleTimeMark.farPast() @@ -83,12 +84,12 @@ object ProfileStorageData { } private fun loadProfileSpecific( - playerSpecific: Storage.PlayerSpecific, + playerSpecific: PlayerSpecificStorage, sackProfile: SackData.PlayerSpecific, profileName: String, ) { noTabListTime = SimpleTimeMark.farPast() - profileSpecific = playerSpecific.profiles.getOrPut(profileName) { Storage.ProfileSpecific() } + profileSpecific = playerSpecific.profiles.getOrPut(profileName) { ProfileSpecificStorage() } sackProfiles = sackProfile.profiles.getOrPut(profileName) { SackData.ProfileSpecific() } loaded = true ConfigLoadEvent().postAndCatch() @@ -97,7 +98,7 @@ object ProfileStorageData { @SubscribeEvent fun onHypixelJoin(event: HypixelJoinEvent) { val playerUuid = LorenzUtils.getRawPlayerUuid() - playerSpecific = SkyHanniMod.feature.storage.players.getOrPut(playerUuid) { Storage.PlayerSpecific() } + playerSpecific = SkyHanniMod.feature.storage.players.getOrPut(playerUuid) { PlayerSpecificStorage() } sackPlayers = SkyHanniMod.sackData.players.getOrPut(playerUuid) { SackData.PlayerSpecific() } ConfigLoadEvent().postAndCatch() } |