From 08907c4b0b26f605a8c7a8ff846dd15351d5a168 Mon Sep 17 00:00:00 2001 From: hannibal2 <24389977+hannibal00212@users.noreply.github.com> Date: Thu, 2 Mar 2023 00:21:41 +0100 Subject: Add support for tier 1 minions in the minion craft helper. --- src/main/java/at/hannibal2/skyhanni/data/HyPixelData.kt | 13 +++++++++---- src/main/java/at/hannibal2/skyhanni/data/SendTitleHelper.kt | 2 +- 2 files changed, 10 insertions(+), 5 deletions(-) (limited to 'src/main/java/at/hannibal2/skyhanni/data') 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 } } -- cgit