From abb3c5eee6d06b5746f941cd561be42d9a84ad1e Mon Sep 17 00:00:00 2001 From: Tahg Date: Tue, 18 Jan 2011 19:42:49 -0500 Subject: [PATCH] reverted # from server console --- .gitignore | 2 ++ .../net/minecraft/server/MinecraftServer.java | 2 +- .../minecraft/server/ThreadCommandReader.java | 26 +++++++++++++++++++ 3 files changed, 29 insertions(+), 1 deletion(-) create mode 100644 src/main/java/net/minecraft/server/ThreadCommandReader.java diff --git a/.gitignore b/.gitignore index 9c628f5f76..cc7ca79fd0 100644 --- a/.gitignore +++ b/.gitignore @@ -14,3 +14,5 @@ # vim .*.sw[a-p] + +/world \ No newline at end of file diff --git a/src/main/java/net/minecraft/server/MinecraftServer.java b/src/main/java/net/minecraft/server/MinecraftServer.java index 704b2a9505..0d8a1bd03e 100644 --- a/src/main/java/net/minecraft/server/MinecraftServer.java +++ b/src/main/java/net/minecraft/server/MinecraftServer.java @@ -449,7 +449,7 @@ public class MinecraftServer implements ICommandListener, Runnable { } } } else { - a.info("Unknown console command. Type \"#help\" for help."); + a.info("Unknown console command. Type \"help\" for help."); } } while (true); } diff --git a/src/main/java/net/minecraft/server/ThreadCommandReader.java b/src/main/java/net/minecraft/server/ThreadCommandReader.java new file mode 100644 index 0000000000..ae3574247b --- /dev/null +++ b/src/main/java/net/minecraft/server/ThreadCommandReader.java @@ -0,0 +1,26 @@ +package net.minecraft.server; + +import java.io.*; + +public class ThreadCommandReader extends Thread { + + final MinecraftServer a; /* synthetic field */ + + public ThreadCommandReader(MinecraftServer minecraftserver) { + super(); + a = minecraftserver; + } + + public void run() { + BufferedReader bufferedreader = new BufferedReader(((java.io.Reader) (new InputStreamReader(System.in)))); + String s = null; + + try { + while (!a.g && MinecraftServer.a(a) && (s = bufferedreader.readLine()) != null) { + a.a("#" + s, ((ICommandListener) (a))); + } + } catch (IOException ioexception) { + ioexception.printStackTrace(); + } + } +}