aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMTOnline69 <97001154+MTOnline69@users.noreply.github.com>2024-10-18 17:39:39 +0100
committerGitHub <noreply@github.com>2024-10-18 18:39:39 +0200
commit33a960897d877b329b0f1eb2cffc7bc6cdc9c341 (patch)
tree3d6f29e71c7ae84248b5de121f2ff12537c04740
parentdf28fc40ec48a7d9779d1a48932f47fff2d7b8d5 (diff)
downloadSkyHanni-33a960897d877b329b0f1eb2cffc7bc6cdc9c341.tar.gz
SkyHanni-33a960897d877b329b0f1eb2cffc7bc6cdc9c341.tar.bz2
SkyHanni-33a960897d877b329b0f1eb2cffc7bc6cdc9c341.zip
Fix: Time Tower usage warnings sending excessively (#2751)
Co-authored-by: calwolfson <cwolfson58@gmail.com>
-rw-r--r--src/main/java/at/hannibal2/skyhanni/features/inventory/chocolatefactory/ChocolateFactoryTimeTowerManager.kt10
1 files changed, 5 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 39e0df3da..6ee1cb687 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() < maxCharges()) {
+ 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)
}