3
0
Mirror von https://github.com/PaperMC/Paper.git synchronisiert 2024-12-20 21:40:06 +01:00
Paper/nms-patches/ServerGUI.patch

20 Zeilen
856 B
Diff

2020-01-21 23:33:40 +01:00
--- a/net/minecraft/server/ServerGUI.java
+++ b/net/minecraft/server/ServerGUI.java
2020-06-25 02:00:00 +02:00
@@ -158,6 +158,7 @@
2020-01-21 23:33:40 +01:00
this.e.forEach(Runnable::run);
}
+ private static final java.util.regex.Pattern ANSI = java.util.regex.Pattern.compile("\\x1B\\[([0-9]{1,2}(;[0-9]{1,2})*)?[m|K]"); // CraftBukkit
public void a(JTextArea jtextarea, JScrollPane jscrollpane, String s) {
if (!SwingUtilities.isEventDispatchThread()) {
SwingUtilities.invokeLater(() -> {
2020-06-25 02:00:00 +02:00
@@ -173,7 +174,7 @@
2020-01-21 23:33:40 +01:00
}
try {
- document.insertString(document.getLength(), s, (AttributeSet) null);
+ document.insertString(document.getLength(), ANSI.matcher(s).replaceAll(""), (AttributeSet) null); // CraftBukkit
} catch (BadLocationException badlocationexception) {
;
}