Ton of Material extensions handling the meta-data of blocks.

By: sunkid <sunkid@iminurnetz.com>
This commit is contained in:
Bukkit/Spigot
2011-04-02 16:42:12 -07:00
parent a449fb01d1
commit 84a31c3951
31 changed files with 1203 additions and 135 deletions

View File

@@ -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();
}
}