diff options
Diffstat (limited to 'src/main/kotlin/io')
-rw-r--r-- | src/main/kotlin/io/github/moulberry/notenoughupdates/util/SidebarUtil.kt | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/src/main/kotlin/io/github/moulberry/notenoughupdates/util/SidebarUtil.kt b/src/main/kotlin/io/github/moulberry/notenoughupdates/util/SidebarUtil.kt index 503085f0..d51c2ea9 100644 --- a/src/main/kotlin/io/github/moulberry/notenoughupdates/util/SidebarUtil.kt +++ b/src/main/kotlin/io/github/moulberry/notenoughupdates/util/SidebarUtil.kt @@ -29,14 +29,15 @@ object SidebarUtil { fun readSidebarLines(cleanColor: Boolean = true, cleanSpecialCharacters: Boolean = true): List<String> { var result = readRawSidebarLines() if (cleanColor) result = result.map { Utils.cleanColour(it) } - if (cleanSpecialCharacters) result.map { cleanSB(it) } + if (cleanSpecialCharacters) result.map { cleanTeamName(it) } return result } @JvmStatic fun readRawSidebarLines() = fetchScoreboardLines().reversed() - private fun cleanSB(scoreboard: String) = + @JvmStatic + fun cleanTeamName(scoreboard: String) = scoreboard.toCharArray().filter { it.code in 21..126 || it.code == 167 }.joinToString(separator = "") private fun fetchScoreboardLines(): List<String> { |