de.pewpewproject.lasertag.client.KeyBindings   A
last analyzed

Complexity

Total Complexity 2

Size/Duplication

Total Lines 15
Duplicated Lines 0 %

Importance

Changes 0
Metric Value
eloc 10
dl 0
loc 15
rs 10
c 0
b 0
f 0
wmc 2

2 Methods

Rating   Name   Duplication   Size   Complexity  
A register() 0 7 1
A isWeaponZoomPressed() 0 2 1
1
package de.pewpewproject.lasertag.client;
2
3
import net.fabricmc.fabric.api.client.keybinding.v1.KeyBindingHelper;
4
import net.minecraft.client.option.KeyBinding;
5
import net.minecraft.client.util.InputUtil;
6
import org.lwjgl.glfw.GLFW;
7
8
/**
9
 * Class for holding and registering key bindings
10
 *
11
 * @author Étienne Muser
12
 */
13
public class KeyBindings {
14
15
    private static KeyBinding weaponZoomKeyBinding;
16
17
    public static void register() {
18
19
        weaponZoomKeyBinding = KeyBindingHelper.registerKeyBinding(new KeyBinding(
20
                "key.lasertag.weapon_zoom",
21
                InputUtil.Type.KEYSYM,
22
                GLFW.GLFW_KEY_V,
23
                "keybind.category.lasertag"));
24
    }
25
26
    public static boolean isWeaponZoomPressed() {
27
        return weaponZoomKeyBinding.isPressed();
28
    }
29
}
30