Added -nojline CLI option to emulate vanilla console behaviours. Added JLine disabling compatibility (removes the '>').

-nojline disables JLine, removes the '>', sets the timestamp to vanilla's and sets the language to English.

-Djline.terminal=jline.UnsupportedTerminal disables JLine and removes the '>'.
This commit is contained in:
EvilSeph
2011-05-18 15:23:27 -04:00
parent cd87e51638
commit eac5b9623d
3 changed files with 24 additions and 4 deletions

View File

@@ -12,6 +12,8 @@ import joptsimple.OptionSet;
import net.minecraft.server.MinecraftServer;
public class Main {
public static String jlineTerminalSetting = System.getProperty("jline.terminal");
public static void main(String[] args) {
// Todo: Installation script
OptionParser parser = new OptionParser() {
@@ -65,6 +67,8 @@ public class Main {
.ofType(File.class)
.defaultsTo(new File("bukkit.yml"))
.describedAs("Yml file");
acceptsAll(asList("nojline"), "Disables jline and emulates the vanilla console");
}
};
@@ -84,6 +88,10 @@ public class Main {
}
} else {
try {
if (options.has("nojline")) {
System.setProperty("jline.terminal", "jline.UnsupportedTerminal");
System.setProperty("user.language", "en");
}
MinecraftServer.main(options);
} catch (Throwable t) {
t.printStackTrace();