Skip to content

Commit

Permalink
Fix Java 8 Compatability in miniMessage()
Browse files Browse the repository at this point in the history
  • Loading branch information
Axionize committed Dec 24, 2024
1 parent 11037cd commit b003ec7
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions src/main/java/ac/grim/grimac/utils/anticheat/MessageUtil.java
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit b003ec7

Please sign in to comment.