Bukkit-API  1.7.9-R0.2
The inofficial Bukkit-API
PoweredRail.java
1 package org.bukkit.material;
2 
3 import org.bukkit.Material;
4 
5 /**
6  * Represents a powered rail
7  */
8 public class PoweredRail extends ExtendedRails implements Redstone {
9  public PoweredRail() {
10  super(Material.POWERED_RAIL);
11  }
12 
13  /**
14  *
15  * @deprecated Magic value
16  */
17  @Deprecated
18  public PoweredRail(final int type) {
19  super(type);
20  }
21 
22  public PoweredRail(final Material type) {
23  super(type);
24  }
25 
26  /**
27  *
28  * @deprecated Magic value
29  */
30  @Deprecated
31  public PoweredRail(final int type, final byte data) {
32  super(type, data);
33  }
34 
35  /**
36  *
37  * @deprecated Magic value
38  */
39  @Deprecated
40  public PoweredRail(final Material type, final byte data) {
41  super(type, data);
42  }
43 
44  public boolean isPowered() {
45  return (getData() & 0x8) == 0x8;
46  }
47 
48  /**
49  * Set whether this PoweredRail should be powered or not.
50  *
51  * @param isPowered whether or not the rail is powered
52  */
53  public void setPowered(boolean isPowered) {
54  setData((byte) (isPowered ? (getData() | 0x8) : (getData() & ~0x8)));
55  }
56 
57  @Override
58  public PoweredRail clone() {
59  return (PoweredRail) super.clone();
60  }
61 }
PoweredRail(final Material type, final byte data)
PoweredRail(final int type, final byte data)
void setPowered(boolean isPowered)