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