From 57fea067d5a598520e1e5189fe7c8d3de6d60356 Mon Sep 17 00:00:00 2001 From: hannibal2 <24389977+hannibal00212@users.noreply.github.com> Date: Tue, 28 Nov 2023 23:45:35 +0100 Subject: Fixed visitor timer counting down too fast sometimes. --- .../skyhanni/features/garden/visitor/GardenVisitorTimer.kt | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'src') 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() { -- cgit