2011-02-25 17:12:38 +01:00
|
|
|
package net.minecraft.server;
|
|
|
|
|
|
|
|
import java.io.BufferedReader;
|
|
|
|
import java.io.IOException;
|
|
|
|
import java.io.InputStreamReader;
|
2011-02-25 20:01:14 +01:00
|
|
|
import java.io.PrintStream;
|
2011-02-25 17:12:38 +01:00
|
|
|
import java.util.logging.Level;
|
|
|
|
import java.util.logging.Logger;
|
|
|
|
import jline.ConsoleReader;
|
|
|
|
|
|
|
|
public class ThreadCommandReader extends Thread {
|
|
|
|
|
|
|
|
final MinecraftServer a;
|
|
|
|
|
|
|
|
public ThreadCommandReader(MinecraftServer minecraftserver) {
|
|
|
|
this.a = minecraftserver;
|
|
|
|
}
|
|
|
|
|
|
|
|
public void run() {
|
|
|
|
// Craftbukkit start - whole method, nuked to oblivion! :o
|
|
|
|
|
|
|
|
try {
|
|
|
|
ConsoleReader reader = a.reader;
|
|
|
|
String line = null;
|
2011-02-25 20:01:14 +01:00
|
|
|
while ((!this.a.g) && (MinecraftServer.a(this.a)) && ((line = reader.readLine(">", null)) != null)) {
|
2011-02-25 17:12:38 +01:00
|
|
|
this.a.a(line, (ICommandListener) this.a);
|
|
|
|
}
|
|
|
|
} catch (IOException ex) {
|
|
|
|
Logger.getLogger(ThreadCommandReader.class.getName()).log(Level.SEVERE, null, ex);
|
|
|
|
}
|
|
|
|
// Craftbukkit end
|
|
|
|
}
|
|
|
|
}
|