aboutsummaryrefslogtreecommitdiff
path: root/src/main/java
diff options
context:
space:
mode:
authorhannibal2 <24389977+hannibal00212@users.noreply.github.com>2023-11-17 11:30:27 +0100
committerhannibal2 <24389977+hannibal00212@users.noreply.github.com>2023-11-17 11:30:27 +0100
commit3468dcc7df5d93157dd16d0a9b6d6ddbd736a5a0 (patch)
tree5078885fca10a2af93af514d77feda41d1c4cac7 /src/main/java
parente2e03722f8db36b51597cb254b889e3ce94b1dfa (diff)
downloadskyhanni-3468dcc7df5d93157dd16d0a9b6d6ddbd736a5a0.tar.gz
skyhanni-3468dcc7df5d93157dd16d0a9b6d6ddbd736a5a0.tar.bz2
skyhanni-3468dcc7df5d93157dd16d0a9b6d6ddbd736a5a0.zip
removed gray guess format, added support for breaking blocks time change.
Diffstat (limited to 'src/main/java')
-rw-r--r--src/main/java/at/hannibal2/skyhanni/features/garden/visitor/GardenVisitorTimer.kt20
1 files changed, 11 insertions, 9 deletions
diff --git a/src/main/java/at/hannibal2/skyhanni/features/garden/visitor/GardenVisitorTimer.kt b/src/main/java/at/hannibal2/skyhanni/features/garden/visitor/GardenVisitorTimer.kt
index 7e26e900b..9f7fbe367 100644
--- a/src/main/java/at/hannibal2/skyhanni/features/garden/visitor/GardenVisitorTimer.kt
+++ b/src/main/java/at/hannibal2/skyhanni/features/garden/visitor/GardenVisitorTimer.kt
@@ -136,14 +136,20 @@ class GardenVisitorTimer {
}
}
val sinceLastTimerUpdate = lastTimerUpdate.passedSince() - 100.milliseconds
- val showGrayGuess = visitorsAmount < 5 && sinceLastTimerUpdate in 500.milliseconds..60.seconds
+ val guessTime = visitorsAmount < 5 && sinceLastTimerUpdate in 500.milliseconds..60.seconds
+ if (guessTime) {
+ millis -= sinceLastTimerUpdate
+ }
val diff = lastMillis - millis
- if (diff == 0.seconds && visitorsAmount == lastVisitors && !showGrayGuess) return
+ if (diff == 0.seconds && visitorsAmount == lastVisitors) return
lastMillis = millis
lastVisitors = visitorsAmount
- val formatColor = if (queueFull) "6" else "e"
+ val formatColor = when {
+ queueFull -> "6"
+ else -> "e"
+ }
val extraSpeed = if (diff in 2.seconds..10.seconds) {
val factor = diff.inWholeSeconds.toDouble()
@@ -154,12 +160,7 @@ class GardenVisitorTimer {
SoundUtils.playBeepSound()
}
- val formatDuration = if (showGrayGuess) {
- val oneMinute = 60.seconds
- val min = TimeUtils.formatDuration(millis - oneMinute, maxUnits = 1)
- val sec = (oneMinute - sinceLastTimerUpdate).format(maxUnits = 1)
- "$min §7$sec"
- } else TimeUtils.formatDuration(millis)
+ val formatDuration = TimeUtils.formatDuration(millis)
val next = if (queueFull && (!isSixthVisitorEnabled() || millis.isNegative())) "§cQueue Full!" else {
"Next in §$formatColor$formatDuration$extraSpeed"
}
@@ -188,6 +189,7 @@ class GardenVisitorTimer {
fun onBlockBreak(event: CropClickEvent) {
if (!isEnabled()) return
sixthVisitorArrivalTime -= 100.milliseconds
+ lastTimerUpdate -= 100.milliseconds
}
private fun updateSixthVisitorArrivalTime() {