Class ColorParser

java.lang.Object
cn.lunadeer.dominion.utils.ColorParser

public class ColorParser extends Object
Utility class for parsing color codes in strings.
  • Constructor Details

    • ColorParser

      public ColorParser()
  • Method Details

    • getComponentType

      public static net.kyori.adventure.text.TextComponent getComponentType(String text)
      Converts a string with color codes into a TextComponent.
      Parameters:
      text - the string with color codes
      Returns:
      the TextComponent with the parsed colors
    • getBukkitType

      public static String getBukkitType(String text)
      Converts a string with color codes into a Bukkit-compatible color string.
      Parameters:
      text - the string with color codes
      Returns:
      the Bukkit-compatible color string
    • getPlainText

      public static String getPlainText(String text)
      Removes color codes from a string, returning plain text.
      Parameters:
      text - the string with color codes
      Returns:
      the plain text string