Fix gui not closing when pressing activation button

This commit is contained in:
Marcel Konrad
2020-11-02 17:22:43 +01:00
parent 80ec385ff8
commit 1596ce8dff
2 changed files with 3 additions and 10 deletions

View File

@@ -332,9 +332,9 @@ public class GuiWorldHandler extends Container
focused = ((Widget) this.getListener()).isFocused();
}
if(!focused && KeyHandler.isPressed(KeyHandler.KEY_WORLD_HANDLER, keyCode))
if(!focused && KeyHandler.KEY_WORLD_HANDLER.matchesKey(keyCode, scanCode) && KeyHandler.KEY_WORLD_HANDLER.getKeyModifier().isActive(null))
{
this.onClose();
Minecraft.getInstance().displayGuiScreen(null);
return true;
}
@@ -443,6 +443,7 @@ public class GuiWorldHandler extends Container
@Override
public void onClose()
{
System.out.println("onClose");
ActionHelper.tryRun(this.content::onGuiClosed);
}