java.lang.Object
java.lang.Enum<ChatColor>
net.ME1312.SubServers.Client.Sponge.Library.Compatibility.ChatColor
All Implemented Interfaces:
Serializable, Comparable<ChatColor>, java.lang.constant.Constable

public enum ChatColor extends Enum<ChatColor>
Color Code Converter Enum
  • Enum Constant Details

    • AQUA

      public static final ChatColor AQUA
    • BLACK

      public static final ChatColor BLACK
    • BLUE

      public static final ChatColor BLUE
    • BOLD

      public static final ChatColor BOLD
    • DARK_AQUA

      public static final ChatColor DARK_AQUA
    • DARK_BLUE

      public static final ChatColor DARK_BLUE
    • DARK_GRAY

      public static final ChatColor DARK_GRAY
    • DARK_GREEN

      public static final ChatColor DARK_GREEN
    • DARK_PURPLE

      public static final ChatColor DARK_PURPLE
    • DARK_RED

      public static final ChatColor DARK_RED
    • GOLD

      public static final ChatColor GOLD
    • GRAY

      public static final ChatColor GRAY
    • GREEN

      public static final ChatColor GREEN
    • ITALIC

      public static final ChatColor ITALIC
    • LIGHT_PURPLE

      public static final ChatColor LIGHT_PURPLE
    • MAGIC

      public static final ChatColor MAGIC
    • RED

      public static final ChatColor RED
    • RESET

      public static final ChatColor RESET
    • STRIKETHROUGH

      public static final ChatColor STRIKETHROUGH
    • UNDERLINE

      public static final ChatColor UNDERLINE
    • WHITE

      public static final ChatColor WHITE
    • YELLOW

      public static final ChatColor YELLOW
  • Method Details

    • values

      public static ChatColor[] values()
      Returns an array containing the constants of this enum class, in the order they are declared.
      Returns:
      an array containing the constants of this enum class, in the order they are declared
    • valueOf

      public static ChatColor valueOf(String name)
      Returns the enum constant of this class with the specified name. The string must match exactly an identifier used to declare an enum constant in this class. (Extraneous whitespace characters are not permitted.)
      Parameters:
      name - the name of the enum constant to be returned.
      Returns:
      the enum constant with the specified name
      Throws:
      IllegalArgumentException - if this enum class has no constant with the specified name
      NullPointerException - if the argument is null
    • asMinecraftCode

      public String asMinecraftCode()
      Get this color as a Minecraft Color Code
      Returns:
      Minecraft Color Code
    • asTextColor

      public TextColor asTextColor()
      Get the Sponge API equivalent of this value
      Returns:
      Sponge API Color (may be null for modifiers)
    • getStyles

      public TextStyle[] getStyles()
      Get the styles this color applies
      Returns:
      Sponge API Styles
    • toString

      public String toString()
      Overrides:
      toString in class Enum<ChatColor>
    • parseColor

      public static String parseColor(char character, String str)
      Parse Minecraft color codes starting with character
      Parameters:
      character - Character
      str - String to parse
      Returns:
      Minecraft colored string
    • convertColor

      public static Text convertColor(String str)
      Convert Minecraft color codes to Sponge Text
      Parameters:
      str - Minecraft colored string
      Returns:
      Sponge Text
    • convertColor

      public static Text convertColor(char character, String str)
      Convert Minecraft color codes starting with character to Sponge Text
      Parameters:
      character - Character
      str - String to parse
      Returns:
      Sponge Text
    • stripColor

      public static String stripColor(String str)
      Removes all Minecraft color codes from a string
      Parameters:
      str - String to parse
      Returns:
      String without color