--- miscJava/bukkit-minecraft-plugins/HoerupUtils/src/dk/thoerup/bukkit/hoeruputils/GetposCommand.java 2011/05/21 18:10:19 1474 +++ miscJava/bukkit-minecraft-plugins/HoerupUtils/src/main/java/dk/thoerup/bukkit/hoeruputils/GetposCommand.java 2013/12/07 15:18:04 2093 @@ -1,6 +1,7 @@ package dk.thoerup.bukkit.hoeruputils; import org.bukkit.Location; +import org.bukkit.World; import org.bukkit.command.Command; import org.bukkit.command.CommandExecutor; import org.bukkit.command.CommandSender; @@ -17,10 +18,23 @@ Player p = (Player) sender; Location l = p.getLocation(); + + World world = l.getWorld(); + String worldMsg = "You are currently in world: " + world.getName(); + p.sendMessage( worldMsg ); + + String message = String.format("Your current location is %d,%d,%d", (int)l.getX(), (int)l.getY(), (int)l.getZ() ); p.sendMessage(message); - //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;