mirror of
https://github.com/Minestom/Minestom.git
synced 2025-01-03 23:17:48 +01:00
Try to close the terminal when shutting down the server
This commit is contained in:
parent
b066b6029a
commit
5cb4be26ff
@ -17,11 +17,11 @@ public class MinestomTerminal {
|
||||
private static final CommandManager COMMAND_MANAGER = MinecraftServer.getCommandManager();
|
||||
private static final String PROMPT = "> ";
|
||||
|
||||
private static volatile Terminal terminal;
|
||||
private static volatile boolean running = false;
|
||||
|
||||
@ApiStatus.Internal
|
||||
public static void start() {
|
||||
Terminal terminal = null;
|
||||
try {
|
||||
terminal = TerminalBuilder.terminal();
|
||||
} catch (IOException e) {
|
||||
@ -47,6 +47,13 @@ public class MinestomTerminal {
|
||||
@ApiStatus.Internal
|
||||
public static void stop() {
|
||||
running = false;
|
||||
if (terminal != null) {
|
||||
try {
|
||||
terminal.close();
|
||||
} catch (IOException e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user