Skip to content

Commit f1c29de

Browse files
ScribbleScribble
authored andcommitted
Fixes and bump
Hopefully fixed a softlock...
1 parent 9a31119 commit f1c29de

File tree

3 files changed

+13
-6
lines changed

3 files changed

+13
-6
lines changed

build.gradle

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ apply plugin: 'org.spongepowered.mixin'
1919
//Only edit below this line, the above code adds and enables the necessary things for Forge to be setup.
2020

2121

22-
version = "Alpha7-WIP"
22+
version = "Alpha7"
2323
group = "de.scribble.lp.tastools" // http://maven.apache.org/guides/mini/guide-naming-conventions.html
2424
archivesBaseName = "TASmod-1.12.2"
2525

src/main/java/de/scribble/lp/tasmod/virtual/VirtualInput.java

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -262,15 +262,18 @@ public VirtualMouse getNextMouse() {
262262

263263
public void updateNextMouse(int keycode, boolean keystate, int scrollwheel, int cursorX, int cursorY, boolean filter) {
264264

265-
if (VirtualKeybindings.isKeyCodeAlwaysBlocked(keycode - 100)) {
266-
return;
267-
}
268265
boolean flag = true;
269266
if (filter) {
270267
flag = nextMouse.isSomethingDown() || scrollwheel != 0 || keycode != -1;
271268
}
269+
272270
VirtualKey key = nextMouse.get(keycode - 100);
273271

272+
if (VirtualKeybindings.isKeyCodeAlwaysBlocked(keycode - 100)) {
273+
key.setPressed(false);
274+
return;
275+
}
276+
274277
key.setPressed(keystate);
275278

276279
nextMouse.setScrollWheel(scrollwheel);

src/main/java/de/scribble/lp/tasmod/virtual/VirtualKeybindings.java

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@
3333
*/
3434
public class VirtualKeybindings {
3535
private static Minecraft mc = Minecraft.getMinecraft();
36-
private static long cooldown = 50*10;
36+
private static long cooldown = 50*5;
3737
private static HashMap<KeyBinding, Long> cooldownHashMap = Maps.<KeyBinding, Long>newHashMap();
3838
private static List<KeyBinding> blockedKeys = new ArrayList<>();
3939
public static boolean focused = false;
@@ -51,6 +51,10 @@ public static boolean isKeyDown(KeyBinding keybind) {
5151

5252
boolean down = false;
5353

54+
if(mc.currentScreen instanceof GuiControls) {
55+
return false;
56+
}
57+
5458
if (isKeyCodeAlwaysBlocked(keycode)) {
5559
down = keycode >= 0 ? Keyboard.isKeyDown(keycode) : Mouse.isButtonDown(keycode + 100);
5660
} else {
@@ -79,7 +83,7 @@ public static boolean isKeyDown(KeyBinding keybind) {
7983
* @return
8084
*/
8185
public static boolean isKeyDownExceptTextfield(KeyBinding keybind) {
82-
if (mc.currentScreen instanceof GuiChat || mc.currentScreen instanceof GuiEditSign || (focused && mc.currentScreen != null) || mc.currentScreen instanceof GuiControls) {
86+
if (mc.currentScreen instanceof GuiChat || mc.currentScreen instanceof GuiEditSign || (focused && mc.currentScreen != null)) {
8387
return false;
8488
}
8589
return isKeyDown(keybind);

0 commit comments

Comments
 (0)