aboutsummaryrefslogtreecommitdiff
path: root/src/main/kotlin/com/ambientaddons/features/keybinds/PerspectiveKeybind.kt
diff options
context:
space:
mode:
authorAppability <appable@icloud.com>2022-10-12 20:48:51 -0700
committerAppability <appable@icloud.com>2022-10-12 20:48:51 -0700
commitc599ee0d78ed8bc17488636f2d9b9b1d5b6dd4a8 (patch)
treef362a5f60f31e27f1567c7319a78d861b19430a7 /src/main/kotlin/com/ambientaddons/features/keybinds/PerspectiveKeybind.kt
parent03728b81851af00cd265fadd4ce6eaa3a8066dcb (diff)
downloadAmbientAddons-c599ee0d78ed8bc17488636f2d9b9b1d5b6dd4a8.tar.gz
AmbientAddons-c599ee0d78ed8bc17488636f2d9b9b1d5b6dd4a8.tar.bz2
AmbientAddons-c599ee0d78ed8bc17488636f2d9b9b1d5b6dd4a8.zip
uh a lot of things
Diffstat (limited to 'src/main/kotlin/com/ambientaddons/features/keybinds/PerspectiveKeybind.kt')
-rw-r--r--src/main/kotlin/com/ambientaddons/features/keybinds/PerspectiveKeybind.kt18
1 files changed, 18 insertions, 0 deletions
diff --git a/src/main/kotlin/com/ambientaddons/features/keybinds/PerspectiveKeybind.kt b/src/main/kotlin/com/ambientaddons/features/keybinds/PerspectiveKeybind.kt
new file mode 100644
index 0000000..3ee1564
--- /dev/null
+++ b/src/main/kotlin/com/ambientaddons/features/keybinds/PerspectiveKeybind.kt
@@ -0,0 +1,18 @@
+package com.ambientaddons.features.keybinds
+
+import AmbientAddons.Companion.keyBinds
+import AmbientAddons.Companion.mc
+import net.minecraftforge.fml.common.eventhandler.SubscribeEvent
+import net.minecraftforge.fml.common.gameevent.InputEvent.KeyInputEvent
+
+object PerspectiveKeybind {
+ @SubscribeEvent
+ fun onKey(event: KeyInputEvent) {
+ val settings = mc.gameSettings
+ if (keyBinds["thirdPersonKey"]!!.isPressed) {
+ settings.thirdPersonView = if (settings.thirdPersonView == 0) 1 else 0
+ } else if (keyBinds["secondPersonKey"]!!.isPressed) {
+ settings.thirdPersonView = if (settings.thirdPersonView == 0) 2 else 0
+ }
+ }
+}