From 2e3f32d76913eeb30f2d4fcedf5adf84ae529bed Mon Sep 17 00:00:00 2001 From: rtm516 Date: Fri, 1 May 2020 06:49:29 +0100 Subject: [PATCH] Only replace the first '.' in a message (#463) --- .../translators/bedrock/BedrockTextTranslator.java | 14 +------------- 1 file changed, 1 insertion(+), 13 deletions(-) diff --git a/connector/src/main/java/org/geysermc/connector/network/translators/bedrock/BedrockTextTranslator.java b/connector/src/main/java/org/geysermc/connector/network/translators/bedrock/BedrockTextTranslator.java index 4dfe4c76..8a912142 100644 --- a/connector/src/main/java/org/geysermc/connector/network/translators/bedrock/BedrockTextTranslator.java +++ b/connector/src/main/java/org/geysermc/connector/network/translators/bedrock/BedrockTextTranslator.java @@ -38,19 +38,7 @@ public class BedrockTextTranslator extends PacketTranslator { @Override public void translate(TextPacket packet, GeyserSession session) { - if (packet.getMessage().charAt(0) == '.') { - String message = packet.getMessage().replace(".", "/").trim(); - - if (MessageUtils.isTooLong(message, session)) { - return; - } - - ClientChatPacket chatPacket = new ClientChatPacket(message); - session.getDownstream().getSession().send(chatPacket); - return; - } - - String message = packet.getMessage().trim(); + String message = packet.getMessage().replaceAll("^\\.", "/").trim(); if (MessageUtils.isTooLong(message, session)) { return;