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
-
-
Field Summary
-
Fields inherited from interface net.kyori.adventure.text.Component
EQUALS, EQUALS_IDENTITY
-
-
Method Summary
All Methods Instance Methods Abstract Methods Default Methods Modifier and Type Method Description default Cappend(@NotNull Component component)Appends a component to this component.default Cappend(@NotNull ComponentBuilder<?,?> builder)Appends a component to this component.default Cappend(@NotNull ComponentLike component)Appends a component to this component.Cchildren(@NotNull List<? extends ComponentLike> children)Sets the list of children.default CclickEvent(@Nullable ClickEvent event)Sets the click event of this component.default Ccolor(@Nullable TextColor color)Sets the color of this component.default CcolorIfAbsent(@Nullable TextColor color)Sets the color if there isn't one set already.default @NotNull Componentdecorate(@NotNull TextDecoration decoration)Sets the state ofdecorationtoTextDecoration.State.TRUEon this component.default Cdecoration(@NotNull TextDecoration decoration, boolean flag)Sets the state of a decoration on this component.default Cdecoration(@NotNull TextDecoration decoration, @NotNull TextDecoration.State state)Sets the value of a decoration on this component.default ChoverEvent(@Nullable HoverEventSource<?> event)Sets the hover event of this component.default Cinsertion(@Nullable String insertion)Sets the string to be inserted when this component is shift-clicked.default CmergeStyle(@NotNull Component that)Merges from another style into this component's style.default CmergeStyle(@NotNull Component that, @NotNull Set<Style.Merge> merges)Merges from another style into this component's style.default CmergeStyle(@NotNull Component that, @NotNull Style.Merge @NotNull ... merges)Merges from another style into this component's style.default Cstyle(@NotNull Consumer<Style.Builder> style)Sets the style of this component.Cstyle(@NotNull Style style)Sets the style of this component.default Cstyle(@NotNull Style.Builder style)Sets the style of this component.-
Methods inherited from interface net.kyori.adventure.text.Component
asComponent, asHoverEvent, children, clickEvent, color, compact, componentBuilderApply, contains, contains, decoration, decorations, decorations, detectCycle, hasDecoration, hasStyling, hoverEvent, insertion, iterable, iterable, iterator, iterator, replaceFirstText, replaceFirstText, replaceText, replaceText, replaceText, replaceText, replaceText, replaceText, replaceText, replaceText, spliterator, spliterator, 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
@NotNull C children(@NotNull @NotNull List<? extends ComponentLike> children)
Description copied from interface:ComponentSets the list of children.The contents of
childrenwill be copied.
-
style
@NotNull C style(@NotNull @NotNull Style style)
Description copied from interface:ComponentSets the style of this component.
-
style
@NotNull default C style(@NotNull @NotNull Consumer<Style.Builder> style)
Description copied from interface:ComponentSets the style of this component.
-
style
@NotNull default C style(@NotNull Style.Builder style)
Description copied from interface:ComponentSets the style of this component.
-
mergeStyle
@NotNull default C mergeStyle(@NotNull @NotNull Component that)
Description copied from interface:ComponentMerges from another style into this component's style.- Specified by:
mergeStylein interfaceComponent- Parameters:
that- the other style- Returns:
- a component
-
mergeStyle
@NotNull default C mergeStyle(@NotNull @NotNull Component that, @NotNull Style.Merge @NotNull ... merges)
Description copied from interface:ComponentMerges from another style into this component's style.- Specified by:
mergeStylein interfaceComponent- Parameters:
that- the other stylemerges- the style parts to merge- Returns:
- a component
-
append
@NotNull default C append(@NotNull @NotNull Component component)
Description copied from interface:ComponentAppends a component to this component.
-
append
@NotNull default C append(@NotNull @NotNull ComponentLike component)
Description copied from interface:ComponentAppends a component to this component.
-
append
@NotNull default C append(@NotNull @NotNull ComponentBuilder<?,?> builder)
Description copied from interface:ComponentAppends a component to this component.
-
mergeStyle
@NotNull default C mergeStyle(@NotNull @NotNull Component that, @NotNull @NotNull Set<Style.Merge> merges)
Description copied from interface:ComponentMerges from another style into this component's style.- Specified by:
mergeStylein interfaceComponent- Parameters:
that- the other stylemerges- the style parts to merge- Returns:
- a component
-
color
@NotNull default C color(@Nullable @Nullable TextColor color)
Description copied from interface:ComponentSets the color of this component.
-
colorIfAbsent
@NotNull default C colorIfAbsent(@Nullable @Nullable TextColor color)
Description copied from interface:ComponentSets the color if there isn't one set already.- Specified by:
colorIfAbsentin interfaceComponent- Parameters:
color- the color- Returns:
- a component
-
decorate
@NotNull default @NotNull Component decorate(@NotNull @NotNull TextDecoration decoration)
Description copied from interface:ComponentSets the state ofdecorationtoTextDecoration.State.TRUEon this component.
-
decoration
@NotNull default C decoration(@NotNull @NotNull TextDecoration decoration, boolean flag)
Description copied from interface:ComponentSets the state of a decoration on this component.- Specified by:
decorationin interfaceComponent- Parameters:
decoration- the decorationflag-trueif this component should have the decoration,falseif this component should not have the decoration- Returns:
- a component
-
decoration
@NotNull default C decoration(@NotNull @NotNull TextDecoration decoration, @NotNull TextDecoration.State state)
Description copied from interface:ComponentSets the value of a decoration on this component.- Specified by:
decorationin interfaceComponent- Parameters:
decoration- the decorationstate-TextDecoration.State.TRUEif this component should have the decoration,TextDecoration.State.FALSEif this component should not have the decoration, andTextDecoration.State.NOT_SETif the decoration should not have a set value- Returns:
- a component
-
clickEvent
@NotNull default C clickEvent(@Nullable @Nullable ClickEvent event)
Description copied from interface:ComponentSets the click event of this component.- Specified by:
clickEventin interfaceComponent- Parameters:
event- the click event- Returns:
- a component
-
hoverEvent
@NotNull default C hoverEvent(@Nullable @Nullable HoverEventSource<?> event)
Description copied from interface:ComponentSets the hover event of this component.- Specified by:
hoverEventin interfaceComponent- Parameters:
event- the hover event source- Returns:
- a component
-
-