@FunctionalInterface public interface ChatIdentityFormatter
ChatFormatter
The formatting provides only the left most portion (the player name and prompt), not the actual chat message
| Modifier and Type | Method and Description |
|---|---|
String |
format(String message,
Player sender)
Obtains a formatted string of the chat identifier
|
default void |
overriden(ChatIdentityFormatter other,
Plugin overrider)
A callback indicating the overriding of this provider
|
String format(String message, Player sender)
%p - the default prefix%n - the player name%s - the default suffix%d - the default promptThe default is usually %n>. The default is filled in, but cannot replace the default string.
Examples:
// Default is: John>
// [Prefix]John[Suffix]>>
return "[Prefix]%n[Suffix]>>";
// [Prefix]JOHN>
return "[Prefix]" + sender.displayName().toUpperCase() + "%d";
It is generally a good idea to use the provided variables than to hardcode them, as the implementation is allowed to change the chat characters.
message - the default identifiersender - the player sending the identifierdefault void overriden(ChatIdentityFormatter other, Plugin overrider)
other - the chat provider that is being setoverrider - the plugin that is setting the overriderCopyright © 2016. All rights reserved.