blob: a9ac16e7a3d7929cac7e60df95689362dcecdfd3 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
|
package org.bukkit;
import java.util.Map;
import com.google.common.collect.Maps;
/**
* Represents the three different types of Sandstone
*/
public enum SandstoneType {
CRACKED(0x0),
GLYPHED(0x1),
SMOOTH(0x2);
private final byte data;
private final static Map<Byte, SandstoneType> BY_DATA = Maps.newHashMap();
private SandstoneType(final int data) {
this.data = (byte) data;
}
/**
* Gets the associated data value representing this type of sandstone
*
* @return A byte containing the data value of this sandstone type
* @deprecated Magic value
*/
@Deprecated
public byte getData() {
return data;
}
/**
* Gets the type of sandstone with the given data value
*
* @param data Data value to fetch
* @return The {@link SandstoneType} representing the given value, or null
* if it doesn't exist
* @deprecated Magic value
*/
@Deprecated
public static SandstoneType getByData(final byte data) {
return BY_DATA.get(data);
}
static {
for (SandstoneType type : values()) {
BY_DATA.put(type.data, type);
}
}
}
|