Files
Paper/paper-api/src/main/java/org/bukkit/material/Crops.java
Bukkit/Spigot f9bec6eadd Deprecate magic values
By: Wesley Wolfe <weswolf@aol.com>
2013-08-19 13:32:18 -05:00

78 lines
1.4 KiB
Java

package org.bukkit.material;
import org.bukkit.CropState;
import org.bukkit.Material;
/**
* Represents the different types of crops.
*/
public class Crops extends MaterialData {
public Crops() {
super(Material.CROPS);
}
public Crops(CropState state) {
this();
setState(state);
}
/**
*
* @deprecated Magic value
*/
@Deprecated
public Crops(final int type) {
super(type);
}
public Crops(final Material type) {
super(type);
}
/**
*
* @deprecated Magic value
*/
@Deprecated
public Crops(final int type, final byte data) {
super(type, data);
}
/**
*
* @deprecated Magic value
*/
@Deprecated
public Crops(final Material type, final byte data) {
super(type, data);
}
/**
* Gets the current growth state of this crop
*
* @return CropState of this crop
*/
public CropState getState() {
return CropState.getByData(getData());
}
/**
* 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();
}
@Override
public Crops clone() {
return (Crops) super.clone();
}
}