Mirror von
https://github.com/PaperMC/Paper.git
synchronisiert 2024-11-17 05:20:05 +01:00
Added ">" to input command line, separated it from output buffer properly
Dieser Commit ist enthalten in:
Ursprung
2419e0b8a7
Commit
685d4dbb3f
@ -3,6 +3,7 @@ package net.minecraft.server;
|
|||||||
import java.io.BufferedReader;
|
import java.io.BufferedReader;
|
||||||
import java.io.IOException;
|
import java.io.IOException;
|
||||||
import java.io.InputStreamReader;
|
import java.io.InputStreamReader;
|
||||||
|
import java.io.PrintStream;
|
||||||
import java.util.logging.Level;
|
import java.util.logging.Level;
|
||||||
import java.util.logging.Logger;
|
import java.util.logging.Logger;
|
||||||
import jline.ConsoleReader;
|
import jline.ConsoleReader;
|
||||||
@ -21,11 +22,9 @@ public class ThreadCommandReader extends Thread {
|
|||||||
try {
|
try {
|
||||||
ConsoleReader reader = a.reader;
|
ConsoleReader reader = a.reader;
|
||||||
String line = null;
|
String line = null;
|
||||||
|
while ((!this.a.g) && (MinecraftServer.a(this.a)) && ((line = reader.readLine(">", null)) != null)) {
|
||||||
while ((!this.a.g) && (MinecraftServer.a(this.a)) && ((line = reader.readLine()) != null)) {
|
|
||||||
this.a.a(line, (ICommandListener) this.a);
|
this.a.a(line, (ICommandListener) this.a);
|
||||||
}
|
}
|
||||||
|
|
||||||
} catch (IOException ex) {
|
} catch (IOException ex) {
|
||||||
Logger.getLogger(ThreadCommandReader.class.getName()).log(Level.SEVERE, null, ex);
|
Logger.getLogger(ThreadCommandReader.class.getName()).log(Level.SEVERE, null, ex);
|
||||||
}
|
}
|
||||||
|
@ -16,12 +16,14 @@ public class TerminalConsoleHandler extends ConsoleHandler {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public synchronized void flush() {
|
public synchronized void flush() {
|
||||||
super.flush();
|
|
||||||
try {
|
try {
|
||||||
reader.redrawLine();
|
reader.printString(ConsoleReader.RESET_LINE + "");
|
||||||
|
reader.flushConsole();
|
||||||
|
super.flush();
|
||||||
|
reader.drawLine();
|
||||||
|
reader.flushConsole();
|
||||||
} catch (IOException ex) {
|
} catch (IOException ex) {
|
||||||
Logger.getLogger(TerminalConsoleHandler.class.getName()).log(Level.SEVERE, null, ex);
|
Logger.getLogger(TerminalConsoleHandler.class.getName()).log(Level.SEVERE, null, ex);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
Laden…
In neuem Issue referenzieren
Einen Benutzer sperren