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 int compressionThreshold = 256;
|
||||||
private static boolean packetCaching = true;
|
private static boolean packetCaching = true;
|
||||||
private static boolean groupedPacket = true;
|
private static boolean groupedPacket = true;
|
||||||
|
private static boolean terminalEnabled = System.getProperty("minestom.terminal.disabled") == null;
|
||||||
private static ResponseDataConsumer responseDataConsumer;
|
private static ResponseDataConsumer responseDataConsumer;
|
||||||
private static String brandName = "Minestom";
|
private static String brandName = "Minestom";
|
||||||
private static Difficulty difficulty = Difficulty.NORMAL;
|
private static Difficulty difficulty = Difficulty.NORMAL;
|
||||||
@ -615,6 +616,24 @@ public final class MinecraftServer {
|
|||||||
MinecraftServer.groupedPacket = groupedPacket;
|
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.
|
* Gets the consumer executed to show server-list data.
|
||||||
*
|
*
|
||||||
@ -795,7 +814,9 @@ public final class MinecraftServer {
|
|||||||
|
|
||||||
LOGGER.info("Minestom server started successfully.");
|
LOGGER.info("Minestom server started successfully.");
|
||||||
|
|
||||||
MinestomTerminal.start();
|
if (terminalEnabled) {
|
||||||
|
MinestomTerminal.start();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
Loading…
Reference in New Issue
Block a user