Rename methods

This commit is contained in:
fullwall 2012-10-30 21:14:10 +08:00
parent c873904dfc
commit 579385cb0d

View File

@ -77,30 +77,30 @@ public class Util {
while (degrees > 360D) {
degrees -= 360D;
}
if (isFacingNorth(degrees, leeway))
return BlockFace.WEST;
if (isFacingEast(degrees, leeway))
return BlockFace.NORTH;
if (isFacingSouth(degrees, leeway))
return BlockFace.EAST;
if (isFacingWest(degrees, leeway))
return BlockFace.WEST;
if (isFacingNorth(degrees, leeway))
return BlockFace.NORTH;
if (isFacingEast(degrees, leeway))
return BlockFace.EAST;
if (isFacingSouth(degrees, leeway))
return BlockFace.SOUTH;
return BlockFace.SELF;
}
private static boolean isFacingEast(double degrees, double leeway) {
private static boolean isFacingNorth(double degrees, double leeway) {
return (45 - leeway <= degrees) && (degrees < 135 + leeway);
}
private static boolean isFacingNorth(double degrees, double leeway) {
private static boolean isFacingWest(double degrees, double leeway) {
return ((0 <= degrees) && (degrees < 45 + leeway)) || ((315 - leeway <= degrees) && (degrees <= 360));
}
private static boolean isFacingSouth(double degrees, double leeway) {
private static boolean isFacingEast(double degrees, double leeway) {
return (135 - leeway <= degrees) && (degrees < 225 + leeway);
}
private static boolean isFacingWest(double degrees, double leeway) {
private static boolean isFacingSouth(double degrees, double leeway) {
return (225 - leeway <= degrees) && (degrees < 315 + leeway);
}