public interface TextFactory
Texts
.Modifier and Type | Method and Description |
---|---|
char |
getLegacyChar()
Returns the default legacy formatting character.
|
TextRepresentation |
json()
Get a
TextRepresentation for the Mojangson representation of a Text object. |
TextRepresentation |
legacy(char legacyChar)
Return a representation that accepts and outputs legacy color codes, using the provided legacy character.
|
String |
replaceLegacyCodes(String text,
char from,
char to)
Replaces the given formatting character with another given formatting
character from a legacy string.
|
String |
stripLegacyCodes(String text,
char code)
Removes the legacy formatting character from a legacy string.
|
String |
toPlain(Text text)
Returns a plain text representation of the
Text without any
formattings. |
String |
toPlain(Text text,
Locale locale)
Returns a plain text representation of the
Text without any
formatting in the provided Locale. |
TextRepresentation |
xml()
Get a
TextRepresentation for the TextXML representation of a Text object. |
String toPlain(Text text)
Text
without any
formattings.text
- The text to convertString toPlain(Text text, Locale locale)
Text
without any
formatting in the provided Locale.text
- The text to convertlocale
- The language to get the plain string inTextRepresentation json()
TextRepresentation
for the Mojangson representation of a Text
object.TextRepresentation xml()
TextRepresentation
for the TextXML representation of a Text
object.char getLegacyChar()
TextRepresentation legacy(char legacyChar)
legacyChar
- The legacy character to parse and output usingString stripLegacyCodes(String text, char code)
text
- The legacy text as a Stringcode
- The color character to be replacedString replaceLegacyCodes(String text, char from, char to)
text
- The legacy text as a Stringfrom
- The color character to be replacedto
- The color character to replace with