public class LegacyStringDeserializer
extends java.lang.Object
ATextComponent.| Constructor and Description |
|---|
LegacyStringDeserializer() |
| Modifier and Type | Method and Description |
|---|---|
static ATextComponent |
parse(java.lang.String s,
boolean unknownWhite)
Parse a string with legacy formatting codes into an
ATextComponent. |
static ATextComponent |
parse(java.lang.String s,
char colorChar,
boolean unknownWhite)
Parse a string with legacy formatting codes into an
ATextComponent. |
static ATextComponent |
parse(java.lang.String s,
char colorChar,
java.util.function.Function<java.lang.Character,net.lenni0451.mcstructs.core.TextFormatting> formattingResolver)
Parse a string with legacy formatting codes into an
ATextComponent. |
public static ATextComponent parse(java.lang.String s, boolean unknownWhite)
ATextComponent.TextFormatting.WHITE.s - The string to parseunknownWhite - Handle unknown formatting codes as resetpublic static ATextComponent parse(java.lang.String s, char colorChar, boolean unknownWhite)
ATextComponent.TextFormatting.WHITE.s - The string to parsecolorChar - The color char to use (e.g. TextFormatting.COLOR_CHAR)unknownWhite - Handle unknown formatting codes as resetpublic static ATextComponent parse(java.lang.String s, char colorChar, java.util.function.Function<java.lang.Character,net.lenni0451.mcstructs.core.TextFormatting> formattingResolver)
ATextComponent.formattingResolver should return a formatting for the given char or null if the previous formatting should be kept.bold, italic, etc. will be reset.s - The string to parsecolorChar - The color char to use (e.g. TextFormatting.COLOR_CHAR)formattingResolver - The function that resolves the formatting for the given char