Skip to content

Commit

Permalink
untested better fix
Browse files Browse the repository at this point in the history
  • Loading branch information
MTOnline69 committed Oct 17, 2024
1 parent ebf9876 commit d3e5eb3
Showing 1 changed file with 4 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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.",
Expand All @@ -68,7 +68,7 @@ object ChocolateFactoryTimeTowerManager {
)
SoundUtils.playBeepSound()
lastTimeTowerWarning = SimpleTimeMark.now()
warnedAboutLatestCharge = true
warnAboutNewCharge = false
}
checkTimeTowerWarning(false)
}
Expand Down Expand Up @@ -106,7 +106,6 @@ object ChocolateFactoryTimeTowerManager {
)
SoundUtils.playBeepSound()
lastTimeTowerWarning = SimpleTimeMark.now()
warnedAboutLatestCharge = true
}

fun timeTowerCharges(): String {
Expand Down

0 comments on commit d3e5eb3

Please sign in to comment.