Bukkit  1.4.7-R1.0
 All Classes Namespaces Files Functions Variables Enumerator Pages
PoweredRail.java
Go to the documentation of this file.
1 package org.bukkit.material;
2 
3 import org.bukkit.Material;
4 
8 public class PoweredRail extends ExtendedRails implements Redstone {
9  public PoweredRail() {
10  super(Material.POWERED_RAIL);
11  }
12 
13  public PoweredRail(final int type) {
14  super(type);
15  }
16 
17  public PoweredRail(final Material type) {
18  super(type);
19  }
20 
21  public PoweredRail(final int type, final byte data) {
22  super(type, data);
23  }
24 
25  public PoweredRail(final Material type, final byte data) {
26  super(type, data);
27  }
28 
29  public boolean isPowered() {
30  return (getData() & 0x8) == 0x8;
31  }
32 
38  public void setPowered(boolean isPowered) {
39  setData((byte) (isPowered ? (getData() | 0x8) : (getData() & ~0x8)));
40  }
41 
42  @Override
43  public PoweredRail clone() {
44  return (PoweredRail) super.clone();
45  }
46 }