Enum Class ItemDataColor
- All Implemented Interfaces:
Serializable,Comparable<ItemDataColor>,Constable
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
This class allows those damage values to be referred to by the name of the color they represent.
Note that
-
Nested Class Summary
Nested classes/interfaces inherited from class java.lang.Enum
Enum.EnumDesc<E extends Enum<E>> -
Enum Constant Summary
Enum ConstantsEnum ConstantDescriptionValue is 15.Value is 11.Value is 12.Value is 9.Value is 7.Value is 13.Value is 3.Value is 8.Value is 5.Value is 2.Value is 1.Value is 6.Value is 10.Value is 14.Value is 0.Value is 4. -
Field Summary
Fields -
Constructor Summary
ConstructorsModifierConstructorDescriptionprivateItemDataColor(short value) Define anItemDataColorbased on a given short value. -
Method Summary
Modifier and TypeMethodDescriptionstatic ItemDataColorgetByValue(short value) Returns anItemDataColoras found by its damage value or null if there isn't one.shortgetValue()Returns the durability value that the named color represents.static ItemDataColorReturns the enum constant of this class with the specified name.static ItemDataColor[]values()Returns an array containing the constants of this enum class, in the order they are declared.
-
Enum Constant Details
-
WHITE
Value is 0. Use WHITE_WOOL for 1.13+ -
ORANGE
Value is 1. Use ORANGE_WOOL for 1.13+ -
MAGENTA
Value is 2. Use MAGENTA_WOOL for 1.13+ -
LIGHT_BLUE
Value is 3. Use LIGHT_BLUE_WOOL for 1.13+ -
YELLOW
Value is 4. Use YELLOW_WOOL for 1.13+ -
LIME
Value is 5. Use LIME_WOOL for 1.13+ -
PINK
Value is 6. Use PINK_WOOL for 1.13+ -
GRAY
Value is 7. Use GRAY_WOOL for 1.13+ -
LIGHT_GRAY
Value is 8. Use LIGHT_GRAY_WOOL for 1.13+ -
CYAN
Value is 9. Use CYAN_WOOL for 1.13+ -
PURPLE
Value is 10. Use PURPLE_WOOL for 1.13+ -
BLUE
Value is 11. Use BLUE_WOOL for 1.13+ -
BROWN
Value is 12. Use BROWN_WOOL for 1.13+ -
GREEN
Value is 13. Use GREEN_WOOL for 1.13+ -
RED
Value is 14. Use RED_WOOL for 1.13+ -
BLACK
Value is 15. Use BLACK_WOOL for 1.13+
-
-
Field Details
-
value
private final short valueThe durability value of the color.
-
-
Constructor Details
-
ItemDataColor
private ItemDataColor(short value) Define anItemDataColorbased 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
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
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 nameNullPointerException- 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
Returns anItemDataColoras found by its damage value or null if there isn't one.- Parameters:
value- The corresponding damage value of the color.- Returns:
- The
ItemDataColorassociated withvalueor null if there isn't one.
-