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