[BREAKING] Update BlockFace directions. Fixes BUKKIT-1567, BUKKIT-3069

If you use BlockFace in any way, to compensate the directionals being incorrect, you can still have backwards compatibility if you add in the handling in your plugin:
boolean legacyBlockFace = BlockFace.NORTH().getModX() == -1; (and then handle it accordingly)

If you didn't special case your directions to fix what's being fixed here... Hurray! Your plugin should now work.

By: feildmaster <admin@feildmaster.com>
This commit is contained in:
Bukkit/Spigot
2012-12-01 00:21:22 -06:00
parent 9e0336d03c
commit 711f3f1007
25 changed files with 272 additions and 272 deletions

View File

@@ -31,16 +31,16 @@ public class Gate extends MaterialData implements Directional, Openable {
switch (face) {
default:
case SOUTH:
case EAST:
data |= GATE_SOUTH;
break;
case WEST:
case SOUTH:
data |= GATE_WEST;
break;
case NORTH:
case WEST:
data |= GATE_NORTH;
break;
case EAST:
case NORTH:
data |= GATE_EAST;
break;
}
@@ -51,16 +51,16 @@ public class Gate extends MaterialData implements Directional, Openable {
public BlockFace getFacing() {
switch (getData() & DIR_BIT) {
case GATE_SOUTH:
return BlockFace.SOUTH;
case GATE_WEST:
return BlockFace.WEST;
case GATE_NORTH:
return BlockFace.NORTH;
case GATE_EAST:
return BlockFace.EAST;
case GATE_WEST:
return BlockFace.SOUTH;
case GATE_NORTH:
return BlockFace.WEST;
case GATE_EAST:
return BlockFace.NORTH;
}
return BlockFace.SOUTH;
return BlockFace.EAST;
}
public boolean isOpen() {