Newer
Older
ultramine_bukkit / src / main / java / org / bukkit / material / RedstoneTorch.java
@vlad20012 vlad20012 on 24 Feb 2017 1 KB initial
package org.bukkit.material;

import org.bukkit.Material;

/**
 * Represents a redstone torch
 */
public class RedstoneTorch extends Torch implements Redstone
{
	public RedstoneTorch()
	{
		super(Material.REDSTONE_TORCH_ON);
	}

	/**
	 * @deprecated Magic value
	 */
	@Deprecated
	public RedstoneTorch(final int type)
	{
		super(type);
	}

	public RedstoneTorch(final Material type)
	{
		super(type);
	}

	/**
	 * @deprecated Magic value
	 */
	@Deprecated
	public RedstoneTorch(final int type, final byte data)
	{
		super(type, data);
	}

	/**
	 * @deprecated Magic value
	 */
	@Deprecated
	public RedstoneTorch(final Material type, final byte data)
	{
		super(type, data);
	}

	/**
	 * Gets the current state of this Material, indicating if it's powered or
	 * unpowered
	 *
	 * @return true if powered, otherwise false
	 */
	public boolean isPowered()
	{
		return getItemType() == Material.REDSTONE_TORCH_ON;
	}

	@Override
	public String toString()
	{
		return super.toString() + " " + (isPowered() ? "" : "NOT ") + "POWERED";
	}

	@Override
	public RedstoneTorch clone()
	{
		return (RedstoneTorch) super.clone();
	}
}