diff options
author | EvilSeph <evilseph@unaligned.org> | 2011-05-18 15:23:27 -0400 |
---|---|---|
committer | EvilSeph <evilseph@unaligned.org> | 2011-05-18 21:36:30 -0400 |
commit | eac5b9623d771abd3ea480eaeb33404b4410d3b6 (patch) | |
tree | 5c9e86e41b4b35494cdb14a266495f90a8146a91 /src/main/java/org/bukkit | |
parent | cd87e51638048e2376a1e882d6f75be092eb8479 (diff) | |
download | craftbukkit-eac5b9623d771abd3ea480eaeb33404b4410d3b6.tar craftbukkit-eac5b9623d771abd3ea480eaeb33404b4410d3b6.tar.gz craftbukkit-eac5b9623d771abd3ea480eaeb33404b4410d3b6.tar.lz craftbukkit-eac5b9623d771abd3ea480eaeb33404b4410d3b6.tar.xz craftbukkit-eac5b9623d771abd3ea480eaeb33404b4410d3b6.zip |
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 '>'.
Diffstat (limited to 'src/main/java/org/bukkit')
-rw-r--r-- | src/main/java/org/bukkit/craftbukkit/Main.java | 8 | ||||
-rw-r--r-- | src/main/java/org/bukkit/craftbukkit/util/ShortConsoleLogFormatter.java | 2 |
2 files changed, 10 insertions, 0 deletions
diff --git a/src/main/java/org/bukkit/craftbukkit/Main.java b/src/main/java/org/bukkit/craftbukkit/Main.java index f0863edd..0dacd2ee 100644 --- a/src/main/java/org/bukkit/craftbukkit/Main.java +++ b/src/main/java/org/bukkit/craftbukkit/Main.java @@ -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(); diff --git a/src/main/java/org/bukkit/craftbukkit/util/ShortConsoleLogFormatter.java b/src/main/java/org/bukkit/craftbukkit/util/ShortConsoleLogFormatter.java index 8d8b4e73..282f058d 100644 --- a/src/main/java/org/bukkit/craftbukkit/util/ShortConsoleLogFormatter.java +++ b/src/main/java/org/bukkit/craftbukkit/util/ShortConsoleLogFormatter.java @@ -26,6 +26,8 @@ public class ShortConsoleLogFormatter extends Formatter { } catch (OptionException ex) { System.err.println("Given date format is not valid. Falling back to default."); } + } else if (options.has("nojline")) { + date = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"); } if (date == null) { |