Interface ScopedComponent<C extends Component>
- Type Parameters:
C- the component type
- All Superinterfaces:
Component, ComponentBuilderApplicable, ComponentLike, HoverEventSource<Component>, StyleGetter, StyleSetter<Component>
- All Known Subinterfaces:
BlockNBTComponent, EntityNBTComponent, KeybindComponent, ObjectComponent, ScoreComponent, SelectorComponent, StorageNBTComponent, TextComponent, TranslatableComponent, VirtualComponent
public sealed interface ScopedComponent<C extends Component>
extends Component
permits BlockNBTComponent, EntityNBTComponent, KeybindComponent, ObjectComponent, ScoreComponent, SelectorComponent, StorageNBTComponent, TextComponent, TranslatableComponent
Some magic to change return types.
- Since:
- 4.0.0
-
Field Summary
Fields inherited from interface Component
EQUALS, EQUALS_IDENTITY, IS_NOT_EMPTY -
Method Summary
Modifier and TypeMethodDescriptiondefault Cappend(List<? extends ComponentLike> components) Appends a list of components to this component.default CAppends a component to this component.default Cappend(ComponentBuilder<?, ?> builder) Appends a component to this component.default Cappend(ComponentLike like) Appends a component to this component.default Cappend(ComponentLike... components) Appends components to this component.default CAppends a newline to this component.default CAppends a space to this component.default CapplyFallbackStyle(Style style) Apply a fallback style for this component and its children.default CapplyFallbackStyle(StyleBuilderApplicable... style) Apply a fallback style for this component and its children.default CGets aComponentrepresentation.children(List<? extends ComponentLike> children) Sets the list of children.default CclickEvent(@Nullable ClickEvent<?> event) Sets the click event of this component.default CSets the color of this component.default CcolorIfAbsent(@Nullable TextColor color) Sets the color if there isn't one set already.default Cdecorate(TextDecoration decoration) Sets the state ofdecorationtoTextDecoration.State.TRUEon this component.default Cdecoration(TextDecoration decoration, boolean flag) Sets the state of a decoration on this component.default Cdecoration(TextDecoration decoration, TextDecoration.State state) Sets the value of a decoration on this component.default CdecorationIfAbsent(TextDecoration decoration, TextDecoration.State state) Sets the state of a decoration on this component tostateif the current state of the decoration isTextDecoration.State.NOT_SET.default Cdecorations(Map<TextDecoration, TextDecoration.State> decorations) Sets decorations for this component's style using the specifieddecorationsmap.default CSets the font.default ChoverEvent(@Nullable HoverEventSource<?> event) Sets the hover event of this component.default CSets the string to be inserted when this component is shift-clicked.default CmergeStyle(Component that) Merges from another style into this component's style.default CmergeStyle(Component that, Set<Style.Merge> merges) Merges from another style into this component's style.default CmergeStyle(Component that, Style.Merge... merges) Merges from another style into this component's style.default CshadowColor(@Nullable ARGBLike argb) Sets the shadow color of this component.default CshadowColorIfAbsent(@Nullable ARGBLike argb) Sets the shadow color if there isn't one set already.default Cstyle(Consumer<Style.Builder> style) Sets the style of this component.default Cstyle(Consumer<Style.Builder> consumer, Style.Merge.Strategy strategy) Sets the style of this component.Sets the style of this component.default Cstyle(Style.Builder style) Sets the style of this component.Returns a builder for this component.Methods inherited from interface Component
asHoverEvent, children, clickEvent, color, compact, compact, componentBuilderApply, contains, contains, decoration, decorations, font, hasDecoration, hasStyling, hoverEvent, insertion, iterable, iterable, iterator, iterator, replaceText, replaceText, shadowColor, spliterator, spliterator, styleMethods inherited from interface HoverEventSource
asHoverEventMethods inherited from interface StyleSetter
decorate, decorations
-
Method Details
-
asComponent
Description copied from interface:ComponentLikeGets aComponentrepresentation.- Specified by:
asComponentin interfaceComponent- Specified by:
asComponentin interfaceComponentLike- Returns:
- a component
-
children
-
style
-
style
-
style
Description copied from interface:ComponentSets the style of this component. -
style
Description copied from interface:ComponentSets the style of this component. -
mergeStyle
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
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
-
append
Description copied from interface:ComponentAppends a component to this component. -
append
Description copied from interface:ComponentAppends a component to this component. -
append
Description copied from interface:ComponentAppends a list of components to this component. -
append
Description copied from interface:ComponentAppends components to this component. -
appendNewline
Description copied from interface:ComponentAppends a newline to this component.- Specified by:
appendNewlinein interfaceComponent- Returns:
- a component with the newline added
-
appendSpace
Description copied from interface:ComponentAppends a space to this component.- Specified by:
appendSpacein interfaceComponent- Returns:
- a component with the space added
-
applyFallbackStyle
Description copied from interface:ComponentApply a fallback style for this component and its children.This method can be used to set the "default" style for a component, whilst still allowing children of the component to override the style.
- Specified by:
applyFallbackStylein interfaceComponent- Parameters:
style- style to be used as a fallback- Returns:
- the styled component
-
applyFallbackStyle
Description copied from interface:ComponentApply a fallback style for this component and its children.This method can be used to set the "default" style for a component, whilst still allowing children of the component to override the style.
- Specified by:
applyFallbackStylein interfaceComponent- Parameters:
style- style to be used as a fallback- Returns:
- the styled component
-
mergeStyle
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
-
colorIfAbsent
Description copied from interface:ComponentSets the color if there isn't one set already.- Specified by:
colorIfAbsentin interfaceComponent- Specified by:
colorIfAbsentin interfaceStyleSetter<C extends Component>- Parameters:
color- the color- Returns:
- a component
-
shadowColor
Description copied from interface:ComponentSets the shadow color of this component.- Specified by:
shadowColorin interfaceComponent- Specified by:
shadowColorin interfaceStyleSetter<C extends Component>- Parameters:
argb- the color- Returns:
- a component
-
shadowColorIfAbsent
Description copied from interface:ComponentSets the shadow color if there isn't one set already.- Specified by:
shadowColorIfAbsentin interfaceComponent- Specified by:
shadowColorIfAbsentin interfaceStyleSetter<C extends Component>- Parameters:
argb- the color- Returns:
- a component
-
decorate
Description copied from interface:ComponentSets the state ofdecorationtoTextDecoration.State.TRUEon this component. -
decoration
Description copied from interface:ComponentSets the state of a decoration on this component.- Specified by:
decorationin interfaceComponent- Specified by:
decorationin interfaceStyleSetter<C extends Component>- Parameters:
decoration- the decorationflag-trueif this component should have the decoration,falseif this component should not have the decoration- Returns:
- a component
-
decoration
Description copied from interface:ComponentSets the value of a decoration on this component.- Specified by:
decorationin interfaceComponent- Specified by:
decorationin interfaceStyleSetter<C extends Component>- 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
-
decorationIfAbsent
Description copied from interface:ComponentSets the state of a decoration on this component tostateif the current state of the decoration isTextDecoration.State.NOT_SET.- Specified by:
decorationIfAbsentin interfaceComponent- Specified by:
decorationIfAbsentin interfaceStyleSetter<C extends Component>- Parameters:
decoration- the decorationstate- the state- Returns:
- a component
-
decorations
Description copied from interface:ComponentSets decorations for this component's style using the specifieddecorationsmap.If a given decoration does not have a value explicitly set, the value of that particular decoration is not changed.
- Specified by:
decorationsin interfaceComponent- Specified by:
decorationsin interfaceStyleSetter<C extends Component>- Parameters:
decorations- a set of default values- Returns:
- a component
-
clickEvent
Description copied from interface:ComponentSets the click event of this component.- Specified by:
clickEventin interfaceComponent- Specified by:
clickEventin interfaceStyleSetter<C extends Component>- Parameters:
event- the click event- Returns:
- a component
-
hoverEvent
Description copied from interface:ComponentSets the hover event of this component.- Specified by:
hoverEventin interfaceComponent- Specified by:
hoverEventin interfaceStyleSetter<C extends Component>- Parameters:
event- the hover event source- Returns:
- a component
-
insertion
Description copied from interface:ComponentSets the string to be inserted when this component is shift-clicked. -
font
-
toBuilder
ComponentBuilder<C,?> toBuilder()Description copied from interface:ComponentReturns a builder for this component.
-