aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/main/java/at/hannibal2/skyhanni/features/misc/LockMouseLook.kt9
1 files changed, 8 insertions, 1 deletions
diff --git a/src/main/java/at/hannibal2/skyhanni/features/misc/LockMouseLook.kt b/src/main/java/at/hannibal2/skyhanni/features/misc/LockMouseLook.kt
index f7d8e20be..3e1388a67 100644
--- a/src/main/java/at/hannibal2/skyhanni/features/misc/LockMouseLook.kt
+++ b/src/main/java/at/hannibal2/skyhanni/features/misc/LockMouseLook.kt
@@ -8,13 +8,20 @@ import at.hannibal2.skyhanni.events.LorenzWorldChangeEvent
import at.hannibal2.skyhanni.features.garden.SensitivityReducer
import at.hannibal2.skyhanni.skyhannimodule.SkyHanniModule
import at.hannibal2.skyhanni.utils.ChatUtils
+import at.hannibal2.skyhanni.utils.RegexUtils.matches
import at.hannibal2.skyhanni.utils.RenderUtils.renderString
+import at.hannibal2.skyhanni.utils.repopatterns.RepoPattern
import net.minecraft.client.Minecraft
import net.minecraftforge.fml.common.eventhandler.SubscribeEvent
@SkyHanniModule
object LockMouseLook {
+ private val gardenTeleportPattern by RepoPattern.pattern(
+ "chat.garden.teleport",
+ "§aTeleported you to .*",
+ )
+
private val config get() = SkyHanniMod.feature.misc
private val storage get() = SkyHanniMod.feature.storage
var lockedMouse = false
@@ -32,7 +39,7 @@ object LockMouseLook {
@SubscribeEvent
fun onChat(event: LorenzChatEvent) {
- if (!event.message.startsWith("§aTeleported you to §r§aPlot")) return
+ if (!gardenTeleportPattern.matches(event.message)) return
if (lockedMouse) toggleLock()
}