aboutsummaryrefslogtreecommitdiff
path: root/src/main/java
diff options
context:
space:
mode:
authorminhperry <46137516+minhperry@users.noreply.github.com>2024-10-02 09:59:02 +0200
committerGitHub <noreply@github.com>2024-10-02 09:59:02 +0200
commitd06878ca5d28d20fa835a41a0f931c7a123dffb8 (patch)
treed87678c1e78f2dde391b90aec0791efa6b3807f6 /src/main/java
parent1bf9db2453b5af2781b6de22afca6296ef395c57 (diff)
downloadskyhanni-d06878ca5d28d20fa835a41a0f931c7a123dffb8.tar.gz
skyhanni-d06878ca5d28d20fa835a41a0f931c7a123dffb8.tar.bz2
skyhanni-d06878ca5d28d20fa835a41a0f931c7a123dffb8.zip
Improvement: Added cooldown to Carnival NPC click (#2628)
Diffstat (limited to 'src/main/java')
-rw-r--r--src/main/java/at/hannibal2/skyhanni/features/event/carnival/CarnivalQuickStart.kt3
1 files changed, 3 insertions, 0 deletions
diff --git a/src/main/java/at/hannibal2/skyhanni/features/event/carnival/CarnivalQuickStart.kt b/src/main/java/at/hannibal2/skyhanni/features/event/carnival/CarnivalQuickStart.kt
index ee2a9028a..2257772c8 100644
--- a/src/main/java/at/hannibal2/skyhanni/features/event/carnival/CarnivalQuickStart.kt
+++ b/src/main/java/at/hannibal2/skyhanni/features/event/carnival/CarnivalQuickStart.kt
@@ -32,6 +32,7 @@ object CarnivalQuickStart {
private val cowboy by repoGroup.pattern("cowboy", "Carnival Cowboy")
private var lastChat = SimpleTimeMark.farPast()
+ private var lastClicked = SimpleTimeMark.farPast()
@SubscribeEvent
fun onEntityClick(event: EntityClickEvent) {
@@ -44,6 +45,8 @@ object CarnivalQuickStart {
pirate.matches(mob.name) -> "carnival_pirateman"
else -> return
}
+ if (lastClicked.passedSince() < 1.seconds) return
+ lastClicked = SimpleTimeMark.now()
HypixelCommands.npcOption(type, "r_2_1")
event.cancel()
}