From a189446cacbe15bdeded1b76a23d84c09181a2d2 Mon Sep 17 00:00:00 2001 From: AnrDaemon Date: Mon, 1 Jul 2024 07:43:57 +0300 Subject: [PATCH] fixed broken Maintained mod (#23) Co-authored-by: Quarri6343 --- src/main/java/mcp/mobius/waila/client/KeyEvent.java | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/main/java/mcp/mobius/waila/client/KeyEvent.java b/src/main/java/mcp/mobius/waila/client/KeyEvent.java index cec2e614..175a26cc 100644 --- a/src/main/java/mcp/mobius/waila/client/KeyEvent.java +++ b/src/main/java/mcp/mobius/waila/client/KeyEvent.java @@ -37,19 +37,20 @@ public KeyEvent() { @SubscribeEvent public void onKeyEvent(KeyInputEvent event) { + boolean showKey = key_show.isPressed(); if (key_cfg.isPressed()) { Minecraft mc = Minecraft.getMinecraft(); if (mc.currentScreen == null) { mc.displayGuiScreen(new ScreenConfig(null)); } - } else if (key_show.isPressed() && ConfigHandler.instance() + } else if (showKey && ConfigHandler.instance() .getConfig(Configuration.CATEGORY_GENERAL, Constants.CFG_WAILA_MODE, false)) { boolean status = ConfigHandler.instance() .getConfig(Configuration.CATEGORY_GENERAL, Constants.CFG_WAILA_SHOW, true); ConfigHandler.instance() .setConfig(Configuration.CATEGORY_GENERAL, Constants.CFG_WAILA_SHOW, !status); } else - if (key_show.isPressed() && !ConfigHandler.instance() + if (showKey && !ConfigHandler.instance() .getConfig(Configuration.CATEGORY_GENERAL, Constants.CFG_WAILA_MODE, false)) { ConfigHandler.instance() .setConfig(Configuration.CATEGORY_GENERAL, Constants.CFG_WAILA_SHOW, true);