aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorhannibal2 <24389977+hannibal002@users.noreply.github.com>2024-10-09 00:18:24 +0200
committerGitHub <noreply@github.com>2024-10-09 09:18:24 +1100
commit5e71dc9572870b7dc7ab4358ee61718bec014ae1 (patch)
tree6a331e510bfc66de846586b4202d325ba88c8b78
parent86dd8b421b3a530f8ff5ef1197ce5aed3e5cc01e (diff)
downloadskyhanni-5e71dc9572870b7dc7ab4358ee61718bec014ae1.tar.gz
skyhanni-5e71dc9572870b7dc7ab4358ee61718bec014ae1.tar.bz2
skyhanni-5e71dc9572870b7dc7ab4358ee61718bec014ae1.zip
Fix: Experimentation Table Pet Rule (#2699)
Co-authored-by: hannibal2 <24389977+hannibal00212@users.noreply.github.com>
-rw-r--r--src/main/java/at/hannibal2/skyhanni/features/inventory/experimentationtable/GuardianReminder.kt10
1 files changed, 8 insertions, 2 deletions
diff --git a/src/main/java/at/hannibal2/skyhanni/features/inventory/experimentationtable/GuardianReminder.kt b/src/main/java/at/hannibal2/skyhanni/features/inventory/experimentationtable/GuardianReminder.kt
index 216cbf7c6..32157adf7 100644
--- a/src/main/java/at/hannibal2/skyhanni/features/inventory/experimentationtable/GuardianReminder.kt
+++ b/src/main/java/at/hannibal2/skyhanni/features/inventory/experimentationtable/GuardianReminder.kt
@@ -8,6 +8,7 @@ import at.hannibal2.skyhanni.events.InventoryFullyOpenedEvent
import at.hannibal2.skyhanni.skyhannimodule.SkyHanniModule
import at.hannibal2.skyhanni.utils.ChatUtils
import at.hannibal2.skyhanni.utils.ColorUtils.withAlpha
+import at.hannibal2.skyhanni.utils.DelayedRun
import at.hannibal2.skyhanni.utils.HypixelCommands
import at.hannibal2.skyhanni.utils.InventoryUtils
import at.hannibal2.skyhanni.utils.LorenzUtils
@@ -37,12 +38,17 @@ object GuardianReminder {
fun onInventory(event: InventoryFullyOpenedEvent) {
if (!isEnabled()) return
if (event.inventoryName != "Experimentation Table") return
- if (ExperimentationTableAPI.petNamePattern.matches(PetAPI.currentPet)) return
-
lastInventoryOpen = SimpleTimeMark.now()
+ DelayedRun.runDelayed(200.milliseconds, ::warn)
+ }
+
+ private fun warn() {
+ if (ExperimentationTableAPI.petNamePattern.matches(PetAPI.currentPet)) return
+
if (lastWarn.passedSince() < 5.seconds) return
lastWarn = SimpleTimeMark.now()
+
ChatUtils.clickToActionOrDisable(
"Use a §9§lGuardian Pet §efor more Exp in the Experimentation Table.",
config::guardianReminder,