aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/main/java/at/hannibal2/skyhanni/config/commands/Commands.kt4
-rw-r--r--src/main/java/at/hannibal2/skyhanni/features/misc/LockMouseLook.kt13
2 files changed, 9 insertions, 8 deletions
diff --git a/src/main/java/at/hannibal2/skyhanni/config/commands/Commands.kt b/src/main/java/at/hannibal2/skyhanni/config/commands/Commands.kt
index ca6018ad6..5eccdf488 100644
--- a/src/main/java/at/hannibal2/skyhanni/config/commands/Commands.kt
+++ b/src/main/java/at/hannibal2/skyhanni/config/commands/Commands.kt
@@ -166,8 +166,8 @@ object Commands {
// "Language codes are at the end of the translation when you click on a message."
// ) { Translator.fromEnglish(it) }
registerCommand(
- "shmouselock",
- "Lock/Unlock the mouse so it will no longer rotate the player (for farming)"
+ "shmouselock",
+ "Lock/Unlock the mouse so it will no longer rotate the player (for farming)"
) { LockMouseLook.toggleLock() }
}
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 8058ec2c0..932056b9d 100644
--- a/src/main/java/at/hannibal2/skyhanni/features/misc/LockMouseLook.kt
+++ b/src/main/java/at/hannibal2/skyhanni/features/misc/LockMouseLook.kt
@@ -7,7 +7,7 @@ import net.minecraftforge.fml.common.eventhandler.SubscribeEvent
object LockMouseLook {
private var lockedMouse = false
- private var oldSensitivity = 0F;
+ private var oldSensitivity = 0F
@SubscribeEvent
fun onWorldChange(event: LorenzWorldChangeEvent) {
@@ -17,13 +17,14 @@ object LockMouseLook {
fun toggleLock() {
lockedMouse = !lockedMouse
+ val gameSettings = Minecraft.getMinecraft().gameSettings
if (lockedMouse) {
- oldSensitivity = Minecraft.getMinecraft().gameSettings.mouseSensitivity;
- Minecraft.getMinecraft().gameSettings.mouseSensitivity = -1F/3F;
- LorenzUtils.chat("§b[SkyHanni] Mouse rotation is now locked. Type /shmouselock to unlock your rotation")
+ oldSensitivity = gameSettings.mouseSensitivity
+ gameSettings.mouseSensitivity = -1F / 3F
+ LorenzUtils.chat("§e[SkyHanni] §bMouse rotation is now locked. Type /shmouselock to unlock your rotation")
} else {
- Minecraft.getMinecraft().gameSettings.mouseSensitivity = oldSensitivity
- LorenzUtils.chat("§b[SkyHanni] Mouse rotation is now unlocked.")
+ gameSettings.mouseSensitivity = oldSensitivity
+ LorenzUtils.chat("§e[SkyHanni] §bMouse rotation is now unlocked.")
}
}
} \ No newline at end of file