Enum Formatting

java.lang.Object
java.lang.Enum<Formatting>
net.minecraft.util.Formatting
All Implemented Interfaces:
Serializable, Comparable<Formatting>, java.lang.constant.Constable

public enum Formatting
extends Enum<Formatting>
  • Enum Constant Details

  • Field Details

    • BY_NAME

      private static final Map<String,​Formatting> BY_NAME
    • FORMATTING_CODE_PATTERN

      private static final Pattern FORMATTING_CODE_PATTERN
    • name

      private final String name
    • code

      private final char code
    • modifier

      private final boolean modifier
    • stringValue

      private final String stringValue
    • colorIndex

      private final int colorIndex
    • colorValue

      @Nullable private final Integer colorValue
  • Constructor Details

    • Formatting

      private Formatting​(String name, char code, int colorIndex, Integer colorValue)
    • Formatting

      private Formatting​(String name, char code, boolean modifier)
    • Formatting

      private Formatting​(String name, char code, boolean modifier, int colorIndex, Integer colorValue)
  • Method Details

    • values

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

      public static Formatting valueOf​(String name)
      Returns the enum constant of this type with the specified name. The string must match exactly an identifier used to declare an enum constant in this type. (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 type has no constant with the specified name
      NullPointerException - if the argument is null
    • sanitize

      private static String sanitize​(String name)
    • getColorIndex

      public int getColorIndex()
    • isModifier

      public boolean isModifier()
    • isColor

      public boolean isColor()
    • getColorValue

      @Nullable public Integer getColorValue()
    • getName

      public String getName()
    • toString

      public String toString()
      Overrides:
      toString in class Enum<Formatting>
    • strip

      @Nullable public static String strip​(@Nullable String string)
    • byName

      @Nullable public static Formatting byName​(@Nullable String name)
    • byColorIndex

      @Nullable public static Formatting byColorIndex​(int colorIndex)
    • byCode

      @Environment(CLIENT) @Nullable public static Formatting byCode​(char code)
    • getNames

      public static Collection<String> getNames​(boolean colors, boolean modifiers)