Fork of Poseidon providing Bukkit #1060 to older Beta versions (b1.0-b1.7.3)
at develop 57 lines 1.2 kB view raw
1package org.bukkit.material; 2 3import org.bukkit.Material; 4import org.bukkit.TreeSpecies; 5 6/** 7 * Represents the different types of leaves. 8 */ 9public class Leaves extends MaterialData { 10 public Leaves() { 11 super(Material.LEAVES); 12 } 13 14 public Leaves(TreeSpecies species) { 15 this(); 16 setSpecies(species); 17 } 18 19 public Leaves(final int type) { 20 super(type); 21 } 22 23 public Leaves(final Material type) { 24 super(type); 25 } 26 27 public Leaves(final int type, final byte data) { 28 super(type, data); 29 } 30 31 public Leaves(final Material type, final byte data) { 32 super(type, data); 33 } 34 35 /** 36 * Gets the current species of this leave 37 * 38 * @return TreeSpecies of this leave 39 */ 40 public TreeSpecies getSpecies() { 41 return TreeSpecies.getByData(getData()); 42 } 43 44 /** 45 * Sets the species of this leave 46 * 47 * @param species New species of this leave 48 */ 49 public void setSpecies(TreeSpecies species) { 50 setData(species.getData()); 51 } 52 53 @Override 54 public String toString() { 55 return getSpecies() + " " + super.toString(); 56 } 57}