Scissors/patches/server/0023-Refuse-to-convert-legacy-messages-over-1k-characters.patch

19 lines
997 B
Diff
Raw Normal View History

2024-05-11 18:29:15 +00:00
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: Telesphoreo <me@telesphoreo.me>
Date: Sat, 11 May 2024 13:09:44 -0500
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
2024-06-15 00:09:16 +00:00
index 70f207f016959402ff3cba9de924f906fea28110..f4751469d925f350a7eda9ae6a1f340d41636b2c 100644
2024-05-11 18:29:15 +00:00
--- a/src/main/java/org/bukkit/craftbukkit/util/CraftChatMessage.java
+++ b/src/main/java/org/bukkit/craftbukkit/util/CraftChatMessage.java
2024-06-15 00:09:16 +00:00
@@ -216,6 +216,7 @@ public final class CraftChatMessage {
2024-05-11 18:29:15 +00:00
}
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();
}