Fix prefix showing colors when disabled + add customizable TextDisplay format with placeholders

This commit is contained in:
loki5512344 2025-12-31 14:47:58 +01:00
parent 8712a98a87
commit 4494c457a4
4 changed files with 48 additions and 49 deletions

View file

@ -129,9 +129,13 @@ public final class DisplayNameUtil {
GradientConfig cfg = module.getConfig();
String prefix = cfg.getPrefixFormat().replace("{prefix}", data.getPrefix()).stripTrailing();
return (data.hasColors() && data.isColorEnabled() && cfg.isGradientOnPrefix())
? GradientUtil.applyGradient(prefix, data.getColors(), cfg.isUseLegacyRgbFormat())
: prefix;
// Применяем градиент только если цвета включены И есть цвета
if (data.hasColors() && data.isColorEnabled() && cfg.isGradientOnPrefix()) {
return GradientUtil.applyGradient(prefix, data.getColors(), cfg.isUseLegacyRgbFormat());
}
// Возвращаем префикс без цветов
return prefix;
}
/**