summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorFearThe1337 <admin@fearthe1337.com>2014-12-10 15:24:40 +0100
committerFearThe1337 <admin@fearthe1337.com>2014-12-10 15:24:40 +0100
commitb630b9794157e0fde361d786e4a583514c7f23ee (patch)
tree030752a9d711a73624644a91b8dcda4c16c88d66
parentad5a4f5e289e43b8dd36e294380e8f1a5f6a1a91 (diff)
downloadbukkit-b630b9794157e0fde361d786e4a583514c7f23ee.tar
bukkit-b630b9794157e0fde361d786e4a583514c7f23ee.tar.gz
bukkit-b630b9794157e0fde361d786e4a583514c7f23ee.tar.lz
bukkit-b630b9794157e0fde361d786e4a583514c7f23ee.tar.xz
bukkit-b630b9794157e0fde361d786e4a583514c7f23ee.zip
Add support for levers being attached up and downwards.
Fixes SPIGOT-177.
-rw-r--r--src/main/java/org/bukkit/material/Button.java14
1 files changed, 14 insertions, 0 deletions
diff --git a/src/main/java/org/bukkit/material/Button.java b/src/main/java/org/bukkit/material/Button.java
index 01895918..fd6a7db8 100644
--- a/src/main/java/org/bukkit/material/Button.java
+++ b/src/main/java/org/bukkit/material/Button.java
@@ -73,6 +73,9 @@ public class Button extends SimpleAttachableMaterialData implements Redstone {
byte data = (byte) (getData() & 0x7);
switch (data) {
+ case 0x0:
+ return BlockFace.UP;
+
case 0x1:
return BlockFace.WEST;
@@ -84,6 +87,9 @@ public class Button extends SimpleAttachableMaterialData implements Redstone {
case 0x4:
return BlockFace.SOUTH;
+
+ case 0x5:
+ return BlockFace.DOWN;
}
return null;
@@ -96,6 +102,10 @@ public class Button extends SimpleAttachableMaterialData implements Redstone {
byte data = (byte) (getData() & 0x8);
switch (face) {
+ case DOWN:
+ data |= 0x0;
+ break;
+
case EAST:
data |= 0x1;
break;
@@ -111,6 +121,10 @@ public class Button extends SimpleAttachableMaterialData implements Redstone {
case NORTH:
data |= 0x4;
break;
+
+ case UP:
+ data |= 0x5;
+ break;
}
setData(data);