Actually for real fix unit tests.

I promise this time.
Seriously though, who makes unit tests depend on some old,
hardcoded file that isn't even updated anymore.
This commit is contained in:
wizjany 2015-07-17 07:51:41 -04:00
parent 2aad68f80d
commit 1dd6faf786

View File

@ -207,6 +207,7 @@ public final class BlockData {
break;
case BlockID.TRAP_DOOR:
case BlockID.IRON_TRAP_DOOR:
int withoutOrientation = data & ~0x3;
int orientation = data & 0x3;
switch (orientation) {
@ -241,8 +242,8 @@ public final class BlockData {
return ((data + 1) & 0x3) | (data & ~0x3);
case BlockID.ANVIL:
int damage = data & 0x4;
switch (data & ~0x4) {
int damage = data & ~0x3;
switch (data & 0x3) {
case 0: return 3 | damage;
case 2: return 1 | damage;
case 1: return 0 | damage;
@ -445,6 +446,7 @@ public final class BlockData {
break;
case BlockID.TRAP_DOOR:
case BlockID.IRON_TRAP_DOOR:
int withoutOrientation = data & ~0x3;
int orientation = data & 0x3;
switch (orientation) {
@ -478,12 +480,12 @@ public final class BlockData {
return ((data + 3) & 0x3) | (data & ~0x3);
case BlockID.ANVIL:
int damage = data & 0x4;
switch (data & ~0x4) {
int damage = data & ~0x3;
switch (data & 0x3) {
case 0: return 1 | damage;
case 2: return 3 | damage;
case 1: return 0 | damage;
case 3: return 2 | damage;
case 1: return 2 | damage;
case 3: return 0 | damage;
}
break;
@ -721,6 +723,7 @@ public final class BlockData {
break;
case BlockID.TRAP_DOOR:
case BlockID.IRON_TRAP_DOOR:
switch (data & 0x3) {
case 0:
case 1:
@ -824,6 +827,18 @@ public final class BlockData {
return data ^ flipX;
}
break;
case BlockID.ANVIL:
switch (data & 0x3) {
case 0:
case 2:
return data ^ flipZ << 1;
case 1:
case 3:
return data ^ flipX << 1;
}
break;
}
return data;