aboutsummaryrefslogtreecommitdiff
path: root/src/main
diff options
context:
space:
mode:
Diffstat (limited to 'src/main')
-rw-r--r--src/main/java/at/hannibal2/skyhanni/features/garden/GardenWarpCommands.kt10
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()
}