aboutsummaryrefslogtreecommitdiff
path: root/src/main/java/at/hannibal2/skyhanni/features
diff options
context:
space:
mode:
authorhannibal2 <24389977+hannibal00212@users.noreply.github.com>2023-11-26 13:47:39 +0100
committerhannibal2 <24389977+hannibal00212@users.noreply.github.com>2023-11-26 13:47:39 +0100
commit09e1f680f34ec1ad1df16afdaceb7cce58442ade (patch)
treebf2fb25104839d3b07887d2d968a61cc57b6176f /src/main/java/at/hannibal2/skyhanni/features
parent4dba63532ad6723e99c95f00bd0cd8a774a33752 (diff)
downloadskyhanni-09e1f680f34ec1ad1df16afdaceb7cce58442ade.tar.gz
skyhanni-09e1f680f34ec1ad1df16afdaceb7cce58442ade.tar.bz2
skyhanni-09e1f680f34ec1ad1df16afdaceb7cce58442ade.zip
Automatic unlocking /shmouselock when teleporting in the garden.
Diffstat (limited to 'src/main/java/at/hannibal2/skyhanni/features')
-rw-r--r--src/main/java/at/hannibal2/skyhanni/features/garden/GardenWarpCommands.kt (renamed from src/main/java/at/hannibal2/skyhanni/features/garden/GardenCommands.kt)8
-rw-r--r--src/main/java/at/hannibal2/skyhanni/features/misc/LockMouseLook.kt6
2 files changed, 13 insertions, 1 deletions
diff --git a/src/main/java/at/hannibal2/skyhanni/features/garden/GardenCommands.kt b/src/main/java/at/hannibal2/skyhanni/features/garden/GardenWarpCommands.kt
index 3ae6b81f6..81b5fb2a3 100644
--- a/src/main/java/at/hannibal2/skyhanni/features/garden/GardenCommands.kt
+++ b/src/main/java/at/hannibal2/skyhanni/features/garden/GardenWarpCommands.kt
@@ -2,13 +2,14 @@ package at.hannibal2.skyhanni.features.garden
import at.hannibal2.skyhanni.events.LorenzKeyPressEvent
import at.hannibal2.skyhanni.events.MessageSendToServerEvent
+import at.hannibal2.skyhanni.features.misc.LockMouseLook
import at.hannibal2.skyhanni.utils.LorenzUtils
import at.hannibal2.skyhanni.utils.NEUItems
import at.hannibal2.skyhanni.utils.StringUtils.matchMatcher
import net.minecraft.client.Minecraft
import net.minecraftforge.fml.common.eventhandler.SubscribeEvent
-class GardenCommands {
+class GardenWarpCommands {
private val config get() = GardenAPI.config.gardenCommands
// TODO repo
@@ -30,12 +31,14 @@ class GardenCommands {
if (message == "/barn") {
event.isCanceled = true
LorenzUtils.sendCommandToServer("tptoplot barn")
+ LockMouseLook.autoDisable()
}
tpPlotPattern.matchMatcher(message) {
event.isCanceled = true
val plotName = group("plot")
LorenzUtils.sendCommandToServer("tptoplot $plotName")
+ LockMouseLook.autoDisable()
}
}
@@ -52,6 +55,9 @@ class GardenCommands {
else -> return
}
+ if (command != "warp garden") {
+ LockMouseLook.autoDisable()
+ }
LorenzUtils.sendCommandToServer(command)
}
}
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 14b430d19..4025c32e2 100644
--- a/src/main/java/at/hannibal2/skyhanni/features/misc/LockMouseLook.kt
+++ b/src/main/java/at/hannibal2/skyhanni/features/misc/LockMouseLook.kt
@@ -46,4 +46,10 @@ object LockMouseLook {
if (!lockedMouse) return
config.lockedMouseDisplay.renderString("§eMouse Locked", posLabel = "Mouse Locked")
}
+
+ fun autoDisable() {
+ if (lockedMouse) {
+ toggleLock()
+ }
+ }
}