Mirror von
https://github.com/PaperMC/Paper.git
synchronisiert 2024-12-19 04:50:06 +01:00
Strip ANSI colours from ServerGUI
Dieser Commit ist enthalten in:
Ursprung
dad61762f8
Commit
8160e299d0
19
nms-patches/ServerGUI.patch
Normale Datei
19
nms-patches/ServerGUI.patch
Normale Datei
@ -0,0 +1,19 @@
|
|||||||
|
--- a/net/minecraft/server/ServerGUI.java
|
||||||
|
+++ b/net/minecraft/server/ServerGUI.java
|
||||||
|
@@ -159,6 +159,7 @@
|
||||||
|
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(() -> {
|
||||||
|
@@ -174,7 +175,7 @@
|
||||||
|
}
|
||||||
|
|
||||||
|
try {
|
||||||
|
- document.insertString(document.getLength(), s, (AttributeSet) null);
|
||||||
|
+ document.insertString(document.getLength(), ANSI.matcher(s).replaceAll(""), (AttributeSet) null); // CraftBukkit
|
||||||
|
} catch (BadLocationException badlocationexception) {
|
||||||
|
;
|
||||||
|
}
|
Laden…
In neuem Issue referenzieren
Einen Benutzer sperren