diff options
author | hannibal2 <24389977+hannibal00212@users.noreply.github.com> | 2023-11-28 23:45:35 +0100 |
---|---|---|
committer | hannibal2 <24389977+hannibal00212@users.noreply.github.com> | 2023-11-28 23:45:35 +0100 |
commit | 57fea067d5a598520e1e5189fe7c8d3de6d60356 (patch) | |
tree | 70c52677a692946e468bec589b7a2fe87a60a459 /src/main/java/at/hannibal2/skyhanni/features | |
parent | 20ad432844c720fd3c2fffc56505a300d7462c14 (diff) | |
download | skyhanni-57fea067d5a598520e1e5189fe7c8d3de6d60356.tar.gz skyhanni-57fea067d5a598520e1e5189fe7c8d3de6d60356.tar.bz2 skyhanni-57fea067d5a598520e1e5189fe7c8d3de6d60356.zip |
Fixed visitor timer counting down too fast sometimes.
Diffstat (limited to 'src/main/java/at/hannibal2/skyhanni/features')
-rw-r--r-- | src/main/java/at/hannibal2/skyhanni/features/garden/visitor/GardenVisitorTimer.kt | 7 |
1 files changed, 6 insertions, 1 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 31bab7d56..f7bed5ef6 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 @@ -22,6 +22,7 @@ import net.minecraftforge.fml.common.eventhandler.SubscribeEvent import kotlin.concurrent.fixedRateTimer import kotlin.time.Duration import kotlin.time.Duration.Companion.milliseconds +import kotlin.time.Duration.Companion.minutes import kotlin.time.Duration.Companion.seconds import kotlin.time.DurationUnit import kotlin.time.toDuration @@ -199,7 +200,11 @@ class GardenVisitorTimer { fun onBlockBreak(event: CropClickEvent) { if (!isEnabled()) return sixthVisitorArrivalTime -= 100.milliseconds - lastTimerUpdate -= 100.milliseconds + + // We only need manually retracting the time when hypixel shows 6 minutes or above + if (lastMillis > 5.minutes) { + lastTimerUpdate -= 100.milliseconds + } } private fun updateSixthVisitorArrivalTime() { |