Fork of Poseidon providing Bukkit #1060 to older Beta versions (b1.0-b1.7.3)
at develop 41 lines 928 B view raw
1package org.bukkit.material; 2 3import org.bukkit.Material; 4 5/** 6 * Represents a powered rail 7 */ 8public 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 33 /** 34 * Set whether this PoweredRail should be powered or not. 35 * 36 * @param isPowered whether or not the rail is powered 37 */ 38 public void setPowered(boolean isPowered) { 39 setData((byte) (isPowered ? (getData() | 0x8) : (getData() & ~0x8))); 40 } 41}