aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/main/java/io/github/moulberry/notenoughupdates/util/SBInfo.java5
-rw-r--r--src/main/kotlin/io/github/moulberry/notenoughupdates/util/SidebarUtil.kt5
2 files changed, 6 insertions, 4 deletions
diff --git a/src/main/java/io/github/moulberry/notenoughupdates/util/SBInfo.java b/src/main/java/io/github/moulberry/notenoughupdates/util/SBInfo.java
index 8de320d0..14a4d828 100644
--- a/src/main/java/io/github/moulberry/notenoughupdates/util/SBInfo.java
+++ b/src/main/java/io/github/moulberry/notenoughupdates/util/SBInfo.java
@@ -375,6 +375,7 @@ public class SBInfo {
boolean containsStranded = false;
boolean containsBingo = false;
for (String line : lines) { //Slayer stuff
+ line = SidebarUtil.cleanTeamName(line);
if (line.contains("Tarantula Broodfather")) {
slayer = "Tarantula";
} else if (line.contains("Revenant Horror")) {
@@ -386,8 +387,8 @@ public class SBInfo {
} else if (line.contains("Inferno Demonlord")) {
slayer = "Blaze";
}
- if (lines.contains("Slayer Quest") && SlayerOverlay.unloadOverlayTimer == -1 ||
- lines.contains("Slayer Quest") && System.currentTimeMillis() - SlayerOverlay.unloadOverlayTimer > 500) {
+ if (line.contains("Slayer Quest") && SlayerOverlay.unloadOverlayTimer == -1 ||
+ line.contains("Slayer Quest") && System.currentTimeMillis() - SlayerOverlay.unloadOverlayTimer > 500) {
SlayerOverlay.slayerQuest = true;
}
if (SlayerOverlay.slayerQuest) {
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> {