[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:
@@ -59,23 +59,23 @@ public class Rails extends MaterialData {
|
||||
switch (d) {
|
||||
case 0x0:
|
||||
default:
|
||||
return BlockFace.WEST;
|
||||
return BlockFace.SOUTH;
|
||||
|
||||
case 0x1:
|
||||
return BlockFace.SOUTH;
|
||||
|
||||
case 0x2:
|
||||
return BlockFace.SOUTH;
|
||||
|
||||
case 0x3:
|
||||
return BlockFace.NORTH;
|
||||
|
||||
case 0x4:
|
||||
return BlockFace.EAST;
|
||||
|
||||
case 0x5:
|
||||
case 0x2:
|
||||
return BlockFace.EAST;
|
||||
|
||||
case 0x3:
|
||||
return BlockFace.WEST;
|
||||
|
||||
case 0x4:
|
||||
return BlockFace.NORTH;
|
||||
|
||||
case 0x5:
|
||||
return BlockFace.SOUTH;
|
||||
|
||||
case 0x6:
|
||||
return BlockFace.NORTH_EAST;
|
||||
|
||||
@@ -116,19 +116,19 @@ public class Rails extends MaterialData {
|
||||
*/
|
||||
public void setDirection(BlockFace face, boolean isOnSlope) {
|
||||
switch (face) {
|
||||
case SOUTH:
|
||||
case EAST:
|
||||
setData((byte) (isOnSlope ? 0x2 : 0x1));
|
||||
break;
|
||||
|
||||
case NORTH:
|
||||
case WEST:
|
||||
setData((byte) (isOnSlope ? 0x3 : 0x1));
|
||||
break;
|
||||
|
||||
case EAST:
|
||||
case NORTH:
|
||||
setData((byte) (isOnSlope ? 0x4 : 0x0));
|
||||
break;
|
||||
|
||||
case WEST:
|
||||
case SOUTH:
|
||||
setData((byte) (isOnSlope ? 0x5 : 0x0));
|
||||
break;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user