Class AbstractComponentRenderer<C>
java.lang.Object
net.kyori.adventure.text.renderer.AbstractComponentRenderer<C>
- Type Parameters:
C
- the context type
- All Implemented Interfaces:
ComponentRenderer<C>
- Direct Known Subclasses:
TranslatableComponentRenderer
public abstract class AbstractComponentRenderer<C> extends Object implements ComponentRenderer<C>
An abstract implementation of a component renderer.
- Since:
- 4.0.0
-
Constructor Summary
Constructors Constructor Description AbstractComponentRenderer()
-
Method Summary
Modifier and Type Method Description @NonNull Component
render(@NonNull Component component, @NonNull C context)
Renders a component.protected abstract @NonNull Component
renderBlockNbt(@NonNull BlockNBTComponent component, @NonNull C context)
Renders a block NBT component.protected abstract @NonNull Component
renderEntityNbt(@NonNull EntityNBTComponent component, @NonNull C context)
Renders an entity NBT component.protected abstract @NonNull Component
renderKeybind(@NonNull KeybindComponent component, @NonNull C context)
Renders a keybind component.protected abstract @NonNull Component
renderScore(@NonNull ScoreComponent component, @NonNull C context)
Renders a score component.protected abstract @NonNull Component
renderSelector(@NonNull SelectorComponent component, @NonNull C context)
Renders a selector component.protected abstract @NonNull Component
renderStorageNbt(@NonNull StorageNBTComponent component, @NonNull C context)
Renders a storage NBT component.protected abstract @NonNull Component
renderText(@NonNull TextComponent component, @NonNull C context)
Renders a text component.protected abstract @NonNull Component
renderTranslatable(@NonNull TranslatableComponent component, @NonNull C context)
Renders a translatable component.
-
Constructor Details
-
AbstractComponentRenderer
public AbstractComponentRenderer()
-
-
Method Details
-
render
Description copied from interface:ComponentRenderer
Renders a component.- Specified by:
render
in interfaceComponentRenderer<C>
- Parameters:
component
- the componentcontext
- the context- Returns:
- the rendered component
-
renderBlockNbt
protected abstract @NonNull Component renderBlockNbt(@NonNull BlockNBTComponent component, @NonNull C context)Renders a block NBT component.- Parameters:
component
- the componentcontext
- the context- Returns:
- the rendered component
-
renderEntityNbt
protected abstract @NonNull Component renderEntityNbt(@NonNull EntityNBTComponent component, @NonNull C context)Renders an entity NBT component.- Parameters:
component
- the componentcontext
- the context- Returns:
- the rendered component
-
renderStorageNbt
protected abstract @NonNull Component renderStorageNbt(@NonNull StorageNBTComponent component, @NonNull C context)Renders a storage NBT component.- Parameters:
component
- the componentcontext
- the context- Returns:
- the rendered component
-
renderKeybind
protected abstract @NonNull Component renderKeybind(@NonNull KeybindComponent component, @NonNull C context)Renders a keybind component.- Parameters:
component
- the componentcontext
- the context- Returns:
- the rendered component
-
renderScore
protected abstract @NonNull Component renderScore(@NonNull ScoreComponent component, @NonNull C context)Renders a score component.- Parameters:
component
- the componentcontext
- the context- Returns:
- the rendered component
-
renderSelector
protected abstract @NonNull Component renderSelector(@NonNull SelectorComponent component, @NonNull C context)Renders a selector component.- Parameters:
component
- the componentcontext
- the context- Returns:
- the rendered component
-
renderText
protected abstract @NonNull Component renderText(@NonNull TextComponent component, @NonNull C context)Renders a text component.- Parameters:
component
- the componentcontext
- the context- Returns:
- the rendered component
-
renderTranslatable
protected abstract @NonNull Component renderTranslatable(@NonNull TranslatableComponent component, @NonNull C context)Renders a translatable component.- Parameters:
component
- the componentcontext
- the context- Returns:
- the rendered component
-