Class ColoredStringParser

java.lang.Object
com.kamikazejam.kamicommon.util.ColoredStringParser

public class ColoredStringParser extends Object
Utility for mapping String objects into VersionedComponent objects, handling both legacy color codes and modern MiniMessage format.

See individual methods for specific parsing behavior.
  • Constructor Details

    • ColoredStringParser

      public ColoredStringParser()
  • Method Details

    • parse

      @NotNull public static @NotNull VersionedComponent parse(@NotNull @NotNull String input)
      Identifies the type of title string being used, and tries its best to set it correctly on the builder.
      Supports (parsed in this order):
      - Legacy Section (contains § symbols)
      - MiniMessage (contains <tag> tags)
      - Legacy Ampersand (contains & symbols)
    • parse

      @NotNull public static @NotNull List<VersionedComponent> parse(@NotNull @NotNull List<String> input)
      Parses a list of strings into a list of VersionedComponent objects, using the same logic as parse(String) for each line.

      This is useful for parsing lore lists from configuration files or other sources.