From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: Allink Date: Tue, 16 Aug 2022 17:13:02 +0100 Subject: [PATCH] Refuse to convert legacy messages over 1k characters diff --git a/src/main/java/org/bukkit/craftbukkit/util/CraftChatMessage.java b/src/main/java/org/bukkit/craftbukkit/util/CraftChatMessage.java index 753200057e74b8e2d5274894b982e6ee946a559e..25df28c8a2061a754cb576634b63d5ca6e5011d1 100644 --- a/src/main/java/org/bukkit/craftbukkit/util/CraftChatMessage.java +++ b/src/main/java/org/bukkit/craftbukkit/util/CraftChatMessage.java @@ -198,6 +198,7 @@ public final class CraftChatMessage { } public static Component[] fromString(String message, boolean keepNewlines, boolean plain) { + if (message.length() > 1_000) return new Component[]{Component.empty()}; // Scissors - Refuse to convert legacy messages over 1k characters return new StringMessage(message, keepNewlines, plain).getOutput(); }