Paper/src/main/java/net/minecraft/server/ThreadCommandReader.java

47 Zeilen
1.5 KiB
Java

package net.minecraft.server;
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
2011-04-20 22:47:26 +02:00
// CraftBukkit start
import java.util.logging.Level;
import java.util.logging.Logger;
import jline.ConsoleReader;
2011-04-20 22:47:26 +02:00
// CraftBukkit end
public class ThreadCommandReader extends Thread {
final MinecraftServer server;
public ThreadCommandReader(MinecraftServer minecraftserver) {
this.server = minecraftserver;
}
public void run() {
// CraftBukkit start
2011-05-14 16:29:42 +02:00
ConsoleReader bufferedreader = this.server.reader;
String s = null;
String jlineTerminalSetting = org.bukkit.craftbukkit.Main.jlineTerminalSetting;
// CraftBukkit end
try {
while (!this.server.isStopped && MinecraftServer.isRunning(this.server)) {
// CraftBukkit start - JLine disabling compatibility
if (jlineTerminalSetting != null && jlineTerminalSetting.equals("jline.UnsupportedTerminal")) {
s = bufferedreader.readLine();
} else {
s = bufferedreader.readLine(">", null);
}
if (s != null) {
// CraftBukkit end
this.server.issueCommand(s, this.server);
}
}
} catch (IOException ioexception) {
2011-05-14 16:29:42 +02:00
// CraftBukkit
Logger.getLogger(ThreadCommandReader.class.getName()).log(Level.SEVERE, null, ioexception);
}
}
}