Fix Hex-Colored names in parties/admin chat

This commit is contained in:
nossr50
2020-11-06 14:01:07 -08:00
parent b2cdffe965
commit a4fd632d53
23 changed files with 300 additions and 220 deletions

View File

@ -3,6 +3,7 @@ package com.gmail.nossr50.events.chat;
import com.gmail.nossr50.chat.author.Author;
import com.gmail.nossr50.chat.message.AbstractChatMessage;
import com.gmail.nossr50.chat.message.ChatMessage;
import com.gmail.nossr50.datatypes.chat.ChatChannel;
import net.kyori.adventure.audience.Audience;
import net.kyori.adventure.text.Component;
import net.kyori.adventure.text.TextComponent;
@ -57,23 +58,13 @@ public abstract class McMMOChatEvent extends Event implements Cancellable {
return plugin;
}
/**
* The display name of the author
*
* @return the display name of the author
* @deprecated Use {@link #getDisplayName()} instead
*/
@Deprecated
public @NotNull String getSender() {
return getAuthor().getAuthoredName();
}
/**
* The name of the author
* Will return the display name if mcMMO chat config is set to, otherwise returns the players Mojang registered nickname
* @return the author's name
*/
public @NotNull String getDisplayName() {
return getAuthor().getAuthoredName();
public @NotNull String getDisplayName(ChatChannel chatChannel) {
return getAuthor().getAuthoredName(chatChannel);
}
/**
@ -115,14 +106,6 @@ public abstract class McMMOChatEvent extends Event implements Cancellable {
this.chatMessage.setChatMessage(chatMessage);
}
/**
* Does not function anymore
*/
@Deprecated
public void setDisplayName(@NotNull String displayName) {
return;
}
/**
* @param message Adjusts the final message sent to players in the party
*