diff options
author | J10a1n15 <45315647+j10a1n15@users.noreply.github.com> | 2024-03-23 17:12:12 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-03-23 17:12:12 +0100 |
commit | c03d6b26f0d5a8e1d99b5e8f49de0d3aa87969a9 (patch) | |
tree | bca33db37b38bf693c384fe7c1ae6e89d7d814f4 /src/main/java/at/hannibal2/skyhanni/data/HypixelData.kt | |
parent | f43775c7e097cdbc5ec2a63fb2edfc231922eefa (diff) | |
download | skyhanni-c03d6b26f0d5a8e1d99b5e8f49de0d3aa87969a9.tar.gz skyhanni-c03d6b26f0d5a8e1d99b5e8f49de0d3aa87969a9.tar.bz2 skyhanni-c03d6b26f0d5a8e1d99b5e8f49de0d3aa87969a9.zip |
Backend: Fixed usage of checkCurrentServerId() (#1177)
Diffstat (limited to 'src/main/java/at/hannibal2/skyhanni/data/HypixelData.kt')
-rw-r--r-- | src/main/java/at/hannibal2/skyhanni/data/HypixelData.kt | 18 |
1 files changed, 11 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 eb38187ca..9eb2aa5e7 100644 --- a/src/main/java/at/hannibal2/skyhanni/data/HypixelData.kt +++ b/src/main/java/at/hannibal2/skyhanni/data/HypixelData.kt @@ -117,26 +117,30 @@ class HypixelData { val mode get() = locraw["mode"] ?: "" val map get() = locraw["map"] ?: "" - fun getCurrentServerId(): String? { - if (!LorenzUtils.inSkyBlock) return null - if (serverId != null) return serverId + fun checkCurrentServerId() { + if (!LorenzUtils.inSkyBlock) return ScoreboardData.sidebarLinesFormatted.forEach { serverIdScoreboardPattern.matchMatcher(it) { val serverType = if (group("servertype") == "M") "mega" else "mini" serverId = "$serverType${group("serverid")}" - return serverId + return } } TabListData.getTabList().forEach { serverIdTablistPattern.matchMatcher(it) { serverId = group("serverid") - return serverId + return } } - return serverId + ErrorManager.logErrorWithData( + Exception("NoServerId"), "Could not find server id", + "islandType" to LorenzUtils.skyBlockIsland, + "tablist" to TabListData.getTabList(), + "scoreboard" to ScoreboardData.sidebarLinesFormatted + ) } fun getPlayersOnCurrentServer(): Int { @@ -303,7 +307,7 @@ class HypixelData { if (inSkyBlock) { checkIsland() checkSidebar() - getCurrentServerId() + checkCurrentServerId() } if (inSkyBlock == skyBlock) return |