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 Componentrender(@NonNull Component component, @NonNull C context)Renders a component.protected abstract @NonNull ComponentrenderBlockNbt(@NonNull BlockNBTComponent component, @NonNull C context)Renders a block NBT component.protected abstract @NonNull ComponentrenderEntityNbt(@NonNull EntityNBTComponent component, @NonNull C context)Renders an entity NBT component.protected abstract @NonNull ComponentrenderKeybind(@NonNull KeybindComponent component, @NonNull C context)Renders a keybind component.protected abstract @NonNull ComponentrenderScore(@NonNull ScoreComponent component, @NonNull C context)Renders a score component.protected abstract @NonNull ComponentrenderSelector(@NonNull SelectorComponent component, @NonNull C context)Renders a selector component.protected abstract @NonNull ComponentrenderStorageNbt(@NonNull StorageNBTComponent component, @NonNull C context)Renders a storage NBT component.protected abstract @NonNull ComponentrenderText(@NonNull TextComponent component, @NonNull C context)Renders a text component.protected abstract @NonNull ComponentrenderTranslatable(@NonNull TranslatableComponent component, @NonNull C context)Renders a translatable component.
-
Constructor Details
-
AbstractComponentRenderer
public AbstractComponentRenderer()
-
-
Method Details
-
render
Description copied from interface:ComponentRendererRenders a component.- Specified by:
renderin 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
-