Bukkit-API  1.7.9-R0.2
The inofficial Bukkit-API
Coal.java
1 package org.bukkit.material;
2 
3 import org.bukkit.CoalType;
4 import org.bukkit.Material;
5 
6 /**
7  * Represents the different types of coals.
8  */
9 public class Coal extends MaterialData {
10  public Coal() {
11  super(Material.COAL);
12  }
13 
14  public Coal(CoalType type) {
15  this();
16  setType(type);
17  }
18 
19  /**
20  *
21  * @deprecated Magic value
22  */
23  @Deprecated
24  public Coal(final int type) {
25  super(type);
26  }
27 
28  public Coal(final Material type) {
29  super(type);
30  }
31 
32  /**
33  *
34  * @deprecated Magic value
35  */
36  @Deprecated
37  public Coal(final int type, final byte data) {
38  super(type, data);
39  }
40 
41  /**
42  *
43  * @deprecated Magic value
44  */
45  @Deprecated
46  public Coal(final Material type, final byte data) {
47  super(type, data);
48  }
49 
50  /**
51  * Gets the current type of this coal
52  *
53  * @return CoalType of this coal
54  */
55  public CoalType getType() {
56  return CoalType.getByData(getData());
57  }
58 
59  /**
60  * Sets the type of this coal
61  *
62  * @param type New type of this coal
63  */
64  public void setType(CoalType type) {
65  setData(type.getData());
66  }
67 
68  @Override
69  public String toString() {
70  return getType() + " " + super.toString();
71  }
72 
73  @Override
74  public Coal clone() {
75  return (Coal) super.clone();
76  }
77 }
void setType(CoalType type)
Definition: Coal.java:64
static CoalType getByData(final byte data)
Definition: CoalType.java:41
Coal(final int type, final byte data)
Definition: Coal.java:37
Coal(final int type)
Definition: Coal.java:24
CoalType getType()
Definition: Coal.java:55
Coal(final Material type, final byte data)
Definition: Coal.java:46