From d3e5eb36e3dc333d446fbf7959b1dff93e04793d Mon Sep 17 00:00:00 2001 From: MTOnline69 <97001154+MTOnline69@users.noreply.github.com> Date: Thu, 17 Oct 2024 19:27:37 +0100 Subject: [PATCH] untested better fix --- .../chocolatefactory/ChocolateFactoryTimeTowerManager.kt | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/src/main/java/at/hannibal2/skyhanni/features/inventory/chocolatefactory/ChocolateFactoryTimeTowerManager.kt b/src/main/java/at/hannibal2/skyhanni/features/inventory/chocolatefactory/ChocolateFactoryTimeTowerManager.kt index 29d29ab1d7a5..6ee1cb687343 100644 --- a/src/main/java/at/hannibal2/skyhanni/features/inventory/chocolatefactory/ChocolateFactoryTimeTowerManager.kt +++ b/src/main/java/at/hannibal2/skyhanni/features/inventory/chocolatefactory/ChocolateFactoryTimeTowerManager.kt @@ -22,7 +22,7 @@ object ChocolateFactoryTimeTowerManager { private val profileStorage get() = ChocolateFactoryAPI.profileStorage private var lastTimeTowerWarning = SimpleTimeMark.farPast() - private var warnedAboutLatestCharge = false + private var warnAboutNewCharge = false private var wasTimeTowerRecentlyActive = false @SubscribeEvent @@ -53,13 +53,13 @@ object ChocolateFactoryTimeTowerManager { profileStorage.currentTimeTowerUses++ nextCharge += ChocolateFactoryAPI.timeTowerChargeDuration() profileStorage.nextTimeTower = nextCharge - warnedAboutLatestCharge = false + warnAboutNewCharge = true } } if (currentCharges() > 0 && currentCharges() < maxCharges()) { if (!config.timeTowerWarning || timeTowerActive()) return - if (warnedAboutLatestCharge) return + if (!warnAboutNewCharge) return ChatUtils.clickableChat( "Your Time Tower has an available charge §7(${timeTowerCharges()})§e. " + "Click here to use one.", @@ -68,7 +68,7 @@ object ChocolateFactoryTimeTowerManager { ) SoundUtils.playBeepSound() lastTimeTowerWarning = SimpleTimeMark.now() - warnedAboutLatestCharge = true + warnAboutNewCharge = false } checkTimeTowerWarning(false) } @@ -106,7 +106,6 @@ object ChocolateFactoryTimeTowerManager { ) SoundUtils.playBeepSound() lastTimeTowerWarning = SimpleTimeMark.now() - warnedAboutLatestCharge = true } fun timeTowerCharges(): String {