public interface FormattingCodeTextSerializer extends SafeTextSerializer
TextSerializer for the old "formatting code" strings. A
formatted message consists out of plain text with a special character
indicating a formatting follows and a unique character for each formatting.
Example: &cHello &eSponge!
With the special character
& this would represent a red and yellow message. (With c, and
e being the formatting characters.)
| Modifier and Type | Method and Description |
|---|---|
char |
getCharacter()
Returns the formatting character for this
FormattingCodeTextSerializer. |
String |
replaceCodes(String text,
char to)
Replaces the formatting codes in the specified string with a different
specified character, e.g.
|
default String |
replaceCodes(String text,
FormattingCodeTextSerializer serializer)
Replaces the formatting codes in the specified string with a different
character for the specified
FormattingCodeTextSerializer,
e.g. |
String |
stripCodes(String text)
Removes the color codes for this
FormattingCodeTextSerializer
from a string. |
deserialize, deserializeUncheckedserialize, serializeSinglegetId, getNamechar getCharacter()
FormattingCodeTextSerializer.String stripCodes(String text)
FormattingCodeTextSerializer
from a string.text - The stringString replaceCodes(String text, char to)
&cHello &eSponge! -> $cHello $eSponge!text - The string to replace the formatting codes into - The special character to replace withdefault String replaceCodes(String text, FormattingCodeTextSerializer serializer)
FormattingCodeTextSerializer,
e.g. &cHello &eSponge! -> $cHello $eSponge!text - The string to replace the formatting codes inserializer - The serializer to replace for