[Bleeding] MaterialData fixes. Addresses BUKKIT-842

This commit is contained in:
Celtic Minstrel
2012-02-26 22:07:26 -05:00
committed by EvilSeph
parent 08a68cff82
commit 276c1559c8
9 changed files with 631 additions and 48 deletions

View File

@@ -6,7 +6,7 @@ import org.bukkit.block.BlockFace;
/**
* Represents a door.
*/
public class Door extends MaterialData implements Directional {
public class Door extends MaterialData implements Directional, Openable {
public Door() {
super(Material.WOODEN_DOOR);
}
@@ -27,20 +27,10 @@ public class Door extends MaterialData implements Directional {
super(type, data);
}
/**
* Check to see if the door is open.
*
* @return true if the door has swung counterclockwise around its hinge.
*/
public boolean isOpen() {
return ((getData() & 0x4) == 0x4);
}
/**
* Configure this door to be either open or closed;
*
* @param isOpen True to open the door.
*/
public void setOpen(boolean isOpen) {
setData((byte) (isOpen ? (getData() | 0x4) : (getData() & ~0x4)));
}