Fixed activated hoppers rotating incorrectly.

Fixes WORLDEDIT-3138.
This commit is contained in:
sk89q 2014-07-01 15:16:27 -07:00
parent 8f8d991ee1
commit e207ccebe8

View File

@ -124,7 +124,7 @@ public final class BlockData {
/* FALL-THROUGH */ /* FALL-THROUGH */
case BlockID.COCOA_PLANT: case BlockID.COCOA_PLANT:
case BlockID.TRIPWIRE_HOOK: case BlockID.TRIPWIRE_HOOK: {
int extra = data & ~0x3; int extra = data & ~0x3;
int withoutFlags = data & 0x3; int withoutFlags = data & 0x3;
switch (withoutFlags) { switch (withoutFlags) {
@ -134,7 +134,7 @@ public final class BlockData {
case 3: return 0 | extra; case 3: return 0 | extra;
} }
break; break;
}
case BlockID.SIGN_POST: case BlockID.SIGN_POST:
return (data + 4) % 16; return (data + 4) % 16;
@ -145,15 +145,17 @@ public final class BlockData {
case BlockID.BURNING_FURNACE: case BlockID.BURNING_FURNACE:
case BlockID.ENDER_CHEST: case BlockID.ENDER_CHEST:
case BlockID.TRAPPED_CHEST: case BlockID.TRAPPED_CHEST:
case BlockID.HOPPER: case BlockID.HOPPER: {
switch (data) { int extra = data & 0x8;
case 2: return 5; int withoutFlags = data & ~0x8;
case 3: return 4; switch (withoutFlags) {
case 4: return 2; case 2: return 5 | extra;
case 5: return 3; case 3: return 4 | extra;
case 4: return 2 | extra;
case 5: return 3 | extra;
} }
break; break;
}
case BlockID.DISPENSER: case BlockID.DISPENSER:
case BlockID.DROPPER: case BlockID.DROPPER:
int dispPower = data & 0x8; int dispPower = data & 0x8;