From 6f8a927b8022491aa5bb26dfb0900d207c99956d Mon Sep 17 00:00:00 2001 From: Matthias Luger Date: Wed, 18 Oct 2023 12:36:05 +0200 Subject: fix cursor not being grabbed after gui reset --- src/main/java/de/torui/coflsky/gui/bingui/BinGuiCurrent.java | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'src/main/java') diff --git a/src/main/java/de/torui/coflsky/gui/bingui/BinGuiCurrent.java b/src/main/java/de/torui/coflsky/gui/bingui/BinGuiCurrent.java index d2cb0fd..d860fe3 100644 --- a/src/main/java/de/torui/coflsky/gui/bingui/BinGuiCurrent.java +++ b/src/main/java/de/torui/coflsky/gui/bingui/BinGuiCurrent.java @@ -44,6 +44,7 @@ public class BinGuiCurrent extends GuiChest { private int pixelsScrolled = 0; private boolean wasMouseDown; private boolean isRendered = false; + private boolean isClosing = false; private boolean hasInitialMouseSet = false; // set if the auction was already bought @@ -157,6 +158,9 @@ public class BinGuiCurrent extends GuiChest { @Override public void drawScreen(int mouseX, int mouseY, float partialTicks) { + if(isClosing){ + return; + } Mouse.setGrabbed(false); isRendered = true; @@ -270,6 +274,8 @@ public class BinGuiCurrent extends GuiChest { itemStack = null; hasInitialMouseSet = false; isRendered = false; + isClosing = true; + Mouse.setGrabbed(true); mc.thePlayer.closeScreen(); MinecraftForge.EVENT_BUS.unregister(this); } -- cgit