Fork of Poseidon providing Bukkit #1060 to older Beta versions (b1.0-b1.7.3)
at develop 57 lines 1.1 kB view raw
1package org.bukkit.material; 2 3import org.bukkit.CropState; 4import org.bukkit.Material; 5 6/** 7 * Represents the different types of crops. 8 */ 9public 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 public Crops(final int type) { 20 super(type); 21 } 22 23 public Crops(final Material type) { 24 super(type); 25 } 26 27 public Crops(final int type, final byte data) { 28 super(type, data); 29 } 30 31 public Crops(final Material type, final byte data) { 32 super(type, data); 33 } 34 35 /** 36 * Gets the current growth state of this crop 37 * 38 * @return CropState of this leave 39 */ 40 public CropState getState() { 41 return CropState.getByData(getData()); 42 } 43 44 /** 45 * Sets the growth state of this crop 46 * 47 * @param state New growth state of this crop 48 */ 49 public void setState(CropState state) { 50 setData(state.getData()); 51 } 52 53 @Override 54 public String toString() { 55 return getState() + " " + super.toString(); 56 } 57}