aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNot a cow <104355555+Not-a-cowfr@users.noreply.github.com>2024-10-23 02:06:47 -0700
committerGitHub <noreply@github.com>2024-10-23 20:06:47 +1100
commit6a34143826f84922c4fb011be726e83e81fa41d9 (patch)
tree4e4e0ec982f9c19ef2e00fcad23b8fe37d194f5b
parent296debb19e9b2542dd07de7ea2b9ff66a07dfa71 (diff)
downloadSkyHanni-6a34143826f84922c4fb011be726e83e81fa41d9.tar.gz
SkyHanni-6a34143826f84922c4fb011be726e83e81fa41d9.tar.bz2
SkyHanni-6a34143826f84922c4fb011be726e83e81fa41d9.zip
Fix: Unlock mouse on barn tp (#2799)
Co-authored-by: Cal <cwolfson58@gmail.com>
-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()
}