diff options
Diffstat (limited to 'src/main/java/at/hannibal2')
-rw-r--r-- | src/main/java/at/hannibal2/skyhanni/data/HypixelData.kt | 19 |
1 files changed, 12 insertions, 7 deletions
diff --git a/src/main/java/at/hannibal2/skyhanni/data/HypixelData.kt b/src/main/java/at/hannibal2/skyhanni/data/HypixelData.kt index 1ee266cc4..84f8503e6 100644 --- a/src/main/java/at/hannibal2/skyhanni/data/HypixelData.kt +++ b/src/main/java/at/hannibal2/skyhanni/data/HypixelData.kt @@ -74,13 +74,7 @@ class HypixelData { .firstOrNull { it.startsWith(" §7⏣ ") || it.startsWith(" §5ф ") } ?.substring(5)?.removeColor() ?: "?" - if (profileName.isEmpty()) { - val text = TabListData.getTabList().first { it.contains("Profile:") } - tabListProfilePattern.matchMatcher(text) { - profileName = group("profile").lowercase() - ProfileJoinEvent(profileName).postAndCatch() - } - } + checkProfileName() } } @@ -104,6 +98,17 @@ class HypixelData { skyBlock = inSkyBlock } + private fun checkProfileName(): Boolean { + if (profileName.isEmpty()) { + val text = TabListData.getTabList().firstOrNull { it.contains("Profile:") } ?: return true + tabListProfilePattern.matchMatcher(text) { + profileName = group("profile").lowercase() + ProfileJoinEvent(profileName).postAndCatch() + } + } + return false + } + private fun checkHypixel() { val list = ScoreboardData.sidebarLinesFormatted if (list.isEmpty()) return |