3
0
Mirror von https://github.com/IntellectualSites/FastAsyncWorldEdit.git synchronisiert 2024-11-05 11:00:05 +01:00

update "forward" to match modern yaw

Dieser Commit ist enthalten in:
Jim Bilbrey 2012-11-20 03:28:41 -05:00 committet von TomyLobo
Ursprung 5e1836a0f8
Commit ab693a7521

Datei anzeigen

@ -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;
}