From 26f644c554ecbf8100ebaddb1ae33524ef688571 Mon Sep 17 00:00:00 2001 From: Nassim <28825609+KennyTV@users.noreply.github.com> Date: Mon, 2 Sep 2019 00:21:08 +0200 Subject: [PATCH] Fix sign line capping check (#2522) --- Spigot-Server-Patches/0358-Limit-Client-Sign-length-more.patch | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Spigot-Server-Patches/0358-Limit-Client-Sign-length-more.patch b/Spigot-Server-Patches/0358-Limit-Client-Sign-length-more.patch index 6880da918c..e75f5792ff 100644 --- a/Spigot-Server-Patches/0358-Limit-Client-Sign-length-more.patch +++ b/Spigot-Server-Patches/0358-Limit-Client-Sign-length-more.patch @@ -41,7 +41,7 @@ index 6030766099..b030269f0a 100644 + if (MAX_SIGN_LINE_LENGTH > 0 && astring[i].length() > MAX_SIGN_LINE_LENGTH) { + // This handles multibyte characters as 1 + int offset = astring[i].codePoints().limit(MAX_SIGN_LINE_LENGTH).map(Character::charCount).sum(); -+ if (offset > astring.length) { ++ if (offset < astring[i].length()) { + astring[i] = astring[i].substring(0, offset); + } + }