Добавлен DisplayNameListener: префикс и цвет ника теперь отображаются возле ника в игре
This commit is contained in:
parent
ee67dcc12a
commit
1d75327a4d
3 changed files with 153 additions and 0 deletions
|
|
@ -53,6 +53,13 @@ public class ChatColorCommand implements CommandExecutor, TabCompleter {
|
|||
// Сохраняем цвет чата игрока
|
||||
plugin.getChatColorManager().setChatColor(player.getUniqueId(), color);
|
||||
|
||||
// Обновляем display name игрока
|
||||
player.getScheduler().run(plugin, task -> {
|
||||
if (plugin.getDisplayNameListener() != null) {
|
||||
plugin.getDisplayNameListener().updatePlayerDisplayName(player);
|
||||
}
|
||||
}, null);
|
||||
|
||||
// Показываем пример с примененным цветом
|
||||
String preview = ChatFormatter.convertAllColors(color + "Пример текста");
|
||||
player.sendMessage(ChatFormatter.parse("<green>Цвет чата установлен! Пример: " + preview));
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue