From 685d4dbb3f6c4f6f81a971aba1cb7670f6541bf4 Mon Sep 17 00:00:00 2001 From: Dinnerbone Date: Fri, 25 Feb 2011 19:01:14 +0000 Subject: [PATCH] Added ">" to input command line, separated it from output buffer properly --- .../java/net/minecraft/server/ThreadCommandReader.java | 5 ++--- .../bukkit/craftbukkit/util/TerminalConsoleHandler.java | 8 +++++--- 2 files changed, 7 insertions(+), 6 deletions(-) diff --git a/src/main/java/net/minecraft/server/ThreadCommandReader.java b/src/main/java/net/minecraft/server/ThreadCommandReader.java index 7277758e80..3605c99746 100644 --- a/src/main/java/net/minecraft/server/ThreadCommandReader.java +++ b/src/main/java/net/minecraft/server/ThreadCommandReader.java @@ -3,6 +3,7 @@ package net.minecraft.server; import java.io.BufferedReader; import java.io.IOException; import java.io.InputStreamReader; +import java.io.PrintStream; import java.util.logging.Level; import java.util.logging.Logger; import jline.ConsoleReader; @@ -21,11 +22,9 @@ public class ThreadCommandReader extends Thread { try { ConsoleReader reader = a.reader; String line = null; - - while ((!this.a.g) && (MinecraftServer.a(this.a)) && ((line = reader.readLine()) != null)) { + while ((!this.a.g) && (MinecraftServer.a(this.a)) && ((line = reader.readLine(">", null)) != null)) { this.a.a(line, (ICommandListener) this.a); } - } catch (IOException ex) { Logger.getLogger(ThreadCommandReader.class.getName()).log(Level.SEVERE, null, ex); } diff --git a/src/main/java/org/bukkit/craftbukkit/util/TerminalConsoleHandler.java b/src/main/java/org/bukkit/craftbukkit/util/TerminalConsoleHandler.java index a7beb5587d..2034ad972f 100644 --- a/src/main/java/org/bukkit/craftbukkit/util/TerminalConsoleHandler.java +++ b/src/main/java/org/bukkit/craftbukkit/util/TerminalConsoleHandler.java @@ -16,12 +16,14 @@ public class TerminalConsoleHandler extends ConsoleHandler { @Override public synchronized void flush() { - super.flush(); try { - reader.redrawLine(); + reader.printString(ConsoleReader.RESET_LINE + ""); + reader.flushConsole(); + super.flush(); + reader.drawLine(); + reader.flushConsole(); } catch (IOException ex) { Logger.getLogger(TerminalConsoleHandler.class.getName()).log(Level.SEVERE, null, ex); } } - }