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