[Bleeding] Add new MaterialData classes for new blocks and update existing blocks with new data

By: Mike Primm <mike@primmhome.com>
This commit is contained in:
Bukkit/Spigot
2012-08-04 21:23:59 -05:00
parent 64ad50197f
commit 5154864bbc
12 changed files with 640 additions and 21 deletions

View File

@@ -70,6 +70,11 @@ public class Lever extends SimpleAttachableMaterialData implements Redstone {
case 0x5:
case 0x6:
return BlockFace.DOWN;
case 0x0:
case 0x7:
return BlockFace.UP;
}
return null;
@@ -80,8 +85,9 @@ public class Lever extends SimpleAttachableMaterialData implements Redstone {
*/
public void setFacingDirection(BlockFace face) {
byte data = (byte) (getData() & 0x8);
if (getAttachedFace() == BlockFace.DOWN) {
BlockFace attach = getAttachedFace();
if (attach == BlockFace.DOWN) {
switch (face) {
case WEST:
case EAST:
@@ -93,6 +99,18 @@ public class Lever extends SimpleAttachableMaterialData implements Redstone {
data |= 0x6;
break;
}
} else if (attach == BlockFace.UP) {
switch (face) {
case WEST:
case EAST:
data |= 0x7;
break;
case SOUTH:
case NORTH:
data |= 0x0;
break;
}
} else {
switch (face) {
case SOUTH: