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.CoalType; 4import org.bukkit.Material; 5 6/** 7 * Represents the different types of coals. 8 */ 9public class Coal extends MaterialData { 10 public Coal() { 11 super(Material.COAL); 12 } 13 14 public Coal(CoalType type) { 15 this(); 16 setType(type); 17 } 18 19 public Coal(final int type) { 20 super(type); 21 } 22 23 public Coal(final Material type) { 24 super(type); 25 } 26 27 public Coal(final int type, final byte data) { 28 super(type, data); 29 } 30 31 public Coal(final Material type, final byte data) { 32 super(type, data); 33 } 34 35 /** 36 * Gets the current type of this coal 37 * 38 * @return CoalType of this coal 39 */ 40 public CoalType getType() { 41 return CoalType.getByData(getData()); 42 } 43 44 /** 45 * Sets the type of this coal 46 * 47 * @param type New type of this coal 48 */ 49 public void setType(CoalType type) { 50 setData(type.getData()); 51 } 52 53 @Override 54 public String toString() { 55 return getType() + " " + super.toString(); 56 } 57}