diff --git a/src/main/java/land/chipmunk/chipmunkbot/plugins/ChatPlugin.java b/src/main/java/land/chipmunk/chipmunkbot/plugins/ChatPlugin.java index b913664..56a49bc 100644 --- a/src/main/java/land/chipmunk/chipmunkbot/plugins/ChatPlugin.java +++ b/src/main/java/land/chipmunk/chipmunkbot/plugins/ChatPlugin.java @@ -49,11 +49,15 @@ public class ChatPlugin extends SessionAdapter { } public void message (String message) { + if (message.length() > 256) return; + final ServerboundChatPacket packet = new ServerboundChatPacket(message, Instant.now().toEpochMilli(), 0, null, 0, new BitSet()); client.session().send(packet); } public void command (String command) { + if (command.length() > 256) return; + final ServerboundChatCommandPacket packet = new ServerboundChatCommandPacket(command, Instant.now().toEpochMilli(), 0, Collections.emptyList(), 0, new BitSet()); client.session().send(packet); }