Fix prefix display logic and add updateall admin command for display names
This commit is contained in:
parent
cc8f4b0f92
commit
64c672c02e
2 changed files with 21 additions and 2 deletions
|
|
@ -31,9 +31,12 @@ public final class DisplayNameUtil {
|
|||
String prefix = null;
|
||||
String prefixFormat = cfg.getPrefixFormat();
|
||||
|
||||
// Определяем префикс: сначала кастомный, потом LuckPerms
|
||||
if (data.isPrefixEnabled() && data.hasPrefix()) {
|
||||
// Есть кастомный префикс
|
||||
prefix = data.getPrefix();
|
||||
} else {
|
||||
} else if (module.getLuckPermsHook().isEnabled()) {
|
||||
// Нет кастомного префикса, проверяем LuckPerms
|
||||
String lpPrefix = module.getLuckPermsHook().getActivePrefix(player);
|
||||
if (lpPrefix != null && !lpPrefix.isEmpty()) {
|
||||
String displayName = buildWithLuckPermsPrefix(
|
||||
|
|
@ -52,6 +55,7 @@ public final class DisplayNameUtil {
|
|||
}
|
||||
}
|
||||
|
||||
// Строим display name с кастомным префиксом или без префикса
|
||||
String displayName = GradientUtil.buildDisplayName(
|
||||
prefix,
|
||||
player.getName(),
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue