Interface ITextComponentFactory

All Known Implementing Classes:
ITextComponentFactory.SimpleTextComponentFactory, TextComponentFactorySpigot

public interface ITextComponentFactory
Represents a factory for TextComponents that can be used to create specialized text components with additional ITextDecorators.

The default implementations of the various methods create simple text components without adding anything special.

  • Method Details

    • newComponent

      @Nullable default @Nullable TextComponent newComponent(@Nullable @Nullable TextType type)
      Creates a new TextComponent for a given type.
      Parameters:
      type - The type of the text.
      Returns:
      A new component or null to apply no specific decoration to this component.
    • newClickableTextComponent

      @Nullable default @Nullable TextComponent newClickableTextComponent(@Nullable @Nullable TextType type, String command, @Nullable @Nullable String info)
      Creates a new TextComponent and attempts to add any required ITextDecorators to execute a command when the text is clicked.
      Parameters:
      type - The type of the text.
      command - The command to execute when this text is clicked.
      info - The optional information String explaining what clicking the text will do.
      Returns:
      A new component or null to apply no specific decoration to this component.
    • newClickableTextComponent

      @Nullable default @Nullable TextComponent newClickableTextComponent(@Nullable @Nullable TextType type, String command)
      Creates a new TextComponent and attempts to add any required ITextDecorators to execute a command when the text is clicked.
      Parameters:
      type - The type of the text.
      command - The command to execute when this text is clicked.
      Returns:
      A new component or null to apply no specific decoration to this component.