truncation.,.,.,,,..,,

This commit is contained in:
Chipmunk 2023-04-29 23:34:59 -04:00
parent 3493df35e9
commit eeea72ccfd

View file

@ -109,7 +109,8 @@ public class ChatPlugin extends SessionAdapter {
public void tellraw (Component message, String targets) { public void tellraw (Component message, String targets) {
final int maxLength = client.core().maxCommandLength(); final int maxLength = client.core().maxCommandLength();
String command = "minecraft:tellraw " + targets + " " + GsonComponentSerializer.gson().serialize(message); 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); client.core().run(command);
} }
public void tellraw (Component message) { tellraw(message, "@a"); } public void tellraw (Component message) { tellraw(message, "@a"); }