diff options
author | hannibal2 <24389977+hannibal00212@users.noreply.github.com> | 2023-10-12 10:19:03 +0200 |
---|---|---|
committer | hannibal2 <24389977+hannibal00212@users.noreply.github.com> | 2023-10-12 10:19:03 +0200 |
commit | c1f6d3e50dfc6365906822df51326881d6b2f577 (patch) | |
tree | 8320212f513e050e355e9fcf657759e728aba8b1 /src/main/java/at | |
parent | b825b8e1d58348ba8ad853e4cc1c7ba672429bd3 (diff) | |
download | skyhanni-c1f6d3e50dfc6365906822df51326881d6b2f577.tar.gz skyhanni-c1f6d3e50dfc6365906822df51326881d6b2f577.tar.bz2 skyhanni-c1f6d3e50dfc6365906822df51326881d6b2f577.zip |
Better limbo leave detection.
Diffstat (limited to 'src/main/java/at')
-rw-r--r-- | src/main/java/at/hannibal2/skyhanni/features/misc/LimboTimeTracker.kt | 18 |
1 files changed, 14 insertions, 4 deletions
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 |