aboutsummaryrefslogtreecommitdiff
path: root/src/main/kotlin/io
diff options
context:
space:
mode:
authorNopoTheGamer <40329022+NopoTheGamer@users.noreply.github.com>2023-05-28 03:20:19 +1000
committerGitHub <noreply@github.com>2023-05-27 19:20:19 +0200
commit15a05d39cabf4dd8a7ecc8a4328a2d0dec6d2111 (patch)
treea9e0da8e807c49ba45de92bc2f584dfc6ece1e89 /src/main/kotlin/io
parent009c6cca93f0b8ee3dbc81a2929867c673d96f4f (diff)
downloadNotEnoughUpdates-15a05d39cabf4dd8a7ecc8a4328a2d0dec6d2111.tar.gz
NotEnoughUpdates-15a05d39cabf4dd8a7ecc8a4328a2d0dec6d2111.tar.bz2
NotEnoughUpdates-15a05d39cabf4dd8a7ecc8a4328a2d0dec6d2111.zip
Fixed slayer overlay (#701)
Diffstat (limited to 'src/main/kotlin/io')
-rw-r--r--src/main/kotlin/io/github/moulberry/notenoughupdates/util/SidebarUtil.kt5
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> {