Skip to content
This repository was archived by the owner on Feb 19, 2019. It is now read-only.

Commit 600ed9a

Browse files
committed
Added additional check for KeyEvent
The event should only be invoked when the user is not in a gui screen
1 parent f848425 commit 600ed9a

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

src/main/java/me/zero/client/load/mixin/MixinMinecraft.java

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -55,6 +55,8 @@
5555
@Mixin(Minecraft.class)
5656
public abstract class MixinMinecraft implements IMinecraft {
5757

58+
@Shadow public GuiScreen currentScreen;
59+
5860
@Accessor @Override public abstract Timer getTimer();
5961
@Accessor @Override public abstract void setSession(Session session);
6062
@Accessor @Override public abstract void setRightClickDelayTimer(int delay);
@@ -86,6 +88,9 @@ public void onLoop(CallbackInfo ci) {
8688

8789
@Inject(method = "runTickKeyboard", at = @At(value = "INVOKE_ASSIGN", target = "org/lwjgl/input/Keyboard.getEventKeyState()Z", remap = false))
8890
public void onKeyEvent(CallbackInfo ci) {
91+
if (currentScreen != null)
92+
return;
93+
8994
boolean down = Keyboard.getEventKeyState();
9095
int key = Keyboard.getEventKey();
9196

0 commit comments

Comments
 (0)