mirror of
https://github.com/Minestom/Minestom.git
synced 2025-01-20 07:02:32 +01:00
Merge pull request #318 from mworzala/no_terminal_vm_arg
Add an option to start the server with no terminal
This commit is contained in:
commit
e098b2a89f
@ -138,6 +138,7 @@ public final class MinecraftServer {
|
||||
private static int compressionThreshold = 256;
|
||||
private static boolean packetCaching = true;
|
||||
private static boolean groupedPacket = true;
|
||||
private static boolean terminalEnabled = System.getProperty("minestom.terminal.disabled") == null;
|
||||
private static ResponseDataConsumer responseDataConsumer;
|
||||
private static String brandName = "Minestom";
|
||||
private static Difficulty difficulty = Difficulty.NORMAL;
|
||||
@ -615,6 +616,24 @@ public final class MinecraftServer {
|
||||
MinecraftServer.groupedPacket = groupedPacket;
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets if the built in Minestom terminal is enabled.
|
||||
* @return true if the terminal is enabled
|
||||
*/
|
||||
public static boolean isTerminalEnabled() {
|
||||
return terminalEnabled;
|
||||
}
|
||||
|
||||
/**
|
||||
* Enabled/disables the built in Minestom terminal.
|
||||
*
|
||||
* @param enabled true to enable, false to disable
|
||||
*/
|
||||
public static void setTerminalEnabled(boolean enabled) {
|
||||
Check.stateCondition(started, "Terminal settings may not be changed after starting the server.");
|
||||
MinecraftServer.terminalEnabled = enabled;
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets the consumer executed to show server-list data.
|
||||
*
|
||||
@ -795,8 +814,10 @@ public final class MinecraftServer {
|
||||
|
||||
LOGGER.info("Minestom server started successfully.");
|
||||
|
||||
if (terminalEnabled) {
|
||||
MinestomTerminal.start();
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Stops this server properly (saves if needed, kicking players, etc.)
|
||||
|
Loading…
Reference in New Issue
Block a user