diff options
author | hannibal2 <24389977+hannibal00212@users.noreply.github.com> | 2023-11-05 12:43:02 +0100 |
---|---|---|
committer | hannibal2 <24389977+hannibal00212@users.noreply.github.com> | 2023-11-05 12:43:02 +0100 |
commit | 31c2e93d5cfd21c8a2a6ce68ea13c7d9256c5af6 (patch) | |
tree | 35e98543c2e9f44a891065aacafabe4868d6ce0d /src/main | |
parent | 7721be72deb7acb5e3f133482a51e1286f875c47 (diff) | |
download | skyhanni-31c2e93d5cfd21c8a2a6ce68ea13c7d9256c5af6.tar.gz skyhanni-31c2e93d5cfd21c8a2a6ce68ea13c7d9256c5af6.tar.bz2 skyhanni-31c2e93d5cfd21c8a2a6ce68ea13c7d9256c5af6.zip |
code cleanup
Diffstat (limited to 'src/main')
-rw-r--r-- | src/main/java/at/hannibal2/skyhanni/config/Features.java | 4 | ||||
-rw-r--r-- | src/main/java/at/hannibal2/skyhanni/data/ProfileStorageData.kt | 19 |
2 files changed, 14 insertions, 9 deletions
diff --git a/src/main/java/at/hannibal2/skyhanni/config/Features.java b/src/main/java/at/hannibal2/skyhanni/config/Features.java index ce6e0f1b2..9ae08f094 100644 --- a/src/main/java/at/hannibal2/skyhanni/config/Features.java +++ b/src/main/java/at/hannibal2/skyhanni/config/Features.java @@ -44,8 +44,8 @@ public class Features extends Config { @Override public List<Social> getSocials() { return Arrays.asList( - Social.forLink("Join our Discord", DISCORD, "https://discord.com/invite/skyhanni-997079228510117908"), - Social.forLink("Look at the code", GITHUB, "https://github.com/hannibal002/SkyHanni") + Social.forLink("Join our Discord", DISCORD, "https://discord.com/invite/skyhanni-997079228510117908"), + Social.forLink("Look at the code", GITHUB, "https://github.com/hannibal002/SkyHanni") ); } diff --git a/src/main/java/at/hannibal2/skyhanni/data/ProfileStorageData.kt b/src/main/java/at/hannibal2/skyhanni/data/ProfileStorageData.kt index d14372419..a8770e1f2 100644 --- a/src/main/java/at/hannibal2/skyhanni/data/ProfileStorageData.kt +++ b/src/main/java/at/hannibal2/skyhanni/data/ProfileStorageData.kt @@ -24,14 +24,15 @@ object ProfileStorageData { private var nextProfile: String? = null + // TODO USE SH-REPO + private val profileSwitchPattern = "§7Switching to profile (?<name>.*)\\.\\.\\.".toPattern() private var sackPlayers: SackData.PlayerSpecific? = null var sackProfiles: SackData.ProfileSpecific? = null @SubscribeEvent(priority = EventPriority.HIGHEST) fun onChat(event: LorenzChatEvent) { - // TODO USE SH-REPO - "§7Switching to profile (?<name>.*)\\.\\.\\.".toPattern().matchMatcher(event.message) { + profileSwitchPattern.matchMatcher(event.message) { nextProfile = group("name").lowercase() loaded = false PreProfileSwitchEvent().postAndCatch() @@ -53,7 +54,7 @@ object ProfileStorageData { LorenzUtils.error("sackPlayers after profile swap can not be set: sackPlayers is null!") return } - loadProfileSpecific(playerSpecific, sackPlayers, profileName, "profile swap (chat message)") + loadProfileSpecific(playerSpecific, sackPlayers, profileName) ConfigLoadEvent().postAndCatch() } @@ -72,7 +73,7 @@ object ProfileStorageData { if (profileSpecific == null) { val profileName = event.name - loadProfileSpecific(playerSpecific, sackPlayers, profileName, "first join (chat message)") + loadProfileSpecific(playerSpecific, sackPlayers, profileName) } } @@ -85,7 +86,7 @@ object ProfileStorageData { val pattern = "§e§lProfile: §r§a(?<name>.*)".toPattern() pattern.matchMatcher(line) { val profileName = group("name").lowercase() - loadProfileSpecific(playerSpecific, sackPlayers, profileName, "tab list") + loadProfileSpecific(playerSpecific, sackPlayers, profileName) nextProfile = null return } @@ -105,12 +106,16 @@ object ProfileStorageData { noTabListTime = System.currentTimeMillis() LorenzUtils.chat( "§c[SkyHanni] Extra Information from Tab list not found! " + - "Enable it: SkyBlock Menu ➜ Settings ➜ Personal ➜ User Interface ➜ Player List Info" + "Enable it: SkyBlock Menu ➜ Settings ➜ Personal ➜ User Interface ➜ Player List Info" ) } } - private fun loadProfileSpecific(playerSpecific: Storage.PlayerSpecific, sackProfile: SackData.PlayerSpecific, profileName: String, reason: String) { + private fun loadProfileSpecific( + playerSpecific: Storage.PlayerSpecific, + sackProfile: SackData.PlayerSpecific, + profileName: String + ) { noTabListTime = -1 profileSpecific = playerSpecific.profiles.getOrPut(profileName) { Storage.ProfileSpecific() } sackProfiles = sackProfile.profiles.getOrPut(profileName) { SackData.ProfileSpecific() } |