From ab693a7521535335b0de90d7c6f7dbb707ca9ccf Mon Sep 17 00:00:00 2001 From: Jim Bilbrey Date: Tue, 20 Nov 2012 03:28:41 -0500 Subject: [PATCH] update "forward" to match modern yaw --- .../java/com/sk89q/worldedit/LocalPlayer.java | 26 +++++++++---------- 1 file changed, 13 insertions(+), 13 deletions(-) diff --git a/src/main/java/com/sk89q/worldedit/LocalPlayer.java b/src/main/java/com/sk89q/worldedit/LocalPlayer.java index 783b85196..ccacee4aa 100644 --- a/src/main/java/com/sk89q/worldedit/LocalPlayer.java +++ b/src/main/java/com/sk89q/worldedit/LocalPlayer.java @@ -374,7 +374,7 @@ public abstract class LocalPlayer { } // From hey0's code - double rot = (getYaw() + yawOffset - 90) % 360; + double rot = (getYaw() + yawOffset) % 360; //let's use real yaw now if (rot < 0) { rot += 360.0; } @@ -389,23 +389,23 @@ public abstract class LocalPlayer { */ private static PlayerDirection getDirection(double rot) { if (0 <= rot && rot < 22.5) { - return PlayerDirection.NORTH; - } else if (22.5 <= rot && rot < 67.5) { - return PlayerDirection.NORTH_EAST; - } else if (67.5 <= rot && rot < 112.5) { - return PlayerDirection.EAST; - } else if (112.5 <= rot && rot < 157.5) { - return PlayerDirection.SOUTH_EAST; - } else if (157.5 <= rot && rot < 202.5) { return PlayerDirection.SOUTH; - } else if (202.5 <= rot && rot < 247.5) { + } else if (22.5 <= rot && rot < 67.5) { return PlayerDirection.SOUTH_WEST; - } else if (247.5 <= rot && rot < 292.5) { + } else if (67.5 <= rot && rot < 112.5) { return PlayerDirection.WEST; - } else if (292.5 <= rot && rot < 337.5) { + } else if (112.5 <= rot && rot < 157.5) { return PlayerDirection.NORTH_WEST; - } else if (337.5 <= rot && rot < 360.0) { + } else if (157.5 <= rot && rot < 202.5) { return PlayerDirection.NORTH; + } else if (202.5 <= rot && rot < 247.5) { + return PlayerDirection.NORTH_EAST; + } else if (247.5 <= rot && rot < 292.5) { + return PlayerDirection.EAST; + } else if (292.5 <= rot && rot < 337.5) { + return PlayerDirection.SOUTH_EAST; + } else if (337.5 <= rot && rot < 360.0) { + return PlayerDirection.SOUTH; } else { return null; }