diff options
author | Soopyboo32 <49228220+Soopyboo32@users.noreply.github.com> | 2022-09-23 21:06:05 +0800 |
---|---|---|
committer | Soopyboo32 <49228220+Soopyboo32@users.noreply.github.com> | 2022-09-23 21:06:05 +0800 |
commit | cb58fbc282aad987353a912d3c872de1d8f5534a (patch) | |
tree | d114c32a5b98855a1db05b44d4aeb26c748d426c | |
parent | a38700b5ae8822f159c7457d4d67e53f75ca63fa (diff) | |
download | SoopyV2-cb58fbc282aad987353a912d3c872de1d8f5534a.tar.gz SoopyV2-cb58fbc282aad987353a912d3c872de1d8f5534a.tar.bz2 SoopyV2-cb58fbc282aad987353a912d3c872de1d8f5534a.zip |
+ Fix potion timer going into the negatives
+ Make potion timer alert show as a title
-rw-r--r-- | src/features/hud/index.js | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/src/features/hud/index.js b/src/features/hud/index.js index f1cfa33..352a9d0 100644 --- a/src/features/hud/index.js +++ b/src/features/hud/index.js @@ -632,7 +632,7 @@ class Hud extends Feature { godPotTime = this.potsExpireAt["water_breathing"].time } - if (godPotTime > 0) { + if (godPotTime > 0 && godPotTime > Date.now()) { let timeLeft = "" if (godPotTime - Date.now() > 60000 * 60) { timeLeft = timeNumber2(godPotTime - Date.now()) @@ -643,6 +643,7 @@ class Hud extends Feature { if (this.potsOutAlert.getValue() && godPotTime - Date.now() < 60000 && Date.now() - (this.lastPotAlerts["godpot"] || 0) > 2 * 60000) { this.lastPotAlerts["godpot"] = Date.now() + Client.showTitle("&cPotion About to run out", "Your &6God potion&f is about to run out!", 20, 60, 20) ChatLib.chat(this.FeatureManager.messagePrefix + "Your God potion is about to run out!") } } @@ -651,6 +652,7 @@ class Hud extends Feature { let potData = this.potsExpireAt[k] if (potData.infinite) return if (basiclyEqual(potData.time, godPotTime, 1000)) return + if (potData.time < Date.now()) return if (k === "haste" && potData.level === 1) return @@ -658,6 +660,7 @@ class Hud extends Feature { if (this.potsOutAlert.getValue() && potData.time - Date.now() < 60000 && Date.now() - (this.lastPotAlerts[k] || 0) > 2 * 60000) { this.lastPotAlerts[k] = Date.now() + Client.showTitle("&cPotion About to run out", "Your &6" + potName + "&f is about to run out!", 20, 60, 20) ChatLib.chat(this.FeatureManager.messagePrefix + "Your " + potName + " is about to run out!") } |