From d06878ca5d28d20fa835a41a0f931c7a123dffb8 Mon Sep 17 00:00:00 2001 From: minhperry <46137516+minhperry@users.noreply.github.com> Date: Wed, 2 Oct 2024 09:59:02 +0200 Subject: Improvement: Added cooldown to Carnival NPC click (#2628) --- .../hannibal2/skyhanni/features/event/carnival/CarnivalQuickStart.kt | 3 +++ 1 file changed, 3 insertions(+) (limited to 'src/main/java/at/hannibal2/skyhanni') 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() } -- cgit