From b003ec799beaaaaea534370f9b2770f99e26adb8 Mon Sep 17 00:00:00 2001 From: Axionize <154778082+Axionize@users.noreply.github.com> Date: Mon, 23 Dec 2024 22:44:19 -0500 Subject: [PATCH] Fix Java 8 Compatability in miniMessage() --- .../java/ac/grim/grimac/utils/anticheat/MessageUtil.java | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/src/main/java/ac/grim/grimac/utils/anticheat/MessageUtil.java b/src/main/java/ac/grim/grimac/utils/anticheat/MessageUtil.java index acffa5a74c..aeac23c3de 100644 --- a/src/main/java/ac/grim/grimac/utils/anticheat/MessageUtil.java +++ b/src/main/java/ac/grim/grimac/utils/anticheat/MessageUtil.java @@ -55,13 +55,12 @@ public class MessageUtil { // hex codes if (PacketEvents.getAPI().getServerManager().getVersion().isNewerThanOrEquals(ServerVersion.V_1_16)) { Matcher matcher = HEX_PATTERN.matcher(string); - StringBuilder sb = new StringBuilder(string.length()); - + StringBuffer sb = new StringBuffer(); while (matcher.find()) { matcher.appendReplacement(sb, "<#" + matcher.group(1) + ">"); } - - string = matcher.appendTail(sb).toString(); + matcher.appendTail(sb); + string = sb.toString(); } // MiniMessage doesn't like legacy formatting codes