diff --git a/src/main/java/com/github/halotroop/litecraft/screens/IngameHUD.java b/src/main/java/com/github/halotroop/litecraft/screens/IngameHUD.java index 94290b7..ddaad3b 100644 --- a/src/main/java/com/github/halotroop/litecraft/screens/IngameHUD.java +++ b/src/main/java/com/github/halotroop/litecraft/screens/IngameHUD.java @@ -43,5 +43,4 @@ public class IngameHUD extends Screen debugText.remove(); positionText.remove(); } - } diff --git a/src/main/java/com/github/hydos/ginger/engine/api/Ginger.java b/src/main/java/com/github/hydos/ginger/engine/api/Ginger.java index 2042096..81e78c4 100644 --- a/src/main/java/com/github/hydos/ginger/engine/api/Ginger.java +++ b/src/main/java/com/github/hydos/ginger/engine/api/Ginger.java @@ -51,7 +51,10 @@ public class Ginger } public void openScreen(Screen screen) - { gingerRegister.currentScreen = screen; } + { + if (gingerRegister.currentScreen != null) gingerRegister.currentScreen.close(); + gingerRegister.currentScreen = screen; + } public void setGingerPlayer(Player player) {