Class ComponentUtils
java.lang.Object
net.minecraft.network.chat.ComponentUtils
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic MutableComponentcopyOnClickText(String text) static <T extends Comparable<T>>
ComponentformatAndSortList(Collection<T> values, Function<T, Component> formatter) static ComponentformatList(Collection<? extends Component> values, Component separator) static <T> ComponentformatList(Collection<? extends T> values, Function<T, Component> formatter) static <T> MutableComponentformatList(Collection<? extends T> values, Optional<? extends Component> separator, Function<T, Component> formatter) static <T> MutableComponentformatList(Collection<? extends T> values, Component separator, Function<T, Component> formatter) static ComponentformatList(Collection<String> values) static ComponentfromMessage(Message message) static booleanisTranslationResolvable(@Nullable Component component) static ComponentmergeStyles(Component component, Style style) static MutableComponentmergeStyles(MutableComponent component, Style style) static Optional<MutableComponent> resolve(ResolutionContext context, Optional<Component> component, int recursionDepth) static MutableComponentresolve(ResolutionContext context, Component component) static MutableComponentresolve(ResolutionContext context, Component component, int recursionDepth) private static StyleresolveStyle(ResolutionContext context, Style style, int recursionDepth) static MutableComponentwrapInSquareBrackets(Component inner)
-
Field Details
-
DEFAULT_SEPARATOR_TEXT
- See Also:
-
DEFAULT_SEPARATOR
-
DEFAULT_NO_STYLE_SEPARATOR
-
-
Constructor Details
-
ComponentUtils
public ComponentUtils()
-
-
Method Details
-
mergeStyles
@CheckReturnValue public static MutableComponent mergeStyles(MutableComponent component, Style style) -
mergeStyles
-
resolve
public static Optional<MutableComponent> resolve(ResolutionContext context, Optional<Component> component, int recursionDepth) throws CommandSyntaxException - Throws:
CommandSyntaxException
-
resolve
public static MutableComponent resolve(ResolutionContext context, Component component) throws CommandSyntaxException - Throws:
CommandSyntaxException
-
resolve
public static MutableComponent resolve(ResolutionContext context, Component component, int recursionDepth) throws CommandSyntaxException - Throws:
CommandSyntaxException
-
resolveStyle
private static Style resolveStyle(ResolutionContext context, Style style, int recursionDepth) throws CommandSyntaxException - Throws:
CommandSyntaxException
-
formatList
-
formatAndSortList
public static <T extends Comparable<T>> Component formatAndSortList(Collection<T> values, Function<T, Component> formatter) -
formatList
public static <T> Component formatList(Collection<? extends T> values, Function<T, Component> formatter) -
formatList
public static <T> MutableComponent formatList(Collection<? extends T> values, Optional<? extends Component> separator, Function<T, Component> formatter) -
formatList
-
formatList
public static <T> MutableComponent formatList(Collection<? extends T> values, Component separator, Function<T, Component> formatter) -
wrapInSquareBrackets
-
fromMessage
-
isTranslationResolvable
-
copyOnClickText
-