diff --git a/build.gradle b/build.gradle index 5ce7d23b..0aff5c5e 100644 --- a/build.gradle +++ b/build.gradle @@ -19,7 +19,7 @@ apply plugin: 'org.spongepowered.mixin' //Only edit below this line, the above code adds and enables the necessary things for Forge to be setup. -version = "Alpha7-WIP" +version = "Alpha7" group = "de.scribble.lp.tastools" // http://maven.apache.org/guides/mini/guide-naming-conventions.html archivesBaseName = "TASmod-1.12.2" diff --git a/src/main/java/de/scribble/lp/tasmod/virtual/VirtualInput.java b/src/main/java/de/scribble/lp/tasmod/virtual/VirtualInput.java index 50dcdbef..c286725e 100644 --- a/src/main/java/de/scribble/lp/tasmod/virtual/VirtualInput.java +++ b/src/main/java/de/scribble/lp/tasmod/virtual/VirtualInput.java @@ -262,15 +262,18 @@ public VirtualMouse getNextMouse() { public void updateNextMouse(int keycode, boolean keystate, int scrollwheel, int cursorX, int cursorY, boolean filter) { - if (VirtualKeybindings.isKeyCodeAlwaysBlocked(keycode - 100)) { - return; - } boolean flag = true; if (filter) { flag = nextMouse.isSomethingDown() || scrollwheel != 0 || keycode != -1; } + VirtualKey key = nextMouse.get(keycode - 100); + if (VirtualKeybindings.isKeyCodeAlwaysBlocked(keycode - 100)) { + key.setPressed(false); + return; + } + key.setPressed(keystate); nextMouse.setScrollWheel(scrollwheel); diff --git a/src/main/java/de/scribble/lp/tasmod/virtual/VirtualKeybindings.java b/src/main/java/de/scribble/lp/tasmod/virtual/VirtualKeybindings.java index 8774d41f..877e4b5d 100644 --- a/src/main/java/de/scribble/lp/tasmod/virtual/VirtualKeybindings.java +++ b/src/main/java/de/scribble/lp/tasmod/virtual/VirtualKeybindings.java @@ -33,7 +33,7 @@ */ public class VirtualKeybindings { private static Minecraft mc = Minecraft.getMinecraft(); - private static long cooldown = 50*10; + private static long cooldown = 50*5; private static HashMap cooldownHashMap = Maps.newHashMap(); private static List blockedKeys = new ArrayList<>(); public static boolean focused = false; @@ -51,6 +51,10 @@ public static boolean isKeyDown(KeyBinding keybind) { boolean down = false; + if(mc.currentScreen instanceof GuiControls) { + return false; + } + if (isKeyCodeAlwaysBlocked(keycode)) { down = keycode >= 0 ? Keyboard.isKeyDown(keycode) : Mouse.isButtonDown(keycode + 100); } else { @@ -79,7 +83,7 @@ public static boolean isKeyDown(KeyBinding keybind) { * @return */ public static boolean isKeyDownExceptTextfield(KeyBinding keybind) { - if (mc.currentScreen instanceof GuiChat || mc.currentScreen instanceof GuiEditSign || (focused && mc.currentScreen != null) || mc.currentScreen instanceof GuiControls) { + if (mc.currentScreen instanceof GuiChat || mc.currentScreen instanceof GuiEditSign || (focused && mc.currentScreen != null)) { return false; } return isKeyDown(keybind);