Enum Class ItemDataColor

java.lang.Object
java.lang.Enum<ItemDataColor>
com.samjakob.spigui.item.ItemDataColor
All Implemented Interfaces:
Serializable, Comparable<ItemDataColor>, Constable

public enum ItemDataColor extends Enum<ItemDataColor>
Items such as glass panes can have variable color. This color is set using durability values which is understandable from an efficiency perspective however it is rather unintuitive and the values are not clear or memorable.
This class allows those damage values to be referred to by the name of the color they represent.
Note that
  • Enum Constant Details

    • WHITE

      public static final ItemDataColor WHITE
      Value is 0. Use WHITE_WOOL for 1.13+
    • ORANGE

      public static final ItemDataColor ORANGE
      Value is 1. Use ORANGE_WOOL for 1.13+
    • MAGENTA

      public static final ItemDataColor MAGENTA
      Value is 2. Use MAGENTA_WOOL for 1.13+
    • LIGHT_BLUE

      public static final ItemDataColor LIGHT_BLUE
      Value is 3. Use LIGHT_BLUE_WOOL for 1.13+
    • YELLOW

      public static final ItemDataColor YELLOW
      Value is 4. Use YELLOW_WOOL for 1.13+
    • LIME

      public static final ItemDataColor LIME
      Value is 5. Use LIME_WOOL for 1.13+
    • PINK

      public static final ItemDataColor PINK
      Value is 6. Use PINK_WOOL for 1.13+
    • GRAY

      public static final ItemDataColor GRAY
      Value is 7. Use GRAY_WOOL for 1.13+
    • LIGHT_GRAY

      public static final ItemDataColor LIGHT_GRAY
      Value is 8. Use LIGHT_GRAY_WOOL for 1.13+
    • CYAN

      public static final ItemDataColor CYAN
      Value is 9. Use CYAN_WOOL for 1.13+
    • PURPLE

      public static final ItemDataColor PURPLE
      Value is 10. Use PURPLE_WOOL for 1.13+
    • BLUE

      public static final ItemDataColor BLUE
      Value is 11. Use BLUE_WOOL for 1.13+
    • BROWN

      public static final ItemDataColor BROWN
      Value is 12. Use BROWN_WOOL for 1.13+
    • GREEN

      public static final ItemDataColor GREEN
      Value is 13. Use GREEN_WOOL for 1.13+
    • RED

      public static final ItemDataColor RED
      Value is 14. Use RED_WOOL for 1.13+
    • BLACK

      public static final ItemDataColor BLACK
      Value is 15. Use BLACK_WOOL for 1.13+
  • Field Details

    • value

      private final short value
      The durability value of the color.
  • Constructor Details

    • ItemDataColor

      private ItemDataColor(short value)
      Define an ItemDataColor based on a given short value.
      Parameters:
      value - The color value (as a durability value). Must be between 0 and 15, per Minecraft's color mapping.
  • Method Details

    • values

      public static ItemDataColor[] 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 ItemDataColor 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
    • getValue

      public short getValue()
      Returns the durability value that the named color represents.
      Returns:
      The durability value as a 'short'.
    • getByValue

      public static ItemDataColor getByValue(short value)
      Returns an ItemDataColor as found by its damage value or null if there isn't one.
      Parameters:
      value - The corresponding damage value of the color.
      Returns:
      The ItemDataColor associated with value or null if there isn't one.