Package me.croabeast.prismatic.chat
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 TypeMethodDescription@NotNull StringApplies colors to the given text.default @NotNull StringLiteral separator used when a hover text is serialized back to component markup.default @NotNull StringRegex used to split hover text into lines.default @NotNull StringApplies optional pre-processing before a multi-component is split into segments.static @NotNull ChatProcessorReturns the default processor backed byPrismaticAPI.default @NotNull String[]splitLines(String string) Splits text into lines without a limit.default @NotNull String[]splitLines(String string, int limit) Splits text into lines usinggetLineSeparatorRegex().
-
Method Details
-
prismatic
Returns the default processor backed byPrismaticAPI.- 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 contextstring- text to colorize- Returns:
- colorized text
-
prepare
Applies optional pre-processing before a multi-component is split into segments.- Parameters:
string- raw text- Returns:
- prepared text
-
getLineSeparator
Literal separator used when a hover text is serialized back to component markup.- Returns:
- line separator literal
-
getLineSeparatorRegex
Regex used to split hover text into lines.- Returns:
- line separator regex
-
splitLines
Splits text into lines usinggetLineSeparatorRegex().- Parameters:
string- text to splitlimit- split limit- Returns:
- split lines
-
splitLines
Splits text into lines without a limit.- Parameters:
string- text to split- Returns:
- split lines
-