From eeea72ccfdbc9eecd343af8b12832478d16e0ff7 Mon Sep 17 00:00:00 2001 From: Chipmunk <65827213+ChipmunkMC@users.noreply.github.com> Date: Sat, 29 Apr 2023 23:34:59 -0400 Subject: [PATCH] truncation.,.,.,,,..,, --- .../java/land/chipmunk/chipmunkbot/plugins/ChatPlugin.java | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/main/java/land/chipmunk/chipmunkbot/plugins/ChatPlugin.java b/src/main/java/land/chipmunk/chipmunkbot/plugins/ChatPlugin.java index e903c37..58f9488 100644 --- a/src/main/java/land/chipmunk/chipmunkbot/plugins/ChatPlugin.java +++ b/src/main/java/land/chipmunk/chipmunkbot/plugins/ChatPlugin.java @@ -109,7 +109,8 @@ public class ChatPlugin extends SessionAdapter { public void tellraw (Component message, String targets) { final int maxLength = client.core().maxCommandLength(); String command = "minecraft:tellraw " + targets + " " + GsonComponentSerializer.gson().serialize(message); - if (command.length() > maxLength) command = "minecraft:w " + targets + " " + ComponentUtilities.stringify(message); + if (command.length() > maxLength) command = ("minecraft:w " + targets + " " + ComponentUtilities.stringify(message)); + if (command.length() > maxLength) command = command.substring(0, maxLength); client.core().run(command); } public void tellraw (Component message) { tellraw(message, "@a"); }