Fix MaterialData directions being incorrect. Fixes BUKKIT-3160

Prior to 49690f9, BlockFaces were mostly correct in their respective
MaterialData classes. However, a lot of things were not updated since
implementation and broke without being addressed.

This fixes any discrepancies with Block data.

By: feildmaster <admin@feildmaster.com>
This commit is contained in:
Bukkit/Spigot
2012-12-15 23:25:19 -06:00
parent fb2cf30fbe
commit 87f538df31
9 changed files with 130 additions and 103 deletions

View File

@@ -41,42 +41,49 @@ public class Skull extends MaterialData implements Directional {
int data;
switch (face) {
case NORTH:
case SELF:
default:
data = 0x1;
break;
case EAST:
case NORTH:
data = 0x2;
break;
case EAST:
data = 0x4;
break;
case SOUTH:
data = 0x3;
break;
case WEST:
default:
data = 0x4;
data = 0x5;
}
setData((byte) (data & 3));
setData((byte) data);
}
public BlockFace getFacing() {
int data = getData() & 7;
int data = getData();
switch (data) {
case 0x1:
return BlockFace.NORTH;
default:
return BlockFace.SELF;
case 0x2:
return BlockFace.EAST;
return BlockFace.NORTH;
case 0x3:
return BlockFace.SOUTH;
case 0x4:
default:
return BlockFace.EAST;
case 0x5:
return BlockFace.WEST;
}
}