/
minecraftbackup
/
AnarchyExploitFixes
Обзор
Документация
Войти
/
minecraftbackup
/
AnarchyExploitFixes
Код
Запросы
0
Задачи
Вики
Пакеты
0
Релизы
0
Аналитика
Безопасность
master
AnarchyExploitFixesFolia/src/main/java/me/xginko/aef/utils/KyoriUtil.java
47 строк
2 KB
xGinko
put some long needed love into commands
04 июн 2024, 04:32
04 июн 2024, 04:32
785882f
Код
Авторство
О чём код?
package me.xginko.aef.utils; import net.kyori.adventure.text.Component; import net.kyori.adventure.text.TextReplacementConfig; import net.kyori.adventure.text.format.TextColor; import java.util.Locale; public class KyoriUtil { public static final TextColor AEF_BLUE = TextColor.fromHexString("#00EDFF"); public static final TextColor AEF_WHITE = TextColor.fromHexString("#E2FDFF"); public static final TextColor AEF_GOLD = TextColor.fromHexString("#ffc44f"); public static Component toUpperCase(Component input, Locale locale) { return input.replaceText(TextReplacementConfig.builder() .match("(?s).*") .replacement((result, builder) -> builder.content(result.group(0).toUpperCase(locale))) .build()); } public static String translateChatColor(String string) { string = string.replace("&0", "<black>"); string = string.replace("&1", "<dark_blue>"); string = string.replace("&2", "<dark_green>"); string = string.replace("&3", "<dark_aqua>"); string = string.replace("&4", "<dark_red>"); string = string.replace("&5", "<dark_purple>"); string = string.replace("&6", "<gold>"); string = string.replace("&7", "<gray>"); string = string.replace("&8", "<dark_gray>"); string = string.replace("&9", "<blue>"); string = string.replace("&a", "<green>"); string = string.replace("&b", "<aqua>"); string = string.replace("&c", "<red>"); string = string.replace("&d", "<light_purple>"); string = string.replace("&e", "<yellow>"); string = string.replace("&f", "<white>"); string = string.replace("&k", "<obfuscated>"); string = string.replace("&l", "<bold>"); string = string.replace("&m", "<strikethrough>"); string = string.replace("&n", "<underlined>"); string = string.replace("&o", "<italic>"); string = string.replace("&r", "<reset>"); return string; } }