aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorhannibal2 <24389977+hannibal00212@users.noreply.github.com>2023-10-12 10:19:03 +0200
committerhannibal2 <24389977+hannibal00212@users.noreply.github.com>2023-10-12 10:19:03 +0200
commitc1f6d3e50dfc6365906822df51326881d6b2f577 (patch)
tree8320212f513e050e355e9fcf657759e728aba8b1 /src
parentb825b8e1d58348ba8ad853e4cc1c7ba672429bd3 (diff)
downloadskyhanni-c1f6d3e50dfc6365906822df51326881d6b2f577.tar.gz
skyhanni-c1f6d3e50dfc6365906822df51326881d6b2f577.tar.bz2
skyhanni-c1f6d3e50dfc6365906822df51326881d6b2f577.zip
Better limbo leave detection.
Diffstat (limited to 'src')
-rw-r--r--src/main/java/at/hannibal2/skyhanni/features/misc/LimboTimeTracker.kt18
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