Added setters to applicable MaterialData classes.

By: sunkid <sunkid@iminurnetz.com>
This commit is contained in:
Bukkit/Spigot
2011-06-16 15:45:50 -07:00
parent 93406ae5d2
commit 615b1a9f3f
17 changed files with 139 additions and 20 deletions

View File

@@ -5,8 +5,6 @@ import org.bukkit.block.BlockFace;
/**
* Represents a bed.
*
* @author sunkid
*/
public class Bed extends MaterialData implements Directional {
@@ -51,6 +49,14 @@ public class Bed extends MaterialData implements Directional {
return (getData() & 0x8) == 0x8;
}
/**
* Configure this to be either the head or the foot of the bed
* @param isHeadOfBed
*/
public void setHeadOfBed(boolean isHeadOfBed) {
setData((byte) (isHeadOfBed ? (getData() | 0x8) : (getData() & ~0x8)));
}
/**
* Set which direction the head of the bed is facing. Note that this will
* only affect one of the two blocks the bed is made of.