aboutsummaryrefslogtreecommitdiff
path: root/src/main/java/at/hannibal2/skyhanni/data/HypixelData.kt
diff options
context:
space:
mode:
Diffstat (limited to 'src/main/java/at/hannibal2/skyhanni/data/HypixelData.kt')
-rw-r--r--src/main/java/at/hannibal2/skyhanni/data/HypixelData.kt16
1 files changed, 10 insertions, 6 deletions
diff --git a/src/main/java/at/hannibal2/skyhanni/data/HypixelData.kt b/src/main/java/at/hannibal2/skyhanni/data/HypixelData.kt
index 4d0cce395..7c017f8c5 100644
--- a/src/main/java/at/hannibal2/skyhanni/data/HypixelData.kt
+++ b/src/main/java/at/hannibal2/skyhanni/data/HypixelData.kt
@@ -28,12 +28,7 @@ class HypixelData {
var profileName = ""
var joinedWorld = 0L
- fun readSkyBlockArea(): String {
- return ScoreboardData.sidebarLinesFormatted
- .firstOrNull { it.startsWith(" §7⏣ ") || it.startsWith(" §5ф ") }
- ?.substring(5)?.removeColor()
- ?: "invalid"
- }
+ var skyBlockArea = "?"
}
private var loggerIslandChange = LorenzLogger("debug/island_change")
@@ -71,6 +66,15 @@ class HypixelData {
@SubscribeEvent
fun onTick(event: LorenzTickEvent) {
+ if (event.isMod(2)) {
+ if (LorenzUtils.inSkyBlock) {
+ skyBlockArea = ScoreboardData.sidebarLinesFormatted
+ .firstOrNull { it.startsWith(" §7⏣ ") || it.startsWith(" §5ф ") }
+ ?.substring(5)?.removeColor()
+ ?: "?"
+ }
+ }
+
if (!event.isMod(5)) return
if (!LorenzUtils.onHypixel) {