From 78643fb1abdf765c6d91b70e83adacf9ea245ee1 Mon Sep 17 00:00:00 2001 From: hannibal2 <24389977+hannibal00212@users.noreply.github.com> Date: Thu, 3 Aug 2023 15:50:57 +0200 Subject: Fixed King Talisman --- .../at/hannibal2/skyhanni/features/mining/KingTalismanHelper.kt | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) (limited to 'src/main/java') diff --git a/src/main/java/at/hannibal2/skyhanni/features/mining/KingTalismanHelper.kt b/src/main/java/at/hannibal2/skyhanni/features/mining/KingTalismanHelper.kt index e3ee1eb9a..1d8f62d4f 100644 --- a/src/main/java/at/hannibal2/skyhanni/features/mining/KingTalismanHelper.kt +++ b/src/main/java/at/hannibal2/skyhanni/features/mining/KingTalismanHelper.kt @@ -36,7 +36,7 @@ class KingTalismanHelper { private var farDisplay = "" private var display = emptyList() - fun isNearby() = LorenzUtils.skyBlockArea == "Royal Palace" && kingLocation.distanceToPlayer() > 10 + fun isNearby() = LorenzUtils.skyBlockArea == "Royal Palace" && kingLocation.distanceToPlayer() < 10 @SubscribeEvent fun onTick(event: LorenzTickEvent) { @@ -48,7 +48,7 @@ class KingTalismanHelper { } update() - display = if (!isNearby()) allKingsDisplay else Collections.singletonList(farDisplay) + display = if (isNearby()) allKingsDisplay else Collections.singletonList(farDisplay) } fun isEnabled() = config.kingTalismanHelper && IslandType.DWARVEN_MINES.isInIsland() @@ -97,7 +97,6 @@ class KingTalismanHelper { "§7(§bin $time§7)" } - val currentString = if (current) "§6King " else "" if (missing && current) { farDisplay_ = "§cNext missing king: §7$king §eNow $missingTimeFormat" @@ -124,9 +123,9 @@ class KingTalismanHelper { val oneSbDay = 1000 * 60 * 20 val oneCircleTime = oneSbDay * kingCircles.size val kingTime = mutableMapOf() - for ((index, king) in kingCircles.withIndex()) { + for ((index, king) in kingCircles.reversed().withIndex()) { - val startTime = SkyBlockTime(day = index - 1) + val startTime = SkyBlockTime(day = index + 1) var timeNext = startTime.toMillis() while (timeNext < System.currentTimeMillis()) { timeNext += oneCircleTime -- cgit