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) final 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) Returns 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.getEndingIndex
(String text, int maxWidth, Style style) int
TextHandler.getLimitedStringLength
(String text, int maxWidth, 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.limitString
(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.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> lineConsumer) TextHandler.wrapLines
(StringVisitable text, int maxWidth, Style style, StringVisitable wrappedLinePrefix) -
Uses of Style in net.minecraft.client.gui.hud
-
Uses of Style in net.minecraft.client.gui.screen
Modifier and TypeFieldDescriptionprivate static final Style
ChatInputSuggestor.ERROR_STYLE
private static final Style
ChatInputSuggestor.INFO_STYLE
Modifier and TypeMethodDescriptionDeathScreen.getTextComponentUnderMouse
(int mouseX) ChatScreen.getTextStyleAt
(double x, double y) 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.network.message
Modifier and TypeMethodDescriptionprivate static boolean
MessageTrustStatus.isNotInDefaultFont
(Style style) -
Uses of Style in net.minecraft.item
-
Uses of Style in net.minecraft.network.message
-
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 final Style
Style.EMPTY
An empty style.private final Style
Decoration.style
The field for thestyle
record component.private Style
MutableText.style
Modifier and TypeFieldDescriptionstatic final com.mojang.serialization.Codec<Style>
Style.CODEC
TextReorderingProcessor.styles
Modifier and TypeMethodDescriptionStyle.Serializer.deserialize
(JsonElement jsonElement, Type type, JsonDeserializationContext jsonDeserializationContext) MutableText.getStyle()
Returns the style of this text.Text.getStyle()
Returns the style of this text.private static Style
Style.of
(Optional<TextColor> color, Optional<Boolean> bold, Optional<Boolean> italic, Optional<Boolean> underlined, Optional<Boolean> strikethrough, Optional<Boolean> obfuscated, Optional<String> insertion, Optional<Identifier> font) private static Style
Texts.parseStyle
(@Nullable ServerCommandSource source, Style style, @Nullable Entity sender, int depth) Decoration.style()
Returns the value of thestyle
record component.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.withObfuscated
(@Nullable Boolean obfuscated) 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) 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.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>
KeybindTextContent.visit
(StringVisitable.StyledVisitor<T> visitor, Style style) Visits this content.<T> Optional<T>
LiteralTextContent.visit
(StringVisitable.StyledVisitor<T> visitor, Style style) Visits this content.<T> Optional<T>
SelectorTextContent.visit
(StringVisitable.StyledVisitor<T> visitor, Style style) Visits this content.<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.default <T> Optional<T>
TextContent.visit
(StringVisitable.StyledVisitor<T> visitor, Style style) Visits this content.<T> Optional<T>
TranslatableTextContent.visit
(StringVisitable.StyledVisitor<T> visitor, Style style) Visits this content.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) Style.withParent
(Style parent) Returns a new style with the undefined attributes of this style filled by theparent
style.Modifier and TypeMethodDescriptionMutableText.styled
(UnaryOperator<Style> styleUpdater) Updates the style of this text.ModifierConstructorDescriptionDecoration
(String string, List<Decoration.Parameter> list, Style style) (package private)
MutableText
(TextContent content, List<Text> siblings, Style style) ModifierConstructorDescriptionprivate
TextReorderingProcessor
(String string, List<Style> styles, Int2IntFunction reverser)