mirror of
https://github.com/PaperMC/Paper.git
synced 2025-01-06 00:07:56 +01:00
Add support for levers being attached up and downwards.
Fixes SPIGOT-177. By: FearThe1337 <admin@fearthe1337.com>
This commit is contained in:
parent
911d5e8c7c
commit
1b1b613dc0
@ -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