summaryrefslogtreecommitdiffstats
path: root/src/main/java/org/bukkit/block/data/type/Bed.java
diff options
context:
space:
mode:
Diffstat (limited to 'src/main/java/org/bukkit/block/data/type/Bed.java')
-rw-r--r--src/main/java/org/bukkit/block/data/type/Bed.java50
1 files changed, 50 insertions, 0 deletions
diff --git a/src/main/java/org/bukkit/block/data/type/Bed.java b/src/main/java/org/bukkit/block/data/type/Bed.java
new file mode 100644
index 00000000..bc1c95b0
--- /dev/null
+++ b/src/main/java/org/bukkit/block/data/type/Bed.java
@@ -0,0 +1,50 @@
+package org.bukkit.block.data.type;
+
+import org.bukkit.block.data.Bisected;
+import org.bukkit.block.data.Directional;
+
+/**
+ * Similar to {@link Bisected}, 'part' denotes which half of the bed this block
+ * corresponds to.
+ * <br>
+ * 'occupied' property is a quick flag to check if a player is currently
+ * sleeping in this bed block.
+ */
+public interface Bed extends Directional {
+
+ /**
+ * Gets the value of the 'part' property.
+ *
+ * @return the 'part' value
+ */
+ Part getPart();
+
+ /**
+ * Sets the value of the 'part' property.
+ *
+ * @param part the new 'part' value
+ */
+ void setPart(Part part);
+
+ /**
+ * Gets the value of the 'occupied' property.
+ *
+ * @return the 'occupied' value
+ */
+ boolean isOccupied();
+
+ /**
+ * Horizontal half of a bed.
+ */
+ public enum Part {
+
+ /**
+ * The head is the upper part of the bed containing the pillow.
+ */
+ HEAD,
+ /**
+ * The foot is the lower half of the bed.
+ */
+ FOOT;
+ }
+}