diff options
author | martimavocado <39881008+martimavocado@users.noreply.github.com> | 2024-02-14 19:12:11 +0000 |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-02-14 20:12:11 +0100 |
commit | 1ec3fad756813a6889746034d1710ffb175ce9b1 (patch) | |
tree | 2a5eb176814a16250f1e7359766823425876cbd6 /src/main/java/at | |
parent | df9f53b558999be18a80e500d26b62cbd26e5e28 (diff) | |
download | skyhanni-1ec3fad756813a6889746034d1710ffb175ce9b1.tar.gz skyhanni-1ec3fad756813a6889746034d1710ffb175ce9b1.tar.bz2 skyhanni-1ec3fad756813a6889746034d1710ffb175ce9b1.zip |
Add auto mouse unlocking on plot teleport. #991
Diffstat (limited to 'src/main/java/at')
-rw-r--r-- | src/main/java/at/hannibal2/skyhanni/features/misc/LockMouseLook.kt | 7 |
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 |