Interface ITextFactory

All Known Implementing Classes:
ITextFactory.SimpleTextFactory, TextFactorySpigot

public interface ITextFactory
Factory class that can be used to create new Text instances.

Certain things like colors and styles are set differently in different platforms. This factory allows for easy creation of texts that are styled according to the platform.

If you only need unstyled texts, you can use getSimpleTextFactory(). This will return a simple factory that only creates unstyled texts.

  • Method Details

    • newText

      Text newText(@Nullable PersonalizedLocalizer personalizedLocalizer)
      Creates a new Text instance.
      Parameters:
      personalizedLocalizer - the string localizer to use for this text.
      Returns:
      The new text instance.
    • newText

      default Text newText()
    • getSimpleTextFactory

      static ITextFactory getSimpleTextFactory()
      Gets a simple ITextFactory that only produces unstyled texts.