Fix BlockData causing unit test to fail

Yes, even though north/south and south/north anvils LOOK the same, they are in fact different data values.
This commit is contained in:
Wizjany 2015-07-17 04:48:09 -04:00
parent a28acdd6a8
commit 2aad68f80d

View File

@ -241,7 +241,14 @@ public final class BlockData {
return ((data + 1) & 0x3) | (data & ~0x3);
case BlockID.ANVIL:
return data ^ 0x1;
int damage = data & 0x4;
switch (data & ~0x4) {
case 0: return 3 | damage;
case 2: return 1 | damage;
case 1: return 0 | damage;
case 3: return 2 | damage;
}
break;
case BlockID.BED:
return data & ~0x3 | (data + 1) & 0x3;
@ -471,7 +478,14 @@ public final class BlockData {
return ((data + 3) & 0x3) | (data & ~0x3);
case BlockID.ANVIL:
return data ^ 0x1;
int damage = data & 0x4;
switch (data & ~0x4) {
case 0: return 1 | damage;
case 2: return 3 | damage;
case 1: return 0 | damage;
case 3: return 2 | damage;
}
break;
case BlockID.BED:
return data & ~0x3 | (data - 1) & 0x3;