3
0
Mirror von https://github.com/IntellectualSites/FastAsyncWorldEdit.git synchronisiert 2024-12-24 18:10:08 +01:00

Made hay blocks rotate like logs.

They're textured like them, too, so it fits.
Also, they no longer violate the "flip twice equals rotate twice" conditions.
Dieser Commit ist enthalten in:
TomyLobo 2013-10-02 21:26:24 +02:00
Ursprung 696a2819a7
Commit 7dca4d15ef
2 geänderte Dateien mit 2 neuen und 13 gelöschten Zeilen

Datei anzeigen

@ -169,6 +169,7 @@ public final class BlockData {
} }
break; break;
case BlockID.HAY_BLOCK:
case BlockID.LOG: case BlockID.LOG:
if (data >= 4 && data <= 11) data ^= 0xc; if (data >= 4 && data <= 11) data ^= 0xc;
break; break;
@ -224,11 +225,6 @@ public final class BlockData {
case BlockID.ANVIL: case BlockID.ANVIL:
return data ^ 0x1; return data ^ 0x1;
case BlockID.HAY_BLOCK:
if (data == 4) return 8;
else if (data == 8) return 4;
else return 0; // sanitize extraneous data values since hay blocks are weird
case BlockID.BED: case BlockID.BED:
return data & ~0x3 | (data + 1) & 0x3; return data & ~0x3 | (data + 1) & 0x3;
@ -388,6 +384,7 @@ public final class BlockData {
} }
break; break;
case BlockID.HAY_BLOCK:
case BlockID.LOG: case BlockID.LOG:
if (data >= 4 && data <= 11) data ^= 0xc; if (data >= 4 && data <= 11) data ^= 0xc;
break; break;
@ -442,11 +439,6 @@ public final class BlockData {
case BlockID.ANVIL: case BlockID.ANVIL:
return data ^ 0x1; return data ^ 0x1;
case BlockID.HAY_BLOCK:
if (data == 4) return 8;
else if (data == 8) return 4;
else return 0;
case BlockID.BED: case BlockID.BED:
return data & ~0x3 | (data - 1) & 0x3; return data & ~0x3 | (data - 1) & 0x3;

Datei anzeigen

@ -34,9 +34,6 @@ public class BlockDataTest {
@Test @Test
public void testRotateFlip() { public void testRotateFlip() {
for (int type = 0; type < 256; ++type) { for (int type = 0; type < 256; ++type) {
if (type == BlockID.HAY_BLOCK) {
continue; // not monotonous
}
for (int data = 0; data < 16; ++data) { for (int data = 0; data < 16; ++data) {
final String message = type + "/" + data; final String message = type + "/" + data;