aboutsummaryrefslogtreecommitdiff
path: root/src/main/java/at
diff options
context:
space:
mode:
authorhannibal2 <24389977+hannibal00212@users.noreply.github.com>2023-07-22 03:02:39 +0200
committerhannibal2 <24389977+hannibal00212@users.noreply.github.com>2023-07-22 03:02:39 +0200
commit86fbe3fbb96b27eef3f1a27dfd1505129ba52fd4 (patch)
tree7eac672acd467654578fee87b6644b242f2bf8b3 /src/main/java/at
parent53c45f4488f893bebfc8ad2d7919f163305bd09f (diff)
downloadskyhanni-86fbe3fbb96b27eef3f1a27dfd1505129ba52fd4.tar.gz
skyhanni-86fbe3fbb96b27eef3f1a27dfd1505129ba52fd4.tar.bz2
skyhanni-86fbe3fbb96b27eef3f1a27dfd1505129ba52fd4.zip
fixed random bug
Diffstat (limited to 'src/main/java/at')
-rw-r--r--src/main/java/at/hannibal2/skyhanni/data/HypixelData.kt19
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