aboutsummaryrefslogtreecommitdiff
path: root/src/main/java/at/hannibal2/skyhanni
diff options
context:
space:
mode:
authorhannibal2 <24389977+hannibal00212@users.noreply.github.com>2023-10-17 12:10:05 +0200
committerhannibal2 <24389977+hannibal00212@users.noreply.github.com>2023-10-17 12:10:05 +0200
commit8116fb8434a724b67be01e1369ef902b865d5c49 (patch)
tree28f78ac869ea9ccbfd80cc22bb411789a266d0b3 /src/main/java/at/hannibal2/skyhanni
parent64d038a41492cd7621dd8cbf326cda9200d5cc81 (diff)
downloadskyhanni-8116fb8434a724b67be01e1369ef902b865d5c49.tar.gz
skyhanni-8116fb8434a724b67be01e1369ef902b865d5c49.tar.bz2
skyhanni-8116fb8434a724b67be01e1369ef902b865d5c49.zip
code cleanup
Diffstat (limited to 'src/main/java/at/hannibal2/skyhanni')
-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