Get IntelliJ to stop yelling at me
This commit is contained in:
53
src/client/kotlin/chickenmanfy/scify/modules/Hotkey.kt
Normal file
53
src/client/kotlin/chickenmanfy/scify/modules/Hotkey.kt
Normal 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")
|
||||
}
|
||||
|
||||
})
|
||||
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user