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.
-
Nested Class Summary
Nested ClassesModifier and TypeInterfaceDescriptionstatic final classSimple implementation of the factory interface that only creates basic components. -
Method Summary
Modifier and TypeMethodDescriptiondefault @Nullable TextComponentnewClickableTextComponent(@Nullable TextType type, String command) Creates a newTextComponentand attempts to add any requiredITextDecorators to execute a command when the text is clicked.default @Nullable TextComponentnewClickableTextComponent(@Nullable TextType type, String command, @Nullable String info) Creates a newTextComponentand attempts to add any requiredITextDecorators to execute a command when the text is clicked.default @Nullable TextComponentnewComponent(@Nullable TextType type) Creates a newTextComponentfor a given type.
-
Method Details
-
newComponent
Creates a newTextComponentfor 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
default @Nullable TextComponent newClickableTextComponent(@Nullable TextType type, String command, @Nullable String info) Creates a newTextComponentand attempts to add any requiredITextDecorators 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
Creates a newTextComponentand attempts to add any requiredITextDecorators 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.
-