Package org.moddingx.libx.util.game
Class TextProcessor
java.lang.Object
org.moddingx.libx.util.game.TextProcessor
Allows text in the lang file to define style information. This is done by dollar commands.
 A dollar command looks like this: 
$(...) where the parts in the parens are multiple
 commands separated by ;. Using $() resets to the default style.
 A command can be one of these:
 - nor- newline: A newline. When this is used, no other commands can be used in the same pair of parens.
- #RRGGBB: A color in hex
- bor- bold: Bold text.
- ior- italic: Italic text.
- uor- underline: Underlined text.
- sor- strikethrough: Strikethrough text.
customCommand(Style, String).- 
Field SummaryFieldsModifier and TypeFieldDescriptionstatic final TextProcessorA text processor without any custom command.
- 
Constructor SummaryConstructors
- 
Method SummaryModifier and TypeMethodDescriptionnet.minecraft.network.chat.StylecustomCommand(net.minecraft.network.chat.Style style, String command) Handles a custom command.List<net.minecraft.network.chat.Component> Processes a string.List<net.minecraft.network.chat.Component> process(net.minecraft.network.chat.Component text) Processes a text component.net.minecraft.network.chat.ComponentprocessLine(String line) Processes a single-line string.net.minecraft.network.chat.ComponentprocessLine(net.minecraft.network.chat.Component line) Processes a single-line text component.
- 
Field Details- 
INSTANCEA text processor without any custom command.
 
- 
- 
Constructor Details- 
TextProcessorpublic TextProcessor()
 
- 
- 
Method Details- 
processpublic List<net.minecraft.network.chat.Component> process(net.minecraft.network.chat.Component text) Processes a text component.- Returns:
- A list of components. Each entry represents one line in the text.
 
- 
processProcesses a string.- Returns:
- A list of components. Each entry represents one line in the text.
 
- 
processLinepublic net.minecraft.network.chat.Component processLine(net.minecraft.network.chat.Component line) Processes a single-line text component.
- 
processLineProcesses a single-line string.
- 
customCommandpublic net.minecraft.network.chat.Style customCommand(net.minecraft.network.chat.Style style, String command) Handles a custom command. The given style can be modified, or a completely new style can be created The default implementation does nothing.
 
-