diff --git a/src/main/java/net/silentclient/client/mods/hud/KeystrokesMod.java b/src/main/java/net/silentclient/client/mods/hud/KeystrokesMod.java index 1dc6dd6..c1500a0 100644 --- a/src/main/java/net/silentclient/client/mods/hud/KeystrokesMod.java +++ b/src/main/java/net/silentclient/client/mods/hud/KeystrokesMod.java @@ -48,7 +48,7 @@ public class KeystrokesMod extends ModDraggable { this.addBooleanSetting("Replace Names With Arrow", this, false); } - public static enum KeystrokesMode { + public enum KeystrokesMode { WASD(Key.W, Key.A, Key.S, Key.D), WASD_MOUSE(Key.W, Key.A, Key.S, Key.D, Key.LMB, Key.RMB); @@ -57,7 +57,7 @@ public class KeystrokesMod extends ModDraggable { private int width; private int height; - private KeystrokesMode(Key... keysIn) { + KeystrokesMode(Key... keysIn) { this.keys = keysIn; for(Key key : keys) { @@ -111,14 +111,18 @@ public class KeystrokesMod extends ModDraggable { } public boolean isDown() { - if(Minecraft.getMinecraft().currentScreen != null) { - return false; + try { + if(Minecraft.getMinecraft().currentScreen != null) { + return false; + } + + if(this == Key.LMB || this == Key.RMB) { + return Mouse.isButtonDown(this == Key.LMB ? 0 : 1); + } + return Keyboard.isKeyDown(keyBind.getKeyCode()); + } catch (Exception err) { + return keyBind.isKeyDown(); } - - if(this == Key.LMB || this == Key.RMB) { - return Mouse.isButtonDown(this == Key.LMB ? 0 : 1); - } - return Keyboard.isKeyDown(keyBind.getKeyCode()); } public int getHeight() {