001 package org.bukkit.material; 002 003 import org.bukkit.Material; 004 005 /** 006 * Represents a detector rail 007 */ 008 public class DetectorRail extends ExtendedRails implements PressureSensor { 009 public DetectorRail() { 010 super(Material.DETECTOR_RAIL); 011 } 012 013 /** 014 * 015 * @deprecated Magic value 016 */ 017 @Deprecated 018 public DetectorRail(final int type) { 019 super(type); 020 } 021 022 public DetectorRail(final Material type) { 023 super(type); 024 } 025 026 /** 027 * 028 * @deprecated Magic value 029 */ 030 @Deprecated 031 public DetectorRail(final int type, final byte data) { 032 super(type, data); 033 } 034 035 /** 036 * 037 * @deprecated Magic value 038 */ 039 @Deprecated 040 public DetectorRail(final Material type, final byte data) { 041 super(type, data); 042 } 043 044 public boolean isPressed() { 045 return (getData() & 0x8) == 0x8; 046 } 047 048 public void setPressed(boolean isPressed) { 049 setData((byte) (isPressed ? (getData() | 0x8) : (getData() & ~0x8))); 050 } 051 052 @Override 053 public DetectorRail clone() { 054 return (DetectorRail) super.clone(); 055 } 056 }