Package net.kyori.adventure.text
Interface ScopedComponent<C extends Component>
-
- Type Parameters:
C
- the component type
- All Superinterfaces:
Component
,ComponentBuilderApplicable
,ComponentLike
,net.kyori.examination.Examinable
,HoverEventSource<Component>
- All Known Subinterfaces:
BlockNBTComponent
,EntityNBTComponent
,KeybindComponent
,ScoreComponent
,SelectorComponent
,StorageNBTComponent
,TextComponent
,TranslatableComponent
public interface ScopedComponent<C extends Component> extends Component
Some magic to change return types.- Since:
- 4.0.0
-
-
Method Summary
All Methods Instance Methods Abstract Methods Default Methods Modifier and Type Method Description default @NonNull C
append(@NonNull Component component)
Appends a component to this component.default @NonNull C
append(@NonNull ComponentBuilder<?,?> builder)
Appends a component to this component.default @NonNull C
append(@NonNull ComponentLike component)
Appends a component to this component.@NonNull C
children(@NonNull List<? extends ComponentLike> children)
Sets the list of children.default @NonNull C
clickEvent(@Nullable ClickEvent event)
Sets the click event of this component.default @NonNull C
color(@Nullable TextColor color)
Sets the color of this component.default @NonNull C
colorIfAbsent(@Nullable TextColor color)
Sets the color if there isn't one set already.default @NonNull Component
decorate(@NonNull TextDecoration decoration)
Sets the state ofdecoration
toTextDecoration.State.TRUE
on this component.default @NonNull C
decoration(@NonNull TextDecoration decoration, boolean flag)
Sets the state of a decoration on this component.default @NonNull C
decoration(@NonNull TextDecoration decoration, @NonNull TextDecoration.State state)
Sets the value of a decoration on this component.default @NonNull C
hoverEvent(@Nullable HoverEventSource<?> event)
Sets the hover event of this component.default @NonNull C
insertion(@Nullable String insertion)
Sets the string to be inserted when this component is shift-clicked.default @NonNull C
mergeStyle(@NonNull Component that)
Merges from another style into this component's style.default @NonNull C
mergeStyle(@NonNull Component that, @NonNull Set<Style.Merge> merges)
Merges from another style into this component's style.default @NonNull C
mergeStyle(@NonNull Component that, @NonNull Style.Merge @NonNull ... merges)
Merges from another style into this component's style.default @NonNull C
style(@NonNull Consumer<Style.Builder> style)
Sets the style of this component.@NonNull C
style(@NonNull Style style)
Sets the style of this component.default @NonNull C
style(@NonNull Style.Builder style)
Sets the style of this component.-
Methods inherited from interface net.kyori.adventure.text.Component
asComponent, asHoverEvent, children, clickEvent, color, componentBuilderApply, contains, decoration, decorations, decorations, detectCycle, hasDecoration, hasStyling, hoverEvent, insertion, replaceFirstText, replaceFirstText, replaceText, replaceText, replaceText, replaceText, replaceText, replaceText, replaceText, replaceText, style, style
-
Methods inherited from interface net.kyori.examination.Examinable
examinableName, examinableProperties, examine
-
Methods inherited from interface net.kyori.adventure.text.event.HoverEventSource
asHoverEvent
-
-
-
-
Method Detail
-
children
@NonNull C children(@NonNull List<? extends ComponentLike> children)
Description copied from interface:Component
Sets the list of children.The contents of
children
will be copied.
-
style
@NonNull C style(@NonNull Style style)
Description copied from interface:Component
Sets the style of this component.
-
style
default @NonNull C style(@NonNull Consumer<Style.Builder> style)
Description copied from interface:Component
Sets the style of this component.
-
style
default @NonNull C style(@NonNull Style.Builder style)
Description copied from interface:Component
Sets the style of this component.
-
mergeStyle
default @NonNull C mergeStyle(@NonNull Component that)
Description copied from interface:Component
Merges from another style into this component's style.- Specified by:
mergeStyle
in interfaceComponent
- Parameters:
that
- the other style- Returns:
- a component
-
mergeStyle
default @NonNull C mergeStyle(@NonNull Component that, @NonNull Style.Merge @NonNull ... merges)
Description copied from interface:Component
Merges from another style into this component's style.- Specified by:
mergeStyle
in interfaceComponent
- Parameters:
that
- the other stylemerges
- the style parts to merge- Returns:
- a component
-
append
default @NonNull C append(@NonNull Component component)
Description copied from interface:Component
Appends a component to this component.
-
append
default @NonNull C append(@NonNull ComponentLike component)
Description copied from interface:Component
Appends a component to this component.
-
append
default @NonNull C append(@NonNull ComponentBuilder<?,?> builder)
Description copied from interface:Component
Appends a component to this component.
-
mergeStyle
default @NonNull C mergeStyle(@NonNull Component that, @NonNull Set<Style.Merge> merges)
Description copied from interface:Component
Merges from another style into this component's style.- Specified by:
mergeStyle
in interfaceComponent
- Parameters:
that
- the other stylemerges
- the style parts to merge- Returns:
- a component
-
color
default @NonNull C color(@Nullable TextColor color)
Description copied from interface:Component
Sets the color of this component.
-
colorIfAbsent
default @NonNull C colorIfAbsent(@Nullable TextColor color)
Description copied from interface:Component
Sets the color if there isn't one set already.- Specified by:
colorIfAbsent
in interfaceComponent
- Parameters:
color
- the color- Returns:
- a component
-
decorate
default @NonNull Component decorate(@NonNull TextDecoration decoration)
Description copied from interface:Component
Sets the state ofdecoration
toTextDecoration.State.TRUE
on this component.
-
decoration
default @NonNull C decoration(@NonNull TextDecoration decoration, boolean flag)
Description copied from interface:Component
Sets the state of a decoration on this component.- Specified by:
decoration
in interfaceComponent
- Parameters:
decoration
- the decorationflag
-true
if this component should have the decoration,false
if this component should not have the decoration- Returns:
- a component
-
decoration
default @NonNull C decoration(@NonNull TextDecoration decoration, @NonNull TextDecoration.State state)
Description copied from interface:Component
Sets the value of a decoration on this component.- Specified by:
decoration
in interfaceComponent
- 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:
- a component
-
clickEvent
default @NonNull C clickEvent(@Nullable ClickEvent event)
Description copied from interface:Component
Sets the click event of this component.- Specified by:
clickEvent
in interfaceComponent
- Parameters:
event
- the click event- Returns:
- a component
-
hoverEvent
default @NonNull C hoverEvent(@Nullable HoverEventSource<?> event)
Description copied from interface:Component
Sets the hover event of this component.- Specified by:
hoverEvent
in interfaceComponent
- Parameters:
event
- the hover event source- Returns:
- a component
-
-