001    package org.bukkit.material;
002    
003    import org.bukkit.Material;
004    
005    /**
006     * Represents a redstone torch
007     */
008    public class RedstoneTorch extends Torch implements Redstone {
009        public RedstoneTorch() {
010            super(Material.REDSTONE_TORCH_ON);
011        }
012    
013        /**
014         *
015         * @deprecated Magic value
016         */
017        @Deprecated
018        public RedstoneTorch(final int type) {
019            super(type);
020        }
021    
022        public RedstoneTorch(final Material type) {
023            super(type);
024        }
025    
026        /**
027         *
028         * @deprecated Magic value
029         */
030        @Deprecated
031        public RedstoneTorch(final int type, final byte data) {
032            super(type, data);
033        }
034    
035        /**
036         *
037         * @deprecated Magic value
038         */
039        @Deprecated
040        public RedstoneTorch(final Material type, final byte data) {
041            super(type, data);
042        }
043    
044        /**
045         * Gets the current state of this Material, indicating if it's powered or
046         * unpowered
047         *
048         * @return true if powered, otherwise false
049         */
050        public boolean isPowered() {
051            return getItemType() == Material.REDSTONE_TORCH_ON;
052        }
053    
054        @Override
055        public String toString() {
056            return super.toString() + " " + (isPowered() ? "" : "NOT ") + "POWERED";
057        }
058    
059        @Override
060        public RedstoneTorch clone() {
061            return (RedstoneTorch) super.clone();
062        }
063    }