diff --git a/src/main/java/one/oth3r/sit/utl/Events.java b/src/main/java/one/oth3r/sit/utl/Events.java index ddd137d..c3996bc 100644 --- a/src/main/java/one/oth3r/sit/utl/Events.java +++ b/src/main/java/one/oth3r/sit/utl/Events.java @@ -27,6 +27,7 @@ public class Events { private static class Keybindings { private static KeyBinding toggle_key; + private static KeyBinding sit_key; private static void register() { toggle_key = KeyBindingHelper.registerKeyBinding(new KeyBinding( @@ -34,6 +35,11 @@ public class Events { GLFW.GLFW_KEY_UNKNOWN, "category.sit" )); + sit_key = KeyBindingHelper.registerKeyBinding(new KeyBinding( + "key.sit", + GLFW.GLFW_KEY_UNKNOWN, + "category.sit" + )); } private static void loopLogic(ClientPlayerEntity player) { @@ -68,6 +74,19 @@ public class Events { } } } + + while (sit_key.wasPressed()) { + // just send the sit command + if (Data.isInGame()) { + if (Data.isSupportedServer()) { + player.networkHandler.sendCommand("sit"); + } else { + // unsupported server message if not in a Sit! server + player.sendMessage(Utl.lang("msg.unsupported") + .formatted(Formatting.RED), true); + } + } + } } }