Skip to content

Commit 0816529

Browse files
committed
Escape special char in code
1 parent de8031e commit 0816529

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

BlueMapBukkit/src/main/java/de/bluecolored/bluemap/bukkit/BukkitCommandSource.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ public void sendMessage(Text text) {
2626
return;
2727
}
2828

29-
delegate.sendMessage(text.toFormattingCodedString('§'));
29+
delegate.sendMessage(text.toPlainString());
3030
});
3131
}
3232

BlueMapCommon/src/main/java/de/bluecolored/bluemap/common/plugin/text/Text.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ public String toJSONString() {
4949
if (hoverText != null) {
5050
sb.append(quote("hoverEvent")).append(":{");
5151
sb.append(quote("action")).append(":").append(quote("show_text")).append(',');
52-
sb.append(quote("value")).append(":").append(quote(hoverText.toFormattingCodedString('§')));
52+
sb.append(quote("value")).append(":").append(quote(hoverText.toFormattingCodedString('\u00a7')));
5353
sb.append("},");
5454
}
5555

@@ -131,7 +131,7 @@ private String quote(String value) {
131131
private String escape(String value) {
132132
value = value.replace("\\", "\\\\");
133133
value = value.replace("\"", "\\\"");
134-
value = value.replace("§", "\\u00a7");
134+
value = value.replace("\u00a7", "\\u00a7");
135135
value = value.replace("\n", "\\n");
136136
return value;
137137
}

0 commit comments

Comments
 (0)