Get IntelliJ to stop yelling at me

This commit is contained in:
desyncfy
2024-06-23 17:02:00 -07:00
parent d767062d14
commit b77781c278
7 changed files with 10 additions and 10 deletions

View File

@@ -0,0 +1,53 @@
package chickenmanfy.scify.modules
import net.fabricmc.fabric.api.client.event.lifecycle.v1.ClientTickEvents
import net.fabricmc.fabric.api.client.keybinding.v1.KeyBindingHelper
import net.minecraft.client.MinecraftClient
import net.minecraft.client.option.KeyBinding
import net.minecraft.client.util.InputUtil
import org.lwjgl.glfw.GLFW
class Hotkey {
fun hotkeys() {
// Register Keys
val warp = KeyBindingHelper.registerKeyBinding(
KeyBinding(
"Open Warp Menu (/warp)",
InputUtil.Type.KEYSYM,
GLFW.GLFW_KEY_V,
"SciFy"
)
)
val enderchest = KeyBindingHelper.registerKeyBinding(
KeyBinding(
"Open Ender Chest (/ec)",
InputUtil.Type.KEYSYM,
GLFW.GLFW_KEY_Z,
"SciFy"
)
)
val guide = KeyBindingHelper.registerKeyBinding(
KeyBinding(
"Open Guide Book (/guide)",
InputUtil.Type.KEYSYM,
GLFW.GLFW_KEY_SEMICOLON,
"SciFy"
)
)
ClientTickEvents.END_CLIENT_TICK.register(ClientTickEvents.EndTick {
while (warp.wasPressed()) {
MinecraftClient.getInstance().networkHandler!!.sendChatCommand("warp")
}
while (enderchest.wasPressed()) {
MinecraftClient.getInstance().networkHandler!!.sendChatCommand("ec")
}
while (guide.wasPressed()) {
MinecraftClient.getInstance().networkHandler!!.sendChatCommand("guide")
}
})
}
}