Sets the direction this lever is pointing in
(BlockFace face)
| 78 | * Sets the direction this lever is pointing in |
| 79 | */ |
| 80 | public void setFacingDirection(BlockFace face) { |
| 81 | byte data = (byte) (getData() & 0x8); |
| 82 | |
| 83 | if (getAttachedFace() == BlockFace.DOWN) { |
| 84 | switch (face) { |
| 85 | case WEST: |
| 86 | case EAST: |
| 87 | data |= 0x5; |
| 88 | break; |
| 89 | |
| 90 | case SOUTH: |
| 91 | case NORTH: |
| 92 | data |= 0x6; |
| 93 | break; |
| 94 | } |
| 95 | } else { |
| 96 | switch (face) { |
| 97 | case SOUTH: |
| 98 | data |= 0x1; |
| 99 | break; |
| 100 | |
| 101 | case NORTH: |
| 102 | data |= 0x2; |
| 103 | break; |
| 104 | |
| 105 | case WEST: |
| 106 | data |= 0x3; |
| 107 | break; |
| 108 | |
| 109 | case EAST: |
| 110 | data |= 0x4; |
| 111 | break; |
| 112 | } |
| 113 | } |
| 114 | setData(data); |
| 115 | } |
| 116 | |
| 117 | @Override |
| 118 | public String toString() { |
nothing calls this directly
no test coverage detected