diff options
author | Matthias Luger <malua007@live.de> | 2023-05-16 23:21:39 +0200 |
---|---|---|
committer | Matthias Luger <malua007@live.de> | 2023-05-16 23:21:39 +0200 |
commit | afb18445b175ce54b9bae6f59ab73a2502be9e42 (patch) | |
tree | 6859548ffd76da0d05f100c7052a77d8558fdc52 /src/main/java/de | |
parent | 2eb67cbc1952fd175934302af404b2bd17077038 (diff) | |
download | COFL-afb18445b175ce54b9bae6f59ab73a2502be9e42.tar.gz COFL-afb18445b175ce54b9bae6f59ab73a2502be9e42.tar.bz2 COFL-afb18445b175ce54b9bae6f59ab73a2502be9e42.zip |
handle crash when clicking on cancel
Diffstat (limited to 'src/main/java/de')
-rw-r--r-- | src/main/java/de/torui/coflsky/gui/bingui/BinGuiCurrent.java | 8 |
1 files changed, 2 insertions, 6 deletions
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 edb87d0..d2cb0fd 100644 --- a/src/main/java/de/torui/coflsky/gui/bingui/BinGuiCurrent.java +++ b/src/main/java/de/torui/coflsky/gui/bingui/BinGuiCurrent.java @@ -29,8 +29,6 @@ import net.minecraftforge.fml.common.eventhandler.EventPriority; import net.minecraftforge.fml.common.eventhandler.SubscribeEvent; import net.minecraftforge.fml.common.gameevent.TickEvent; import org.lwjgl.input.Mouse; - -import java.awt.event.MouseWheelEvent; import java.util.Base64; import java.util.List; import java.util.Locale; @@ -81,7 +79,7 @@ public class BinGuiCurrent extends GuiChest { public void onGuiOpen(GuiOpenEvent event) { if (event.gui == null) { - resetGUI(); + return; } isRendered = false; @@ -221,7 +219,6 @@ public class BinGuiCurrent extends GuiChest { //play a anvilsound mc.thePlayer.playSound("random.anvil_land", 1, 1); resetGUI(); - mc.thePlayer.closeScreen(); } } @@ -273,7 +270,7 @@ public class BinGuiCurrent extends GuiChest { itemStack = null; hasInitialMouseSet = false; isRendered = false; - Mouse.setGrabbed(true); + mc.thePlayer.closeScreen(); MinecraftForge.EVENT_BUS.unregister(this); } @@ -339,7 +336,6 @@ public class BinGuiCurrent extends GuiChest { ) { //close the gui resetGUI(); - mc.thePlayer.closeScreen(); } } |