Bukkit/Bukkit — pull request #696 by AlphaBlend (2012-10-22 03:37:53+00:00)
Title: Correctly rotate BlockFaces 90 degrees to the right

There has been a longstanding issue with regard to data values that represent direction, and BlockFace values that mirror those data values. The issue lies in that the BlockFaces are actually 90 degrees to the left of where they should be. In a correct setting, the following values are assumed:

North = Z + 1
South = Z - 1
West = X - 1
East = X + 1

In the current BlockFace environment, these values are as follows:

North = X - 1
South = X + 1
West = Z + 1
East = Z - 1

This method rotates the current BlockFace to match the data values representing direction in various blocks in accordance with vanilla Minecraft.

It does not alter the enum itself, which allows future BlockFace representations to not interfere with this 90 degree offset issue. Simply call this method to correct your current representation.