@@ -14,28 +14,24 @@ public class Keybindings {
14
14
private static KeyBinding playerSettingsMenu ;
15
15
private static KeyBinding playerTaunt ;
16
16
17
- public static void registerKeybinds () {
18
- playerSettingsMenu = KeyBindingHelper .registerKeyBinding (new KeyBinding (
19
- "key.mcquake3.playermenu" ,
20
- InputUtil .Type .KEYSYM ,
21
- GLFW .GLFW_KEY_O ,
17
+ private static KeyBinding registerKeybind (String id , int key ) {
18
+ return KeyBindingHelper .registerKeyBinding (new KeyBinding (
19
+ "key.mcquake3." +id , InputUtil .Type .KEYSYM , key ,
22
20
"category.mcquake3.bindings" ));
21
+ }
22
+
23
+ public static void registerKeybinds () {
24
+ playerSettingsMenu = registerKeybind ("playermenu" , GLFW .GLFW_KEY_O );
25
+ playerTaunt = registerKeybind ("playertaunt" , GLFW .GLFW_KEY_Z );
23
26
24
27
ClientTickEvents .END_CLIENT_TICK .register (client -> {
25
- if (playerSettingsMenu .wasPressed ()) {
28
+ if (playerSettingsMenu .wasPressed ())
26
29
client .setScreen (new PlayerSettingsScreen (Text .of ("MCQuake3 Player Settings" ), client .player ));
27
- }
28
30
});
29
31
30
- playerTaunt = KeyBindingHelper .registerKeyBinding (new KeyBinding (
31
- "key.mcquake3.playertaunt" ,
32
- InputUtil .Type .KEYSYM ,
33
- GLFW .GLFW_KEY_Z ,
34
- "category.mcquake3.bindings" ));
35
32
ClientTickEvents .END_CLIENT_TICK .register (client -> {
36
- if (playerTaunt .wasPressed ()) {
33
+ if (playerTaunt .wasPressed ())
37
34
ClientPlayNetworking .send (Packets .PLAYER_TAUNT , PacketByteBufs .empty ());
38
- }
39
35
});
40
36
}
41
37
}
0 commit comments