3
0
Mirror von https://github.com/PaperMC/Paper.git synchronisiert 2024-12-20 13:30:05 +01:00
Paper/src/main/java/net/minecraft/server/ThreadCommandReader.java

46 Zeilen
1.3 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
import static org.bukkit.craftbukkit.Main.*; // CraftBukkit
2012-07-29 09:33:13 +02:00
class ThreadCommandReader extends Thread {
2012-07-29 09:33:13 +02:00
final DedicatedServer server;
2012-07-29 09:33:13 +02:00
ThreadCommandReader(DedicatedServer dedicatedserver) {
this.server = dedicatedserver;
}
public void run() {
// CraftBukkit start
if (!useConsole) {
return;
}
// CraftBukkit end
jline.console.ConsoleReader bufferedreader = this.server.reader; // CraftBukkit
2012-07-29 09:33:13 +02:00
String s;
try {
2011-05-28 22:50:08 +02:00
// CraftBukkit start - JLine disabling compatibility
2012-07-29 09:33:13 +02:00
while (!this.server.isStopped() && this.server.isRunning()) {
if (useJline) {
s = bufferedreader.readLine(">", null);
} else {
s = bufferedreader.readLine();
}
if (s != null) {
this.server.issueCommand(s, this.server);
}
// CraftBukkit end
}
} catch (IOException ioexception) {
2011-05-14 16:29:42 +02:00
// CraftBukkit
2012-07-29 09:33:13 +02:00
MinecraftServer.log.log(java.util.logging.Level.SEVERE, null, ioexception);
}
}
}