aboutsummaryrefslogtreecommitdiff
path: root/src/main
diff options
context:
space:
mode:
authormartimavocado <39881008+martimavocado@users.noreply.github.com>2024-02-14 19:12:11 +0000
committerGitHub <noreply@github.com>2024-02-14 20:12:11 +0100
commit1ec3fad756813a6889746034d1710ffb175ce9b1 (patch)
tree2a5eb176814a16250f1e7359766823425876cbd6 /src/main
parentdf9f53b558999be18a80e500d26b62cbd26e5e28 (diff)
downloadskyhanni-1ec3fad756813a6889746034d1710ffb175ce9b1.tar.gz
skyhanni-1ec3fad756813a6889746034d1710ffb175ce9b1.tar.bz2
skyhanni-1ec3fad756813a6889746034d1710ffb175ce9b1.zip
Add auto mouse unlocking on plot teleport. #991
Diffstat (limited to 'src/main')
-rw-r--r--src/main/java/at/hannibal2/skyhanni/features/misc/LockMouseLook.kt7
1 files changed, 7 insertions, 0 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 d0c30af92..b7dd83d5f 100644
--- a/src/main/java/at/hannibal2/skyhanni/features/misc/LockMouseLook.kt
+++ b/src/main/java/at/hannibal2/skyhanni/features/misc/LockMouseLook.kt
@@ -2,6 +2,7 @@ package at.hannibal2.skyhanni.features.misc
import at.hannibal2.skyhanni.SkyHanniMod
import at.hannibal2.skyhanni.events.GuiRenderEvent
+import at.hannibal2.skyhanni.events.LorenzChatEvent
import at.hannibal2.skyhanni.events.LorenzWorldChangeEvent
import at.hannibal2.skyhanni.utils.ChatUtils
import at.hannibal2.skyhanni.utils.RenderUtils.renderString
@@ -24,6 +25,12 @@ object LockMouseLook {
}
}
+ @SubscribeEvent
+ fun onChat (event: LorenzChatEvent) {
+ if (!event.message.startsWith("§aTeleported you to §r§aPlot")) return
+ if (lockedMouse) toggleLock()
+ }
+
fun toggleLock() {
val gameSettings = Minecraft.getMinecraft().gameSettings ?: return
lockedMouse = !lockedMouse