Update to jline 2. Fixes BUKKIT-717

JLine 2 allows for better color matching in the console and support for
colors in console on Windows. Hopefully provides better performance as well.
This commit is contained in:
EdGruberman
2012-03-14 13:59:14 -07:00
committed by Travis Watkins
parent cbd20ec9ea
commit 31d488a386
6 changed files with 46 additions and 32 deletions

View File

@@ -4,7 +4,7 @@ import java.io.IOException;
import java.util.logging.ConsoleHandler;
import java.util.logging.Level;
import java.util.logging.Logger;
import jline.ConsoleReader;
import jline.console.ConsoleReader;
import org.bukkit.craftbukkit.Main;
public class TerminalConsoleHandler extends ConsoleHandler {
@@ -19,15 +19,15 @@ public class TerminalConsoleHandler extends ConsoleHandler {
public synchronized void flush() {
try {
if (Main.useJline) {
reader.printString(ConsoleReader.RESET_LINE + "");
reader.flushConsole();
reader.print(ConsoleReader.RESET_LINE + "");
reader.flush();
super.flush();
try {
reader.drawLine();
} catch (Throwable ex) {
reader.getCursorBuffer().clearBuffer();
reader.getCursorBuffer().clear();
}
reader.flushConsole();
reader.flush();
} else {
super.flush();
}