mirror of
https://github.com/darksaid98/Carbon.git
synced 2026-12-02 06:28:54 +00:00
Fix legacy code detection in PlaceholderAPIMiniMessageParser
This commit is contained in:
1 file changed
+4
-6
+4
-6
@@ -28,7 +28,6 @@ import net.kyori.adventure.text.minimessage.MiniMessage;
|
||||
import net.kyori.adventure.text.minimessage.tag.Tag;
|
||||
import net.kyori.adventure.text.minimessage.tag.resolver.TagResolver;
|
||||
import net.kyori.adventure.text.serializer.legacy.LegacyComponentSerializer;
|
||||
import org.bukkit.ChatColor;
|
||||
import org.bukkit.OfflinePlayer;
|
||||
import org.bukkit.entity.Player;
|
||||
import org.checkerframework.checker.nullness.qual.NonNull;
|
||||
@@ -48,14 +47,13 @@ public final class PlaceholderAPIMiniMessageParser {
|
||||
}
|
||||
|
||||
private static boolean containsLegacyColorCodes(final String string) {
|
||||
final char[] charArray = ChatColor.translateAlternateColorCodes('&', string).toCharArray();
|
||||
|
||||
for (final char c : charArray) {
|
||||
if (c == LegacyComponentSerializer.SECTION_CHAR) {
|
||||
final char[] charArray = string.toCharArray();
|
||||
for (int i = 0; i < charArray.length - 1; i++) {
|
||||
if (charArray[i] == LegacyComponentSerializer.SECTION_CHAR
|
||||
&& "0123456789AaBbCcDdEeFfKkLlMmNnOoRrXx".indexOf(charArray[i + 1]) > -1) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
Reference in new issue
Block a user