Class AbstractComponentRenderer<C>

  • Type Parameters:
    C - the context type
    All Implemented Interfaces:
    ComponentRenderer<C>
    Direct Known Subclasses:
    TranslatableComponentRenderer

    public abstract class AbstractComponentRenderer<C>
    extends java.lang.Object
    implements ComponentRenderer<C>
    An abstract implementation of a component renderer.
    Since:
    4.0.0
    • Constructor Detail

      • AbstractComponentRenderer

        public AbstractComponentRenderer()
    • Method Detail

      • render

        @NotNull
        public @NotNull Component render​(@NotNull
                                         @NotNull Component component,
                                         @NotNull
                                         C context)
        Description copied from interface: ComponentRenderer
        Renders a component.
        Specified by:
        render in interface ComponentRenderer<C>
        Parameters:
        component - the component
        context - the context
        Returns:
        the rendered component
      • renderBlockNbt

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

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

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

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

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

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

        @NotNull
        protected abstract @NotNull Component renderText​(@NotNull
                                                         @NotNull TextComponent component,
                                                         @NotNull
                                                         C context)
        Renders a text component.
        Parameters:
        component - the component
        context - the context
        Returns:
        the rendered component
      • renderTranslatable

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