Don't allow blank messages to be sent

Fixes #2546
This commit is contained in:
Camotoy 2021-09-23 17:52:22 -04:00
parent 27a17ff183
commit 85a5762364
No known key found for this signature in database
GPG key ID: 7EEFB66FE798081F

View file

@ -40,6 +40,11 @@ public class BedrockTextTranslator extends PacketTranslator<TextPacket> {
public void translate(GeyserSession session, TextPacket packet) {
String message = packet.getMessage();
if (message.isBlank()) {
// Java Edition (as of 1.17.1) just doesn't pass on these messages, so... we won't either!
return;
}
if (MessageTranslator.isTooLong(message, session)) {
return;
}