Allow piston blocks to rotate

This commit is contained in:
mrapple 2011-07-02 20:06:56 -05:00
parent 084e9456e1
commit 1e9c5b2c76

View File

@ -134,6 +134,15 @@ public final class BlockData {
case 2: return 0 | open; case 2: return 0 | open;
case 3: return 1 | open; case 3: return 1 | open;
} }
} else if (type == BlockID.PISTON_BASE || type == BlockID.PISTON_STICKY_BASE || type == BlockID.PISTON_EXTENSION) {
switch(data) {
case 0: return 0;
case 1: return 1;
case 2: return 5;
case 3: return 4;
case 4: return 2;
case 5: return 3;
}
} }
return data; return data;
@ -252,6 +261,16 @@ public final class BlockData {
case 0: return 2 | open; case 0: return 2 | open;
case 1: return 3 | open; case 1: return 3 | open;
} }
} else if (type == BlockID.PISTON_BASE || type == BlockID.PISTON_STICKY_BASE || type == BlockID.PISTON_EXTENSION) {
int dir = data & 0x8;
switch(dir) {
case 0: return 0;
case 1: return 1;
case 2: return 4;
case 3: return 5;
case 4: return 3;
case 5: return 2;
}
} }
return data; return data;