diff options
author | hannibal2 <24389977+hannibal00212@users.noreply.github.com> | 2023-01-07 03:47:44 +0100 |
---|---|---|
committer | hannibal2 <24389977+hannibal00212@users.noreply.github.com> | 2023-01-07 03:47:44 +0100 |
commit | 892429f7a1d3f433a759765b8d6e4d437ffd9899 (patch) | |
tree | a05d2d30d5eb3f8baa564ccd16b67615720c12b9 | |
parent | 2db3001ea732fd2d66ada70100459d095bb4ef26 (diff) | |
download | skyhanni-892429f7a1d3f433a759765b8d6e4d437ffd9899.tar.gz skyhanni-892429f7a1d3f433a759765b8d6e4d437ffd9899.tar.bz2 skyhanni-892429f7a1d3f433a759765b8d6e4d437ffd9899.zip |
More Kotlin love.
-rw-r--r-- | src/main/java/at/hannibal2/skyhanni/data/HyPixelData.kt | 11 |
1 files changed, 4 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 24738893f..2bb7c7678 100644 --- a/src/main/java/at/hannibal2/skyhanni/data/HyPixelData.kt +++ b/src/main/java/at/hannibal2/skyhanni/data/HyPixelData.kt @@ -27,13 +27,10 @@ class HyPixelData { var bingo = false fun readSkyBlockArea(): String { - for (line in ScoreboardData.sidebarLinesFormatted()) { - if (line.startsWith(" §7⏣ ")) { - return line.substring(5).removeColor() - } - } - - return "invalid" + return ScoreboardData.sidebarLinesFormatted() + .firstOrNull { it.startsWith(" §7⏣ ") } + ?.substring(5)?.removeColor() + ?: "invalid" } } |