--- miscJava/bukkit-minecraft-plugins/HoerupUtils/src/dk/thoerup/bukkit/hoeruputils/GetposCommand.java 2011/05/23 15:12:25 1475 +++ miscJava/bukkit-minecraft-plugins/HoerupUtils/src/dk/thoerup/bukkit/hoeruputils/GetposCommand.java 2011/05/23 15:22:19 1476 @@ -18,10 +18,17 @@ Player p = (Player) sender; Location l = p.getLocation(); + String message = String.format("Your current location is %d,%d,%d", (int)l.getX(), (int)l.getY(), (int)l.getZ() ); p.sendMessage(message); - p.sendMessage( String.format("%f, %f", l.getPitch(), l.getYaw()) ); - //needs to print facing direction + + //pitch is how much user is looking up/down + //yaw is left,right looking direction, 0=straight west + + int compass = ( (int)l.getYaw() + 270) % 360; + String compStr = WhereisCommand.getBearingStr(compass); + p.sendMessage( String.format("Facing direction %d (%s)", compass, compStr ) ); + // // TODO Auto-generated method stub return true;