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.

Note: new renderX methods without default implementations may be added at any time with the addition of new component types into Minecraft.

Since:
4.0.0
  • Constructor Details

    • AbstractComponentRenderer

      public AbstractComponentRenderer()
      Constructs a new abstract component renderer.
      Since:
      4.0.0
  • Method Details

    • render

      public Component render(Component component, C context)
      Renders a component.

      This method exists to delegate calls to the protected render(Component, Object, boolean) method with skipVirtual set to false.

      Specified by:
      render in interface ComponentRenderer<C>
      Parameters:
      component - the component
      context - the context
      Returns:
      the rendered component
      Since:
      4.0.0
    • render

      protected final Component render(Component component, C context, boolean skipVirtual)
      Renders a component.
      Parameters:
      component - the component
      context - the context
      skipVirtual - if virtual components should be rendered as normal text components
      Returns:
      the rendered component
      Since:
      4.0.0
    • renderObject

      protected abstract Component renderObject(ObjectComponent component, C context)
      Renders an object component.
      Parameters:
      component - the component
      context - the context
      Returns:
      the rendered component
      Since:
      5.0.0
    • renderBlockNbt

      protected abstract Component renderBlockNbt(BlockNBTComponent component, C context)
      Renders a block NBT component.
      Parameters:
      component - the component
      context - the context
      Returns:
      the rendered component
      Since:
      4.0.0
    • renderEntityNbt

      protected abstract Component renderEntityNbt(EntityNBTComponent component, C context)
      Renders an entity NBT component.
      Parameters:
      component - the component
      context - the context
      Returns:
      the rendered component
      Since:
      4.0.0
    • renderStorageNbt

      protected abstract Component renderStorageNbt(StorageNBTComponent component, C context)
      Renders a storage NBT component.
      Parameters:
      component - the component
      context - the context
      Returns:
      the rendered component
      Since:
      4.0.0
    • renderKeybind

      protected abstract Component renderKeybind(KeybindComponent component, C context)
      Renders a keybind component.
      Parameters:
      component - the component
      context - the context
      Returns:
      the rendered component
      Since:
      4.0.0
    • renderScore

      protected abstract Component renderScore(ScoreComponent component, C context)
      Renders a score component.
      Parameters:
      component - the component
      context - the context
      Returns:
      the rendered component
      Since:
      4.0.0
    • renderSelector

      protected abstract Component renderSelector(SelectorComponent component, C context)
      Renders a selector component.
      Parameters:
      component - the component
      context - the context
      Returns:
      the rendered component
      Since:
      4.0.0
    • renderText

      protected abstract Component renderText(TextComponent component, C context)
      Renders a text component.
      Parameters:
      component - the component
      context - the context
      Returns:
      the rendered component
      Since:
      4.0.0
    • renderVirtual

      protected Component renderVirtual(VirtualComponent component, C context)
      Renders a virtual component.
      Parameters:
      component - the component
      context - the context
      Returns:
      the rendered component
      Since:
      4.18.0
    • renderTranslatable

      protected abstract Component renderTranslatable(TranslatableComponent component, C context)
      Renders a translatable component.
      Parameters:
      component - the component
      context - the context
      Returns:
      the rendered component
      Since:
      4.0.0