3
0
Mirror von https://github.com/PaperMC/Paper.git synchronisiert 2024-12-19 13:00:06 +01:00

Apply strict limits on the length of sign text

Dieser Commit ist enthalten in:
Thinkofdeath 2015-06-12 10:23:05 +01:00
Ursprung a2d26409f7
Commit 5d84673655

Datei anzeigen

@ -13,7 +13,7 @@
this.i.b(nbttagcompound); this.i.b(nbttagcompound);
} }
@@ -65,12 +71,24 @@ @@ -65,12 +71,27 @@
public void a(CommandObjectiveExecutor.EnumCommandResult commandobjectiveexecutor_enumcommandresult, int i) {} public void a(CommandObjectiveExecutor.EnumCommandResult commandobjectiveexecutor_enumcommandresult, int i) {}
}; };
@ -25,6 +25,9 @@
+ +
for (int i = 0; i < 4; ++i) { for (int i = 0; i < 4; ++i) {
String s = nbttagcompound.getString("Text" + (i + 1)); String s = nbttagcompound.getString("Text" + (i + 1));
+ if (s != null && s.length() > 384) {
+ s = "\"\"";
+ }
try { try {
IChatBaseComponent ichatbasecomponent = IChatBaseComponent.ChatSerializer.a(s); IChatBaseComponent ichatbasecomponent = IChatBaseComponent.ChatSerializer.a(s);
@ -38,7 +41,7 @@
try { try {
this.lines[i] = ChatComponentUtils.filterForDisplay(icommandlistener, ichatbasecomponent, (Entity) null); this.lines[i] = ChatComponentUtils.filterForDisplay(icommandlistener, ichatbasecomponent, (Entity) null);
} catch (CommandException commandexception) { } catch (CommandException commandexception) {
@@ -155,7 +173,10 @@ @@ -155,7 +176,10 @@
ChatClickable chatclickable = chatmodifier.h(); ChatClickable chatclickable = chatmodifier.h();
if (chatclickable.a() == ChatClickable.EnumClickAction.RUN_COMMAND) { if (chatclickable.a() == ChatClickable.EnumClickAction.RUN_COMMAND) {