From 903d2605a90f541df96129bb30ea9bbe084385f7 Mon Sep 17 00:00:00 2001 From: J10a1n15 <45315647+j10a1n15@users.noreply.github.com> Date: Fri, 29 Mar 2024 15:47:58 +0100 Subject: Technical Improvement: Use RepoPattern for inSkyBlock check (#1312) --- src/main/java/at/hannibal2/skyhanni/data/HypixelData.kt | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) (limited to 'src/main/java/at/hannibal2/skyhanni') diff --git a/src/main/java/at/hannibal2/skyhanni/data/HypixelData.kt b/src/main/java/at/hannibal2/skyhanni/data/HypixelData.kt index 9ab6993d2..b38638af6 100644 --- a/src/main/java/at/hannibal2/skyhanni/data/HypixelData.kt +++ b/src/main/java/at/hannibal2/skyhanni/data/HypixelData.kt @@ -78,6 +78,10 @@ class HypixelData { "guesting.scoreboard", "SKYBLOCK GUEST" ) + private val scoreboardTitlePattern by patternGroup.pattern( + "scoreboard.title", + "SK[YI]BLOCK" + ) var hypixelLive = false var hypixelAlpha = false @@ -401,7 +405,6 @@ class HypixelData { val objective = world.scoreboard.getObjectiveInDisplaySlot(1) ?: return false val displayName = objective.displayName val scoreboardTitle = displayName.removeColor() - return scoreboardTitle.contains("SKYBLOCK") || - scoreboardTitle.contains("SKIBLOCK") // April 1st jokes are so funny + return scoreboardTitlePattern.matches(scoreboardTitle) } } -- cgit