diff options
author | Empa <42304516+ItsEmpa@users.noreply.github.com> | 2024-01-21 00:00:05 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-01-21 00:00:05 +0100 |
commit | dce6f7d065745e752b43a0d455041e4d80762bea (patch) | |
tree | 6b69a8b0c67acf0f1478e1ca66a01162b6aa4bdc /src/main/java/at/hannibal2/skyhanni | |
parent | 4952ba38c69569bfec7f8afa208d37de9e0f8bba (diff) | |
download | skyhanni-dce6f7d065745e752b43a0d455041e4d80762bea.tar.gz skyhanni-dce6f7d065745e752b43a0d455041e4d80762bea.tar.bz2 skyhanni-dce6f7d065745e752b43a0d455041e4d80762bea.zip |
Fix: Added cooldown to Garden Warp Commands (#941)
Added cooldown to Garden Warp Commands. #941
Diffstat (limited to 'src/main/java/at/hannibal2/skyhanni')
-rw-r--r-- | src/main/java/at/hannibal2/skyhanni/features/garden/GardenWarpCommands.kt | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/src/main/java/at/hannibal2/skyhanni/features/garden/GardenWarpCommands.kt b/src/main/java/at/hannibal2/skyhanni/features/garden/GardenWarpCommands.kt index a25949350..57e67b725 100644 --- a/src/main/java/at/hannibal2/skyhanni/features/garden/GardenWarpCommands.kt +++ b/src/main/java/at/hannibal2/skyhanni/features/garden/GardenWarpCommands.kt @@ -1,19 +1,27 @@ package at.hannibal2.skyhanni.features.garden +import at.hannibal2.skyhanni.data.TitleManager import at.hannibal2.skyhanni.events.LorenzKeyPressEvent import at.hannibal2.skyhanni.events.MessageSendToServerEvent +import at.hannibal2.skyhanni.features.event.diana.BurrowWarpHelper +import at.hannibal2.skyhanni.features.event.diana.GriffinBurrowHelper import at.hannibal2.skyhanni.features.misc.LockMouseLook +import at.hannibal2.skyhanni.features.misc.trevor.TrevorFeatures import at.hannibal2.skyhanni.utils.LorenzUtils import at.hannibal2.skyhanni.utils.NEUItems +import at.hannibal2.skyhanni.utils.SimpleTimeMark import at.hannibal2.skyhanni.utils.StringUtils.matchMatcher import net.minecraft.client.Minecraft import net.minecraftforge.fml.common.eventhandler.SubscribeEvent +import kotlin.time.Duration.Companion.milliseconds +import kotlin.time.Duration.Companion.seconds class GardenWarpCommands { private val config get() = GardenAPI.config.gardenCommands // TODO repo private val tpPlotPattern = "/tp (?<plot>.*)".toPattern() + private var lastWarpTime = SimpleTimeMark.farPast() @SubscribeEvent fun onMessageSendToServer(event: MessageSendToServerEvent) { @@ -55,6 +63,8 @@ class GardenWarpCommands { else -> return } + if (lastWarpTime.passedSince() < 2.seconds) return + lastWarpTime = SimpleTimeMark.now() if (command == "tptoplot barn") { LockMouseLook.autoDisable() } |