mirror of
https://github.com/PaperMC/Paper.git
synced 2025-01-07 16:57:42 +01:00
Merge pull request #16 in SPIGOT/bukkit from ~FEARTHE1337/bukkit:buttons to master
* commit '1b1b613dc0196caf1093145c99ff080e6c0aa496': Add support for levers being attached up and downwards. Fixes SPIGOT-177. By: Thinkofdeath <thinkofdeath@spigotmc.org>
This commit is contained in:
commit
2e0e8ad972
@ -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);
|
||||
|
Loading…
Reference in New Issue
Block a user