mirror of
https://github.com/AtlasMediaGroup/Scissors.git
synced 2024-11-17 18:56:12 +00:00
2109ba025d
* Remove patch that is now in Paper * Redirect Paper's safe component method to ours
19 lines
997 B
Diff
19 lines
997 B
Diff
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
|
From: Allink <arclicious@vivaldi.net>
|
|
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 0f70be614f8f5350ad558d0ae645cdf0027e1e76..c006ac8531cf2c029fd2fac449f96736a4afed0d 100644
|
|
--- a/src/main/java/org/bukkit/craftbukkit/util/CraftChatMessage.java
|
|
+++ b/src/main/java/org/bukkit/craftbukkit/util/CraftChatMessage.java
|
|
@@ -199,6 +199,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();
|
|
}
|
|
|