From 09eff5a2fb1b2684e08d2d8a6eb46b1b855012c3 Mon Sep 17 00:00:00 2001 From: Andrew Steinborn Date: Tue, 7 Aug 2018 07:56:28 -0400 Subject: [PATCH] GS4 clients generally don't understand MC color codes (or JSON chat). --- .../velocitypowered/proxy/protocol/netty/GS4QueryHandler.java | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/proxy/src/main/java/com/velocitypowered/proxy/protocol/netty/GS4QueryHandler.java b/proxy/src/main/java/com/velocitypowered/proxy/protocol/netty/GS4QueryHandler.java index 1848ad3fb..b0c5a838b 100644 --- a/proxy/src/main/java/com/velocitypowered/proxy/protocol/netty/GS4QueryHandler.java +++ b/proxy/src/main/java/com/velocitypowered/proxy/protocol/netty/GS4QueryHandler.java @@ -10,6 +10,7 @@ import io.netty.buffer.ByteBuf; import io.netty.channel.ChannelHandlerContext; import io.netty.channel.SimpleChannelInboundHandler; import io.netty.channel.socket.DatagramPacket; +import net.kyori.text.serializer.ComponentSerializers; import org.apache.logging.log4j.LogManager; import org.apache.logging.log4j.Logger; @@ -100,7 +101,7 @@ public class GS4QueryHandler extends SimpleChannelInboundHandler // Start writing the response ResponseWriter responseWriter = new ResponseWriter(queryResponse, queryMessage.readableBytes() == 0); - responseWriter.write("hostname", server.getConfiguration().getMotd()); + responseWriter.write("hostname", ComponentSerializers.PLAIN.serialize(server.getConfiguration().getMotdComponent())); responseWriter.write("gametype", "SMP"); responseWriter.write("game_id", "MINECRAFT");