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