Skip to content

Commit 53b5842

Browse files
authored
Strip color codes from messages where they aren't supported anymore (#6438)
1 parent f66aec3 commit 53b5842

2 files changed

Lines changed: 2 additions & 2 deletions

File tree

core/src/main/java/org/geysermc/geyser/event/type/SessionDisconnectEventImpl.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ public class SessionDisconnectEventImpl extends SessionDisconnectEvent {
4242
private final Component reasonComponent;
4343

4444
public SessionDisconnectEventImpl(@NonNull GeyserSession session, Component reason) {
45-
super(session, MessageTranslator.convertMessageRaw(reason, session.locale()));
45+
super(session, MessageTranslator.convertToPlainText(reason, session.locale()));
4646
this.reasonComponent = reason;
4747
}
4848
}

core/src/main/java/org/geysermc/geyser/network/netty/GeyserServer.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -296,7 +296,7 @@ public BedrockPong onQuery(Channel channel, InetSocketAddress inetSocketAddress)
296296
.serverId(channel.config().getOption(RakChannelOption.RAK_GUID));
297297

298298
if (config.motd().passthroughMotd() && pingInfo != null && pingInfo.getDescription() != null) {
299-
String[] motd = MessageTranslator.convertMessageLenient(pingInfo.getDescription()).split("\n");
299+
String[] motd = MessageTranslator.convertToPlainTextLenient(pingInfo.getDescription(), GeyserLocale.getDefaultLocale()).split("\n");
300300
String mainMotd = (motd.length > 0) ? motd[0] : config.motd().primaryMotd(); // First line of the motd.
301301
String subMotd = (motd.length > 1) ? motd[1] : config.motd().secondaryMotd(); // Second line of the motd if present, otherwise default.
302302

0 commit comments

Comments
 (0)