From 298b5e7a53afa36eec4ad0d338588948eb805058 Mon Sep 17 00:00:00 2001 From: RednedEpic Date: Wed, 16 Oct 2019 16:16:58 -0500 Subject: [PATCH] Fix colored titles --- .../network/translators/java/JavaTitleTranslator.java | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/connector/src/main/java/org/geysermc/connector/network/translators/java/JavaTitleTranslator.java b/connector/src/main/java/org/geysermc/connector/network/translators/java/JavaTitleTranslator.java index a7852ee9a..15824d65b 100644 --- a/connector/src/main/java/org/geysermc/connector/network/translators/java/JavaTitleTranslator.java +++ b/connector/src/main/java/org/geysermc/connector/network/translators/java/JavaTitleTranslator.java @@ -29,6 +29,7 @@ import com.github.steveice10.mc.protocol.packet.ingame.server.ServerTitlePacket; import com.nukkitx.protocol.bedrock.packet.SetTitlePacket; import org.geysermc.connector.network.session.GeyserSession; import org.geysermc.connector.network.translators.PacketTranslator; +import org.geysermc.connector.utils.MessageUtils; public class JavaTitleTranslator extends PacketTranslator { @@ -39,11 +40,11 @@ public class JavaTitleTranslator extends PacketTranslator { switch (packet.getAction()) { case TITLE: titlePacket.setType(SetTitlePacket.Type.SET_TITLE); - titlePacket.setText(packet.getTitle().getFullText()); + titlePacket.setText(MessageUtils.getBedrockMessage(packet.getTitle())); break; case SUBTITLE: titlePacket.setType(SetTitlePacket.Type.SET_SUBTITLE); - titlePacket.setText(packet.getTitle().getFullText()); + titlePacket.setText(MessageUtils.getBedrockMessage(packet.getTitle())); break; case CLEAR: case RESET: @@ -52,7 +53,7 @@ public class JavaTitleTranslator extends PacketTranslator { break; case ACTION_BAR: titlePacket.setType(SetTitlePacket.Type.SET_ACTIONBAR_MESSAGE); - titlePacket.setText(packet.getTitle().getFullText()); + titlePacket.setText(MessageUtils.getBedrockMessage(packet.getTitle())); break; case TIMES: titlePacket.setFadeInTime(packet.getFadeIn());