summaryrefslogtreecommitdiffstats
path: root/src/main/java/net/minecraft
diff options
context:
space:
mode:
authorEdGruberman <ed@rjump.com>2012-03-14 13:59:14 -0700
committerTravis Watkins <amaranth@ubuntu.com>2012-05-15 23:27:51 -0500
commit31d488a3861e60f44703958e36d6eabe422f5f41 (patch)
tree230daedf4be15716c087560cd506afbc3aabb228 /src/main/java/net/minecraft
parentcbd20ec9eae853ccd51d5395b5c0a180fa8c9499 (diff)
downloadcraftbukkit-31d488a3861e60f44703958e36d6eabe422f5f41.tar
craftbukkit-31d488a3861e60f44703958e36d6eabe422f5f41.tar.gz
craftbukkit-31d488a3861e60f44703958e36d6eabe422f5f41.tar.lz
craftbukkit-31d488a3861e60f44703958e36d6eabe422f5f41.tar.xz
craftbukkit-31d488a3861e60f44703958e36d6eabe422f5f41.zip
Update to jline 2. Fixes BUKKIT-717
JLine 2 allows for better color matching in the console and support for colors in console on Windows. Hopefully provides better performance as well.
Diffstat (limited to 'src/main/java/net/minecraft')
-rw-r--r--src/main/java/net/minecraft/server/MinecraftServer.java11
-rw-r--r--src/main/java/net/minecraft/server/ThreadCommandReader.java2
2 files changed, 10 insertions, 3 deletions
diff --git a/src/main/java/net/minecraft/server/MinecraftServer.java b/src/main/java/net/minecraft/server/MinecraftServer.java
index d569ef56..d6f69c99 100644
--- a/src/main/java/net/minecraft/server/MinecraftServer.java
+++ b/src/main/java/net/minecraft/server/MinecraftServer.java
@@ -16,7 +16,7 @@ import java.util.logging.Logger;
import java.io.PrintStream;
import java.io.PrintWriter;
import java.net.UnknownHostException;
-import jline.ConsoleReader;
+import jline.console.ConsoleReader;
import joptsimple.OptionSet;
import org.bukkit.World.Environment;
import org.bukkit.command.ConsoleCommandSender;
@@ -91,7 +91,8 @@ public class MinecraftServer implements Runnable, ICommandListener, IMinecraftSe
// CraftBukkit start
this.options = options;
try {
- this.reader = new ConsoleReader(System.in, new PrintWriter(System.out)); // CraftBukkit - Added "System.in, new PrintWriter(System.out)" in the constuctor
+ this.reader = new ConsoleReader(System.in, System.out);
+ this.reader.setExpandEvents(false); // Avoid parsing exceptions for uncommonly used event designators
} catch (IOException ex) {
Logger.getLogger(MinecraftServer.class.getName()).log(Level.SEVERE, null, ex);
}
@@ -478,6 +479,12 @@ public class MinecraftServer implements Runnable, ICommandListener, IMinecraftSe
try {
this.stop();
this.isStopped = true;
+ // CraftBukkit start - restore terminal to original settings
+ try {
+ this.reader.getTerminal().restore();
+ } catch (Exception e) {
+ }
+ // CraftBukkit end
} catch (Throwable throwable1) {
throwable1.printStackTrace();
} finally {
diff --git a/src/main/java/net/minecraft/server/ThreadCommandReader.java b/src/main/java/net/minecraft/server/ThreadCommandReader.java
index 09505ff6..e48aa733 100644
--- a/src/main/java/net/minecraft/server/ThreadCommandReader.java
+++ b/src/main/java/net/minecraft/server/ThreadCommandReader.java
@@ -21,7 +21,7 @@ public class ThreadCommandReader extends Thread {
}
// CraftBukkit end
- jline.ConsoleReader bufferedreader = this.server.reader; // CraftBukkit
+ jline.console.ConsoleReader bufferedreader = this.server.reader; // CraftBukkit
String s = null;
try {