From c1f6d3e50dfc6365906822df51326881d6b2f577 Mon Sep 17 00:00:00 2001 From: hannibal2 <24389977+hannibal00212@users.noreply.github.com> Date: Thu, 12 Oct 2023 10:19:03 +0200 Subject: Better limbo leave detection. --- .../skyhanni/features/misc/LimboTimeTracker.kt | 18 ++++++++++++++---- 1 file changed, 14 insertions(+), 4 deletions(-) (limited to 'src/main/java/at') diff --git a/src/main/java/at/hannibal2/skyhanni/features/misc/LimboTimeTracker.kt b/src/main/java/at/hannibal2/skyhanni/features/misc/LimboTimeTracker.kt index 7d4df6626..3fc6e734b 100644 --- a/src/main/java/at/hannibal2/skyhanni/features/misc/LimboTimeTracker.kt +++ b/src/main/java/at/hannibal2/skyhanni/features/misc/LimboTimeTracker.kt @@ -30,11 +30,8 @@ class LimboTimeTracker { if (!inLimbo) return val passedSince = limboJoinTime.passedSince() - val duration = passedSince.format() if (passedSince > 5.seconds) { - inLimbo = false - if (!isEnabled()) return - LorenzUtils.run { chat("§e[SkyHanni] You left the limbo after §b$duration") } + leaveLimbo() } } @@ -43,9 +40,22 @@ class LimboTimeTracker { if (!isEnabled()) return if (!inLimbo) return + if (LorenzUtils.inSkyBlock) { + leaveLimbo() + return + } + val duration = limboJoinTime.passedSince().format() config.showTimeInLimboPosition.renderString("§eIn limbo since §b$duration", posLabel = "Limbo Time Tracker") } + private fun leaveLimbo() { + inLimbo = false + if (!isEnabled()) return + val passedSince = limboJoinTime.passedSince() + val duration = passedSince.format() + LorenzUtils.run { chat("§e[SkyHanni] You left the limbo after §b$duration") } + } + fun isEnabled() = config.showTimeInLimbo } \ No newline at end of file -- cgit