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