Commands that consider the player's look direction now also use up/down when the player's pitch is outside the [-67.5;67.5] interval.

This commit is contained in:
TomyLobo
2011-08-15 14:05:21 +02:00
parent d7c21322aa
commit e67ea1e769
3 changed files with 15 additions and 7 deletions

View File

@@ -342,6 +342,11 @@ public abstract class LocalPlayer {
* @return
*/
public PlayerDirection getCardinalDirection() {
if (getPitch() > 67.5)
return PlayerDirection.DOWN;
if (getPitch() < -67.5)
return PlayerDirection.UP;
// From hey0's code
double rot = (getYaw() - 90) % 360;
if (rot < 0) {