mirror of
https://github.com/PaperMC/Paper.git
synced 2025-01-08 09:17:36 +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);
|
byte data = (byte) (getData() & 0x7);
|
||||||
|
|
||||||
switch (data) {
|
switch (data) {
|
||||||
|
case 0x0:
|
||||||
|
return BlockFace.UP;
|
||||||
|
|
||||||
case 0x1:
|
case 0x1:
|
||||||
return BlockFace.WEST;
|
return BlockFace.WEST;
|
||||||
|
|
||||||
@ -84,6 +87,9 @@ public class Button extends SimpleAttachableMaterialData implements Redstone {
|
|||||||
|
|
||||||
case 0x4:
|
case 0x4:
|
||||||
return BlockFace.SOUTH;
|
return BlockFace.SOUTH;
|
||||||
|
|
||||||
|
case 0x5:
|
||||||
|
return BlockFace.DOWN;
|
||||||
}
|
}
|
||||||
|
|
||||||
return null;
|
return null;
|
||||||
@ -96,6 +102,10 @@ public class Button extends SimpleAttachableMaterialData implements Redstone {
|
|||||||
byte data = (byte) (getData() & 0x8);
|
byte data = (byte) (getData() & 0x8);
|
||||||
|
|
||||||
switch (face) {
|
switch (face) {
|
||||||
|
case DOWN:
|
||||||
|
data |= 0x0;
|
||||||
|
break;
|
||||||
|
|
||||||
case EAST:
|
case EAST:
|
||||||
data |= 0x1;
|
data |= 0x1;
|
||||||
break;
|
break;
|
||||||
@ -111,6 +121,10 @@ public class Button extends SimpleAttachableMaterialData implements Redstone {
|
|||||||
case NORTH:
|
case NORTH:
|
||||||
data |= 0x4;
|
data |= 0x4;
|
||||||
break;
|
break;
|
||||||
|
|
||||||
|
case UP:
|
||||||
|
data |= 0x5;
|
||||||
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
setData(data);
|
setData(data);
|
||||||
|
Loading…
Reference in New Issue
Block a user