summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorDinnerbone <dinnerbone@dinnerbone.com>2011-01-15 20:30:13 +0000
committerDinnerbone <dinnerbone@dinnerbone.com>2011-01-15 20:31:00 +0000
commit3f5d5276e2fdfcd11e3783f95373c36829c7a644 (patch)
tree5ef1975d7dd049eb063223d8597bae3288ee21fb /src
parent468c8bd48b4c22712820b0d350d462d30812e7e1 (diff)
downloadbukkit-3f5d5276e2fdfcd11e3783f95373c36829c7a644.tar
bukkit-3f5d5276e2fdfcd11e3783f95373c36829c7a644.tar.gz
bukkit-3f5d5276e2fdfcd11e3783f95373c36829c7a644.tar.lz
bukkit-3f5d5276e2fdfcd11e3783f95373c36829c7a644.tar.xz
bukkit-3f5d5276e2fdfcd11e3783f95373c36829c7a644.zip
Added Torches
Diffstat (limited to 'src')
-rw-r--r--src/main/java/org/bukkit/material/Torch.java50
1 files changed, 50 insertions, 0 deletions
diff --git a/src/main/java/org/bukkit/material/Torch.java b/src/main/java/org/bukkit/material/Torch.java
new file mode 100644
index 00000000..0405d18e
--- /dev/null
+++ b/src/main/java/org/bukkit/material/Torch.java
@@ -0,0 +1,50 @@
+
+package org.bukkit.material;
+
+import org.bukkit.BlockFace;
+import org.bukkit.Material;
+
+/**
+ * MaterialData for torches
+ */
+public class Torch extends MaterialData implements Attachable {
+ public Torch(final int type) {
+ super(type);
+ }
+
+ public Torch(final Material type) {
+ super(type);
+ }
+
+ public Torch(final int type, final byte data) {
+ super(type, data);
+ }
+
+ public Torch(final Material type, final byte data) {
+ super(type, data);
+ }
+
+ /**
+ * Gets the face that this block is attached on
+ *
+ * @return BlockFace attached to
+ */
+ public BlockFace getAttachedFace() {
+ byte data = getData();
+
+ switch (data) {
+ case 0x1:
+ return BlockFace.NORTH;
+ case 0x2:
+ return BlockFace.SOUTH;
+ case 0x3:
+ return BlockFace.EAST;
+ case 0x4:
+ return BlockFace.WEST;
+ case 0x5:
+ return BlockFace.DOWN;
+ }
+
+ return null;
+ }
+}