Bukkit-API  1.7.9-R0.2
The inofficial Bukkit-API
RedstoneTorch.java
1 package org.bukkit.material;
2 
3 import org.bukkit.Material;
4 
5 /**
6  * Represents a redstone torch
7  */
8 public class RedstoneTorch extends Torch implements Redstone {
9  public RedstoneTorch() {
10  super(Material.REDSTONE_TORCH_ON);
11  }
12 
13  /**
14  *
15  * @deprecated Magic value
16  */
17  @Deprecated
18  public RedstoneTorch(final int type) {
19  super(type);
20  }
21 
22  public RedstoneTorch(final Material type) {
23  super(type);
24  }
25 
26  /**
27  *
28  * @deprecated Magic value
29  */
30  @Deprecated
31  public RedstoneTorch(final int type, final byte data) {
32  super(type, data);
33  }
34 
35  /**
36  *
37  * @deprecated Magic value
38  */
39  @Deprecated
40  public RedstoneTorch(final Material type, final byte data) {
41  super(type, data);
42  }
43 
44  /**
45  * Gets the current state of this Material, indicating if it's powered or
46  * unpowered
47  *
48  * @return true if powered, otherwise false
49  */
50  public boolean isPowered() {
51  return getItemType() == Material.REDSTONE_TORCH_ON;
52  }
53 
54  @Override
55  public String toString() {
56  return super.toString() + " " + (isPowered() ? "" : "NOT ") + "POWERED";
57  }
58 
59  @Override
60  public RedstoneTorch clone() {
61  return (RedstoneTorch) super.clone();
62  }
63 }
RedstoneTorch(final int type, final byte data)
RedstoneTorch(final Material type, final byte data)