Package net.kyori.adventure.text.format
Interface Style.Builder
- All Superinterfaces:
Buildable.Builder<Style>
- Enclosing interface:
- Style
public static interface Style.Builder extends Buildable.Builder<Style>
A style builder.
- Since:
- 4.0.0
-
Method Summary
Modifier and Type Method Description default @NonNull Style.Builder
apply(@NonNull StyleBuilderApplicable applicable)
Appliesapplicable
to this builder.@NonNull Style
build()
Builds the style.@NonNull Style.Builder
clickEvent(@Nullable ClickEvent event)
Sets the click event.@NonNull Style.Builder
color(@Nullable TextColor color)
Sets the color.@NonNull Style.Builder
colorIfAbsent(@Nullable TextColor color)
Sets the color if there isn't one set already.default @NonNull Style.Builder
decorate(@NonNull TextDecoration decoration)
Setsdecoration
toTextDecoration.State.TRUE
.default @NonNull Style.Builder
decorate(@NonNull TextDecoration @NonNull ... decorations)
Setsdecorations
toTextDecoration.State.TRUE
.default @NonNull Style.Builder
decoration(@NonNull TextDecoration decoration, boolean flag)
Sets the state of a decoration on this style.@NonNull Style.Builder
decoration(@NonNull TextDecoration decoration, @NonNull TextDecoration.State state)
Sets the value of a decoration.@NonNull Style.Builder
font(@Nullable net.kyori.adventure.key.Key font)
Sets the font.@NonNull Style.Builder
hoverEvent(@Nullable HoverEventSource<?> source)
Sets the hover event.@NonNull Style.Builder
insertion(@Nullable String insertion)
Sets the string to be inserted.default @NonNull Style.Builder
merge(@NonNull Style that)
Merges from another style into this style.default @NonNull Style.Builder
merge(@NonNull Style that, @NonNull Set<Style.Merge> merges)
Merges from another style into this style.default @NonNull Style.Builder
merge(@NonNull Style that, @NonNull Style.Merge.Strategy strategy)
Merges from another style into this style.@NonNull Style.Builder
merge(@NonNull Style that, @NonNull Style.Merge.Strategy strategy, @NonNull Set<Style.Merge> merges)
Merges from another style into this style.default @NonNull Style.Builder
merge(@NonNull Style that, @NonNull Style.Merge.Strategy strategy, @NonNull Style.Merge @NonNull ... merges)
Merges from another style into this style.default @NonNull Style.Builder
merge(@NonNull Style that, @NonNull Style.Merge @NonNull ... merges)
Merges from another style into this style.
-
Method Details
-
font
Sets the font.- Parameters:
font
- the font- Returns:
- this builder
- Since:
- 4.0.0
- Since Minecraft:
- 1.16
-
color
Sets the color.- Parameters:
color
- the color- Returns:
- this builder
- Since:
- 4.0.0
-
colorIfAbsent
Sets the color if there isn't one set already.- Parameters:
color
- the color- Returns:
- this builder
- Since:
- 4.0.0
-
decorate
Setsdecoration
toTextDecoration.State.TRUE
.- Parameters:
decoration
- the decoration- Returns:
- a style
- Since:
- 4.0.0
-
decorate
@Contract("_ -> this") default @NonNull Style.Builder decorate(@NonNull TextDecoration @NonNull ... decorations)Setsdecorations
toTextDecoration.State.TRUE
.- Parameters:
decorations
- the decorations- Returns:
- a style
- Since:
- 4.0.0
-
decoration
@Contract("_, _ -> this") default @NonNull Style.Builder decoration(@NonNull TextDecoration decoration, boolean flag)Sets the state of a decoration on this style.- Parameters:
decoration
- the decorationflag
-true
if this style should have the decoration,false
if this style should not have the decoration- Returns:
- a style
- Since:
- 4.0.0
-
decoration
@Contract("_, _ -> this") @NonNull Style.Builder decoration(@NonNull TextDecoration decoration, @NonNull TextDecoration.State state)Sets the value of a decoration.- Parameters:
decoration
- the decorationstate
-TextDecoration.State.TRUE
if this component should have the decoration,TextDecoration.State.FALSE
if this component should not have the decoration, andTextDecoration.State.NOT_SET
if the decoration should not have a set value- Returns:
- this builder
- Since:
- 4.0.0
-
clickEvent
Sets the click event.- Parameters:
event
- the click event- Returns:
- this builder
- Since:
- 4.0.0
-
hoverEvent
Sets the hover event.- Parameters:
source
- the hover event source- Returns:
- this builder
- Since:
- 4.0.0
-
insertion
Sets the string to be inserted.- Parameters:
insertion
- the insertion string- Returns:
- this builder
- Since:
- 4.0.0
-
merge
Merges from another style into this style.- Parameters:
that
- the other style- Returns:
- this builder
- Since:
- 4.0.0
-
merge
@Contract("_, _ -> this") default @NonNull Style.Builder merge(@NonNull Style that, @NonNull Style.Merge.Strategy strategy)Merges from another style into this style.- Parameters:
that
- the other stylestrategy
- the merge strategy- Returns:
- this builder
- Since:
- 4.0.0
-
merge
@Contract("_, _ -> this") default @NonNull Style.Builder merge(@NonNull Style that, @NonNull Style.Merge @NonNull ... merges)Merges from another style into this style.- Parameters:
that
- the other stylemerges
- the parts to merge- Returns:
- this builder
- Since:
- 4.0.0
-
merge
@Contract("_, _, _ -> this") default @NonNull Style.Builder merge(@NonNull Style that, @NonNull Style.Merge.Strategy strategy, @NonNull Style.Merge @NonNull ... merges)Merges from another style into this style.- Parameters:
that
- the other stylestrategy
- the merge strategymerges
- the parts to merge- Returns:
- this builder
- Since:
- 4.0.0
-
merge
@Contract("_, _ -> this") default @NonNull Style.Builder merge(@NonNull Style that, @NonNull Set<Style.Merge> merges)Merges from another style into this style.- Parameters:
that
- the other stylemerges
- the parts to merge- Returns:
- this builder
- Since:
- 4.0.0
-
merge
@Contract("_, _, _ -> this") @NonNull Style.Builder merge(@NonNull Style that, @NonNull Style.Merge.Strategy strategy, @NonNull Set<Style.Merge> merges)Merges from another style into this style.- Parameters:
that
- the other stylestrategy
- the merge strategymerges
- the parts to merge- Returns:
- this builder
- Since:
- 4.0.0
-
apply
@Contract("_ -> this") default @NonNull Style.Builder apply(@NonNull StyleBuilderApplicable applicable)Appliesapplicable
to this builder.- Parameters:
applicable
- the applicable- Returns:
- this builder
- Since:
- 4.0.0
-
build
@NonNull Style build()Builds the style.- Specified by:
build
in interfaceBuildable.Builder<Style>
- Returns:
- the style
-