Package net.minecraft.network.chat
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> elements, Function<T, Component> componentExtractor) static ComponentformatList(Collection<? extends Component> elements, Component separator) static <T> ComponentformatList(Collection<? extends T> elements, Function<T, Component> componentExtractor) static <T> MutableComponentformatList(Collection<? extends T> elements, Optional<? extends Component> optionalSeparator, Function<T, Component> componentExtractor) static <T> MutableComponentformatList(Collection<? extends T> elements, Component separator, Function<T, Component> componentExtractor) static ComponentformatList(Collection<String> elements) static ComponentfromMessage(com.mojang.brigadier.Message message) static booleanisTranslationResolvable(Component component) static MutableComponentmergeStyles(MutableComponent component, Style p_style) Merge the component's styles with the given Style.private static StyleresolveStyle(CommandSourceStack commandSourceStack, Style style, Entity entity, int recursionDepth) static Optional<MutableComponent> updateForEntity(CommandSourceStack commandSourceStack, Optional<Component> optionalComponent, Entity entity, int recursionDepth) static MutableComponentupdateForEntity(CommandSourceStack commandSourceStack, Component p_component, Entity entity, int recursionDepth) static MutableComponentwrapInSquareBrackets(Component toWrap) Wraps the text with square brackets.
-
Field Details
-
DEFAULT_SEPARATOR_TEXT
- See Also:
-
DEFAULT_SEPARATOR
-
DEFAULT_NO_STYLE_SEPARATOR
-
-
Constructor Details
-
ComponentUtils
public ComponentUtils()
-
-
Method Details
-
mergeStyles
Merge the component's styles with the given Style. -
updateForEntity
public static Optional<MutableComponent> updateForEntity(@Nullable CommandSourceStack commandSourceStack, Optional<Component> optionalComponent, @Nullable Entity entity, int recursionDepth) throws com.mojang.brigadier.exceptions.CommandSyntaxException - Throws:
com.mojang.brigadier.exceptions.CommandSyntaxException
-
updateForEntity
public static MutableComponent updateForEntity(@Nullable CommandSourceStack commandSourceStack, Component p_component, @Nullable Entity entity, int recursionDepth) throws com.mojang.brigadier.exceptions.CommandSyntaxException - Throws:
com.mojang.brigadier.exceptions.CommandSyntaxException
-
resolveStyle
private static Style resolveStyle(@Nullable CommandSourceStack commandSourceStack, Style style, @Nullable Entity entity, int recursionDepth) throws com.mojang.brigadier.exceptions.CommandSyntaxException - Throws:
com.mojang.brigadier.exceptions.CommandSyntaxException
-
formatList
-
formatAndSortList
public static <T extends Comparable<T>> Component formatAndSortList(Collection<T> elements, Function<T, Component> componentExtractor) -
formatList
public static <T> Component formatList(Collection<? extends T> elements, Function<T, Component> componentExtractor) -
formatList
public static <T> MutableComponent formatList(Collection<? extends T> elements, Optional<? extends Component> optionalSeparator, Function<T, Component> componentExtractor) -
formatList
-
formatList
public static <T> MutableComponent formatList(Collection<? extends T> elements, Component separator, Function<T, Component> componentExtractor) -
wrapInSquareBrackets
Wraps the text with square brackets. -
fromMessage
-
isTranslationResolvable
-
copyOnClickText
-