/[projects]/miscJava/bukkit-minecraft-plugins/HoerupUtils/src/dk/thoerup/bukkit/hoeruputils/GetposCommand.java
ViewVC logotype

Diff of /miscJava/bukkit-minecraft-plugins/HoerupUtils/src/dk/thoerup/bukkit/hoeruputils/GetposCommand.java

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 1475 by torben, Mon May 23 15:12:25 2011 UTC revision 1476 by torben, Mon May 23 15:22:19 2011 UTC
# Line 18  public class GetposCommand implements Co Line 18  public class GetposCommand implements Co
18                  Player p = (Player) sender;                  Player p = (Player) sender;
19                  Location l = p.getLocation();                  Location l = p.getLocation();
20                                    
21            
22                  String message = String.format("Your current location is %d,%d,%d", (int)l.getX(), (int)l.getY(), (int)l.getZ() );                  String message = String.format("Your current location is %d,%d,%d", (int)l.getX(), (int)l.getY(), (int)l.getZ() );
23                  p.sendMessage(message);                  p.sendMessage(message);
24                  p.sendMessage( String.format("%f, %f", l.getPitch(), l.getYaw()) );                  
25                  //needs to print facing direction                  //pitch is how much user is looking up/down
26                    //yaw is left,right looking direction, 0=straight west
27                    
28                    int compass = ( (int)l.getYaw() + 270) % 360;
29                    String compStr = WhereisCommand.getBearingStr(compass);
30                    p.sendMessage( String.format("Facing direction %d (%s)", compass, compStr ) );
31                    //
32                                    
33                  // TODO Auto-generated method stub                  // TODO Auto-generated method stub
34                  return true;                  return true;

Legend:
Removed from v.1475  
changed lines
  Added in v.1476

  ViewVC Help
Powered by ViewVC 1.1.20