001    package org.bukkit.material;
002    
003    import org.bukkit.DyeColor;
004    import org.bukkit.Material;
005    
006    /**
007     * Represents a Wool/Cloth block
008     */
009    public class Wool extends MaterialData implements Colorable {
010        public Wool() {
011            super(Material.WOOL);
012        }
013    
014        public Wool(DyeColor color) {
015            this();
016            setColor(color);
017        }
018    
019        /**
020         *
021         * @deprecated Magic value
022         */
023        @Deprecated
024        public Wool(final int type) {
025            super(type);
026        }
027    
028        public Wool(final Material type) {
029            super(type);
030        }
031    
032        /**
033         *
034         * @deprecated Magic value
035         */
036        @Deprecated
037        public Wool(final int type, final byte data) {
038            super(type, data);
039        }
040    
041        /**
042         *
043         * @deprecated Magic value
044         */
045        @Deprecated
046        public Wool(final Material type, final byte data) {
047            super(type, data);
048        }
049    
050        /**
051         * Gets the current color of this dye
052         *
053         * @return DyeColor of this dye
054         */
055        public DyeColor getColor() {
056            return DyeColor.getByWoolData(getData());
057        }
058    
059        /**
060         * Sets the color of this dye
061         *
062         * @param color New color of this dye
063         */
064        public void setColor(DyeColor color) {
065            setData(color.getWoolData());
066        }
067    
068        @Override
069        public String toString() {
070            return getColor() + " " + super.toString();
071        }
072    
073        @Override
074        public Wool clone() {
075            return (Wool) super.clone();
076        }
077    }