Ton of Material extensions handling the meta-data of blocks.
By: sunkid <sunkid@iminurnetz.com>
This commit is contained in:
@@ -8,6 +8,15 @@ import org.bukkit.Material;
|
||||
* @author sunkid
|
||||
*/
|
||||
public class Crops extends MaterialData {
|
||||
public Crops() {
|
||||
super(Material.CROPS);
|
||||
}
|
||||
|
||||
public Crops(CropState state) {
|
||||
this();
|
||||
setState(state);
|
||||
}
|
||||
|
||||
public Crops(final int type) {
|
||||
super(type);
|
||||
}
|
||||
@@ -28,8 +37,19 @@ public class Crops extends MaterialData {
|
||||
* Gets the current growth state of this crop
|
||||
*
|
||||
* @return CropState of this leave
|
||||
* @deprecated use {@link #getState()} instead
|
||||
*/
|
||||
@Deprecated
|
||||
public CropState getSpecies() {
|
||||
return getState();
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets the current growth state of this crop
|
||||
*
|
||||
* @return CropState of this leave
|
||||
*/
|
||||
public CropState getState() {
|
||||
return CropState.getByData(getData());
|
||||
}
|
||||
|
||||
@@ -37,8 +57,25 @@ public class Crops extends MaterialData {
|
||||
* Sets the growth state of this crop
|
||||
*
|
||||
* @param state New growth state of this crop
|
||||
* @deprecated use {@link #setState(CropState)} instead
|
||||
*/
|
||||
@Deprecated
|
||||
public void setSpecies(CropState state) {
|
||||
setState(state);
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets the growth state of this crop
|
||||
*
|
||||
* @param state New growth state of this crop
|
||||
*/
|
||||
public void setState(CropState state) {
|
||||
setData(state.getData());
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return getState() + " " + super.toString();
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user