mirror of
https://github.com/PaperMC/Paper.git
synced 2025-08-16 04:33:56 -07:00
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.
This commit is contained in:
committed by
Travis Watkins
parent
cbd20ec9ea
commit
31d488a386
@@ -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 {
|
||||
|
Reference in New Issue
Block a user