OBFHELPERS (#4733)

This commit is contained in:
Mariell
2020-11-03 22:30:15 +01:00
parent c208709558
commit 0b2f49cb81
2 changed files with 15 additions and 5 deletions

View File

@@ -37,6 +37,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
String[] lines = new String[4];
for (int i = 0; i < list.size(); ++i) {
- lines[i] = SharedConstants.filterAllowedChatCharacters(list.get(i)); // Paper - Replaced with anvil color stripping method to stop exploits that allow colored signs to be created.
+ // Paper start - cap line length - modified clients can send longer data than normal
+ String currentLine = list.get(i);
+ if (MAX_SIGN_LINE_LENGTH > 0 && currentLine.length() > MAX_SIGN_LINE_LENGTH) {
@@ -47,9 +48,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
+ }
+ }
+ // Paper end
// Paper TODO(Proximyst): Add obfhelper when 1.16.4 runs
- lines[i] = SharedConstants.a(list.get(i)); // Paper - Replaced with anvil color stripping method to stop exploits that allow colored signs to be created.
+ lines[i] = SharedConstants.a(currentLine); // Paper - Replaced with anvil color stripping method to stop exploits that allow colored signs to be created.
+ lines[i] = SharedConstants.filterAllowedChatCharacters(currentLine); // Paper - Replaced with anvil color stripping method to stop exploits that allow colored signs to be created.
}
SignChangeEvent event = new SignChangeEvent((org.bukkit.craftbukkit.block.CraftBlock) player.getWorld().getBlockAt(x, y, z), this.server.getPlayer(this.player), lines);
this.server.getPluginManager().callEvent(event);