diff options
Diffstat (limited to 'src/main/java/at/hannibal2/skyhanni/data')
-rw-r--r-- | src/main/java/at/hannibal2/skyhanni/data/HyPixelData.kt | 13 | ||||
-rw-r--r-- | src/main/java/at/hannibal2/skyhanni/data/SendTitleHelper.kt | 2 |
2 files changed, 10 insertions, 5 deletions
diff --git a/src/main/java/at/hannibal2/skyhanni/data/HyPixelData.kt b/src/main/java/at/hannibal2/skyhanni/data/HyPixelData.kt index d6b1506a3..9d620f565 100644 --- a/src/main/java/at/hannibal2/skyhanni/data/HyPixelData.kt +++ b/src/main/java/at/hannibal2/skyhanni/data/HyPixelData.kt @@ -26,6 +26,8 @@ class HyPixelData { var stranded = false var bingo = false + var profile = "" + fun readSkyBlockArea(): String { return ScoreboardData.sidebarLinesFormatted() .firstOrNull { it.startsWith(" §7⏣ ") } @@ -61,12 +63,15 @@ class HyPixelData { val message = event.message.removeColor().lowercase() if (message.startsWith("your profile was changed to:")) { - val stripped = message.replace("your profile was changed to:", "").replace("(co-op)", "").trim() - ProfileJoinEvent(stripped).postAndCatch() + val newProfile = message.replace("your profile was changed to:", "").replace("(co-op)", "").trim() + profile = newProfile + ProfileJoinEvent(newProfile).postAndCatch() } if (message.startsWith("you are playing on profile:")) { - val stripped = message.replace("you are playing on profile:", "").replace("(co-op)", "").trim() - ProfileJoinEvent(stripped).postAndCatch() + val newProfile = message.replace("you are playing on profile:", "").replace("(co-op)", "").trim() + if (profile == newProfile) return + profile = newProfile + ProfileJoinEvent(newProfile).postAndCatch() } } diff --git a/src/main/java/at/hannibal2/skyhanni/data/SendTitleHelper.kt b/src/main/java/at/hannibal2/skyhanni/data/SendTitleHelper.kt index ec7f0b5ae..502bc2023 100644 --- a/src/main/java/at/hannibal2/skyhanni/data/SendTitleHelper.kt +++ b/src/main/java/at/hannibal2/skyhanni/data/SendTitleHelper.kt @@ -14,7 +14,7 @@ class SendTitleHelper { private var endTime = 0L fun sendTitle(text: String, duration: Int) { - display = text + display = "§f$text" endTime = System.currentTimeMillis() + duration } } |