MCPcopy Create free account
hub / github.com/PaperMC/Paper / CoalType

Enum CoalType

paper-api/src/main/java/org/bukkit/CoalType.java:10–52  ·  view source on GitHub ↗

Represents the two types of coal

Source from the content-addressed store, hash-verified

8 * Represents the two types of coal
9 */
10@Deprecated(forRemoval = true, since = "1.13")
11public 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}

Callers

nothing calls this directly

Calls 3

newHashMapMethod · 0.80
valuesMethod · 0.65
putMethod · 0.65

Tested by

no test coverage detected