forked from GeyserMC/Geyser
Only replace the first '.' in a message (#463)
This commit is contained in:
parent
99880c7d46
commit
2e3f32d769
1 changed files with 1 additions and 13 deletions
|
@ -38,19 +38,7 @@ public class BedrockTextTranslator extends PacketTranslator<TextPacket> {
|
|||
|
||||
@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;
|
||||
|
|
Loading…
Reference in a new issue