aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/main/java/at/hannibal2/skyhanni/features/misc/LockMouseLook.kt10
1 files changed, 8 insertions, 2 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 932056b9d..8873c7402 100644
--- a/src/main/java/at/hannibal2/skyhanni/features/misc/LockMouseLook.kt
+++ b/src/main/java/at/hannibal2/skyhanni/features/misc/LockMouseLook.kt
@@ -8,10 +8,16 @@ import net.minecraftforge.fml.common.eventhandler.SubscribeEvent
object LockMouseLook {
private var lockedMouse = false
private var oldSensitivity = 0F
+ private val lockedPosition = -1F / 3F
@SubscribeEvent
fun onWorldChange(event: LorenzWorldChangeEvent) {
if (lockedMouse) toggleLock()
+ val gameSettings = Minecraft.getMinecraft().gameSettings
+ if (gameSettings.mouseSensitivity == lockedPosition) {
+ gameSettings.mouseSensitivity = 0.5f
+ LorenzUtils.chat("§e[SkyHanni] §bReset your mouse sensitivity to 100%.")
+ }
}
fun toggleLock() {
@@ -20,11 +26,11 @@ object LockMouseLook {
val gameSettings = Minecraft.getMinecraft().gameSettings
if (lockedMouse) {
oldSensitivity = gameSettings.mouseSensitivity
- gameSettings.mouseSensitivity = -1F / 3F
+ gameSettings.mouseSensitivity = lockedPosition
LorenzUtils.chat("§e[SkyHanni] §bMouse rotation is now locked. Type /shmouselock to unlock your rotation")
} else {
gameSettings.mouseSensitivity = oldSensitivity
LorenzUtils.chat("§e[SkyHanni] §bMouse rotation is now unlocked.")
}
}
-} \ No newline at end of file
+}