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

Added LocalPlayer.getCardinalDirection(int yawOffset)

Dieser Commit ist enthalten in:
TomyLobo 2011-10-25 01:02:50 +02:00
Ursprung a1fb1fd4e4
Commit 3962e6c9d8

Datei anzeigen

@ -349,6 +349,16 @@ public abstract class LocalPlayer {
* @return
*/
public PlayerDirection getCardinalDirection() {
return getCardinalDirection(0);
}
/**
* Get the player's cardinal direction (N, W, NW, etc.) with an offset. May return null.
* @param yawOffset offset that is added to the player's yaw before determining the cardinal direction
*
* @return
*/
public PlayerDirection getCardinalDirection(int yawOffset) {
if (getPitch() > 67.5) {
return PlayerDirection.DOWN;
}
@ -357,7 +367,7 @@ public abstract class LocalPlayer {
}
// From hey0's code
double rot = (getYaw() - 90) % 360;
double rot = (getYaw() + yawOffset - 90) % 360;
if (rot < 0) {
rot += 360.0;
}