Interface ChatProcessor


public interface ChatProcessor
Small formatting bridge used by Prismatic chat components.

The default processor delegates to PrismaticAPI. Consumers that need an extra text preparation step, such as custom small-caps or alignment passes, can provide their own implementation without coupling this package to a larger runtime.

  • Method Summary

    Modifier and Type
    Method
    Description
    @NotNull String
    colorize(@Nullable org.bukkit.entity.Player player, String string)
    Applies colors to the given text.
    default @NotNull String
    Literal separator used when a hover text is serialized back to component markup.
    default @NotNull String
    Regex used to split hover text into lines.
    default @NotNull String
    prepare(String string)
    Applies optional pre-processing before a multi-component is split into segments.
    static @NotNull ChatProcessor
    Returns the default processor backed by PrismaticAPI.
    default @NotNull String[]
    Splits text into lines without a limit.
    default @NotNull String[]
    splitLines(String string, int limit)
    Splits text into lines using getLineSeparatorRegex().
  • Method Details

    • prismatic

      @NotNull static @NotNull ChatProcessor prismatic()
      Returns the default processor backed by PrismaticAPI.
      Returns:
      default Prismatic processor
    • colorize

      @NotNull @NotNull String colorize(@Nullable @Nullable org.bukkit.entity.Player player, String string)
      Applies colors to the given text.
      Parameters:
      player - optional player context
      string - text to colorize
      Returns:
      colorized text
    • prepare

      @NotNull default @NotNull String prepare(String string)
      Applies optional pre-processing before a multi-component is split into segments.
      Parameters:
      string - raw text
      Returns:
      prepared text
    • getLineSeparator

      @NotNull default @NotNull String getLineSeparator()
      Literal separator used when a hover text is serialized back to component markup.
      Returns:
      line separator literal
    • getLineSeparatorRegex

      @NotNull default @NotNull String getLineSeparatorRegex()
      Regex used to split hover text into lines.
      Returns:
      line separator regex
    • splitLines

      @NotNull default @NotNull String[] splitLines(String string, int limit)
      Splits text into lines using getLineSeparatorRegex().
      Parameters:
      string - text to split
      limit - split limit
      Returns:
      split lines
    • splitLines

      @NotNull default @NotNull String[] splitLines(String string)
      Splits text into lines without a limit.
      Parameters:
      string - text to split
      Returns:
      split lines