Uses of Class
net.minecraft.text.Style
Package
Description
-
Uses of Style in net.minecraft.client.font
Modifier and TypeFieldDescriptionprivate Style
TextHandler.LineBreakingVisitor.endStyle
private Style
TextHandler.LineBreakingVisitor.lastSpaceStyle
(package private) Style
TextHandler.StyledString.style
Modifier and TypeMethodDescriptionTextHandler.LineBreakingVisitor.getEndingStyle()
TextHandler.getStyleAt(OrderedText text, int x)
Gets the style at thex
position in a text.TextHandler.getStyleAt(StringVisitable text, int x)
Gets the style at thex
position in a text.Modifier and TypeMethodDescriptionboolean
Visits a single character.void
Accepts the information on a line-wrap segment.boolean
Visits a single character.boolean
Visits a single character.private boolean
TextHandler.LineWrappingCollector.collectLine(int lineLength, int skippedLength, Style style)
int
TextHandler.getTrimmedLength(String text, int maxWidth, Style style)
Returns the length of a string when it is trimmed to be at mostmaxWidth
wide.float
Returns the width of a character.TextHandler.method_35714(StringVisitable stringVisitable, int maxWidth, Style style, StringVisitable stringVisitable2)
int
TextHandler.method_35715(String text, int maxWidth, Style style)
TextHandler.method_35716(String text, int maxWidth, Style style)
int
TextHandler.method_35717(String text, int maxWidth, Style style)
TextHandler.trimToWidth(String text, int maxWidth, Style style)
Trim a string to be at mostmaxWidth
wide.TextHandler.trimToWidth(StringVisitable text, int width, Style style)
TextHandler.trimToWidthBackwards(String text, int maxWidth, Style style)
Trim a string from right to left to be at mostmaxWidth
wide.<T> Optional<T>
TextHandler.StyledString.visit(StringVisitable.StyledVisitor<T> styledVisitor, Style style)
Supplies this visitable's literal content and contextual style to the visitor.static boolean
TextVisitFactory.visitBackwards(String text, Style style, CharacterVisitor visitor)
Visits the code points of a string in backward (right to left) direction.static boolean
TextVisitFactory.visitFormatted(String text, int startIndex, Style style, CharacterVisitor visitor)
Visits the code points of a string, applying the formatting codes within.static boolean
TextVisitFactory.visitFormatted(String text, int startIndex, Style startingStyle, Style resetStyle, CharacterVisitor visitor)
Visits the code points of a string, applying the formatting codes within.static boolean
TextVisitFactory.visitFormatted(String text, Style style, CharacterVisitor visitor)
Visits the code points of a string, applying the formatting codes within.static boolean
TextVisitFactory.visitFormatted(StringVisitable text, Style style, CharacterVisitor visitor)
Visits the code points for every literal string and the formatting codes supplied by the renderable.static boolean
TextVisitFactory.visitForwards(String text, Style style, CharacterVisitor visitor)
Visits the code points of a string in forward (left to right) direction.private static boolean
TextVisitFactory.visitRegularCharacter(Style style, CharacterVisitor visitor, int index, char c)
void
TextHandler.wrapLines(String text, int maxWidth, Style style, boolean retainTrailingWordSplit, TextHandler.LineWrappingConsumer consumer)
TextHandler.wrapLines(StringVisitable text, int maxWidth, Style style)
void
TextHandler.wrapLines(StringVisitable text, int maxWidth, Style style, BiConsumer<StringVisitable,Boolean> biConsumer)
-
Uses of Style in net.minecraft.client.gui.hud
-
Uses of Style in net.minecraft.client.gui.screen
Modifier and TypeFieldDescriptionprivate static Style
CommandSuggestor.ERROR_FORMATTING
private static Style
CommandSuggestor.INFO_FORMATTING
Modifier and TypeMethodDescriptionboolean
Screen.handleTextClick(@Nullable Style style)
protected void
Screen.renderTextHoverEffect(MatrixStack matrices, @Nullable Style style, int x, int y)
-
Uses of Style in net.minecraft.client.gui.screen.ingame
-
Uses of Style in net.minecraft.client.resource.language
ModifierConstructorDescriptionprivate
TextReorderingProcessor(String string, List<Style> styles, Int2IntFunction reverser)
-
Uses of Style in net.minecraft.item
-
Uses of Style in net.minecraft.scoreboard
-
Uses of Style in net.minecraft.server.command
-
Uses of Style in net.minecraft.text
Modifier and TypeFieldDescriptionstatic Style
Style.EMPTY
An empty style.private Style
BaseText.style
Modifier and TypeMethodDescriptionStyle.Serializer.deserialize(JsonElement jsonElement, Type type, JsonDeserializationContext jsonDeserializationContext)
BaseText.getStyle()
Returns the style of this text.Text.getStyle()
Returns the style of this text.Style.obfuscated(@Nullable Boolean obfuscated)
private static Style
Texts.parseStyle(@Nullable ServerCommandSource source, Style style, @Nullable Entity sender, int depth)
Returns a new style with the bold attribute provided and all other attributes of this style.Style.withClickEvent(@Nullable ClickEvent clickEvent)
Returns a new style with the click event provided and all other attributes of this style.Style.withColor(int rgbColor)
Returns a new style with the color provided and all other attributes of this style.Style.withColor(@Nullable Formatting color)
Returns a new style with the color provided and all other attributes of this style.Style.withExclusiveFormatting(Formatting formatting)
Returns a new style with the formatting provided and some applicable attributes of this style.Style.withFont(@Nullable Identifier font)
Returns a new style with the font provided and all other attributes of this style.Style.withFormatting(Formatting formatting)
Returns a new style with the formatting provided and all other attributes of this style.Style.withFormatting(Formatting[] formattings)
Returns a new style with the formattings provided and all other attributes of this style.Style.withHoverEvent(@Nullable HoverEvent hoverEvent)
Returns a new style with the hover event provided and all other attributes of this style.Style.withInsertion(@Nullable String insertion)
Returns a new style with the insertion provided and all other attributes of this style.Style.withItalic(@Nullable Boolean italic)
Returns a new style with the italic attribute provided and all other attributes of this style.Style.withParent(Style parent)
Returns a new style with the undefined attributes of this style filled by theparent
style.Style.withStrikethrough(@Nullable Boolean strikethrough)
Style.withUnderline(@Nullable Boolean underline)
Returns a new style with the underline attribute provided and all other attributes of this style.Modifier and TypeMethodDescriptionboolean
Visits a single character.Visits a string's content with a contextual style.private void
Text.Serializer.addStyle(Style style, JsonObject json, JsonSerializationContext context)
default MutableText
Fills the absent parts of this text's style with definitions fromstyleOverride
.Text.getWithStyle(Style style)
private static Style
Texts.parseStyle(@Nullable ServerCommandSource source, Style style, @Nullable Entity sender, int depth)
Style.Serializer.serialize(Style style, Type type, JsonSerializationContext jsonSerializationContext)
Sets the style of this text.Sets the style of this text.static MutableText
Texts.setStyleIfAbsent(MutableText text, Style style)
static OrderedText
static StringVisitable
Creates a visitable from a plain string and a root style.static OrderedText
OrderedText.styledBackwardsVisitedString(String string, Style style)
static OrderedText
OrderedText.styledBackwardsVisitedString(String string, Style style, Int2IntFunction codePointMapper)
static OrderedText
OrderedText.styledForwardsVisitedString(String string, Style style)
static OrderedText
OrderedText.styledForwardsVisitedString(String string, Style style, Int2IntFunction codePointMapper)
<T> Optional<T>
StringVisitable.visit(StringVisitable.StyledVisitor<T> styledVisitor, Style style)
Supplies this visitable's literal content and contextual style to the visitor.default <T> Optional<T>
Text.visit(StringVisitable.StyledVisitor<T> styledVisitor, Style style)
Supplies this visitable's literal content and contextual style to the visitor.<T> Optional<T>
KeybindText.visitSelf(StringVisitable.StyledVisitor<T> visitor, Style style)
Visits the text itself.default <T> Optional<T>
Text.visitSelf(StringVisitable.StyledVisitor<T> visitor, Style style)
Visits the text itself.<T> Optional<T>
TranslatableText.visitSelf(StringVisitable.StyledVisitor<T> visitor, Style style)
Visits the text itself.Style.withParent(Style parent)
Returns a new style with the undefined attributes of this style filled by theparent
style.Modifier and TypeMethodDescriptiondefault MutableText
MutableText.styled(UnaryOperator<Style> styleUpdater)
Updates the style of this text.