fix(modules): gate keybind toggles on mc.screen == null
Module keybinds used to fire while ChatScreen, PauseScreen or any other UI was open, so typing a chat message or being in the pause menu would silently toggle modules whose bind happened to match a key in the text. Skip the keybind scan in onKey() unless mc.screen is null, matching vanilla's "no GUI" gating used elsewhere. Fixes #19 Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
This commit is contained in:
@@ -191,9 +191,11 @@ public class ModuleManager extends ClientBase {
|
||||
|
||||
@EventTarget
|
||||
public void onKey(KeyEvent event) {
|
||||
for (Module module : this.moduleMap.values()) {
|
||||
if (module.getKey() != 0 && module.getKey() == event.getKeyCode() && event.isPressed()) {
|
||||
module.toggle();
|
||||
if (mc.screen == null) {
|
||||
for (Module module : this.moduleMap.values()) {
|
||||
if (module.getKey() != 0 && module.getKey() == event.getKeyCode() && event.isPressed()) {
|
||||
module.toggle();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user