Fix prefix showing colors when disabled + add customizable TextDisplay format with placeholders
This commit is contained in:
parent
8712a98a87
commit
4494c457a4
4 changed files with 48 additions and 49 deletions
|
|
@ -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;
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue