diff --git a/Loader/src/main/java/de/com/baseband/launcher/Loader.java b/Loader/src/main/java/de/com/baseband/launcher/Loader.java index 82da8eb..24bbf51 100644 --- a/Loader/src/main/java/de/com/baseband/launcher/Loader.java +++ b/Loader/src/main/java/de/com/baseband/launcher/Loader.java @@ -191,7 +191,7 @@ public class Loader implements Util { } }) .spacer() - .option("Exit Minecraft", x -> exit()) + .option("Exit Minecraft", x -> exit(0)) .show(); options.setIfAbsent("ip", "baseband.com.de"); options.setIfAbsent("disabled-modules", new TCNArray()); @@ -222,7 +222,7 @@ public class Loader implements Util { out.close(); LOGGER.info("BaseBand has downloaded a significant update. Minecraft will exit."); JOptionPane.showMessageDialog(null, "BaseBand has downloaded a significant update. Please restart Minecraft."); - exit(); + exit(0); } else if(status == Response.OK) { LOGGER.info(status.name); try { @@ -349,12 +349,16 @@ public class Loader implements Util { public static void exit() { + exit(1); + } + + public static void exit(int exitCode) { try { //Cleanly exit Class shutdownClass = Class.forName("java.lang.Shutdown"); Method exitMethod = shutdownClass.getDeclaredMethod("exit", int.class); exitMethod.setAccessible(true); - exitMethod.invoke(null, 1); + exitMethod.invoke(null, exitCode); } catch (Exception ignored) { } }