Represents the two types of coal
| 8 | * Represents the two types of coal |
| 9 | */ |
| 10 | @Deprecated(forRemoval = true, since = "1.13") |
| 11 | public enum CoalType { |
| 12 | COAL(0x0), |
| 13 | CHARCOAL(0x1); |
| 14 | |
| 15 | private final byte data; |
| 16 | private static final Map<Byte, CoalType> BY_DATA = Maps.newHashMap(); |
| 17 | |
| 18 | private CoalType(final int data) { |
| 19 | this.data = (byte) data; |
| 20 | } |
| 21 | |
| 22 | /** |
| 23 | * Gets the associated data value representing this type of coal |
| 24 | * |
| 25 | * @return A byte containing the data value of this coal type |
| 26 | * @deprecated Magic value |
| 27 | */ |
| 28 | @Deprecated(since = "1.6.2") |
| 29 | public byte getData() { |
| 30 | return data; |
| 31 | } |
| 32 | |
| 33 | /** |
| 34 | * Gets the type of coal with the given data value |
| 35 | * |
| 36 | * @param data Data value to fetch |
| 37 | * @return The {@link CoalType} representing the given value, or null if |
| 38 | * it doesn't exist |
| 39 | * @deprecated Magic value |
| 40 | */ |
| 41 | @Deprecated(since = "1.6.2") |
| 42 | @Nullable |
| 43 | public static CoalType getByData(final byte data) { |
| 44 | return BY_DATA.get(data); |
| 45 | } |
| 46 | |
| 47 | static { |
| 48 | for (CoalType type : values()) { |
| 49 | BY_DATA.put(type.data, type); |
| 50 | } |
| 51 | } |
| 52 | } |
nothing calls this directly
no test coverage detected