Added new --noconsole command argument, thanks to mkurzeja for the idea

By: Nathan Adams <dinnerbone@dinnerbone.com>
This commit is contained in:
CraftBukkit/Spigot 2011-11-05 20:14:26 +00:00
parent 0ad41cc069
commit f37f615a88
2 changed files with 11 additions and 0 deletions

View File

@ -105,6 +105,10 @@ public final class CraftServer implements Server {
this.serverVersion = CraftServer.class.getPackage().getImplementationVersion();
Bukkit.setServer(this);
if (!Main.useConsole) {
getLogger().info("Console input is disabled due to --noconsole command argument");
}
configuration = YamlConfiguration.loadConfiguration(getConfigFile());
configuration.options().copyDefaults(true);

View File

@ -13,6 +13,7 @@ import net.minecraft.server.MinecraftServer;
public class Main {
public static boolean useJline = true;
public static boolean useConsole = true;
public static void main(String[] args) {
// Todo: Installation script
@ -93,6 +94,8 @@ public class Main {
.describedAs("Yml file");
acceptsAll(asList("nojline"), "Disables jline and emulates the vanilla console");
acceptsAll(asList("noconsole"), "Disables the console");
acceptsAll(asList("v", "version"), "Show the CraftBukkit Version");
}
@ -123,6 +126,10 @@ public class Main {
System.setProperty("user.language", "en");
useJline = false;
}
if (options.has("noconsole")) {
useConsole = false;
}
MinecraftServer.main(options);
} catch (Throwable t) {