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

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

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1475 - (show annotations) (download)
Mon May 23 15:12:25 2011 UTC (12 years, 11 months ago) by torben
File size: 832 byte(s)
test pitch / yaw
1 package dk.thoerup.bukkit.hoeruputils;
2
3 import org.bukkit.Location;
4 import org.bukkit.command.Command;
5 import org.bukkit.command.CommandExecutor;
6 import org.bukkit.command.CommandSender;
7 import org.bukkit.entity.Player;
8
9 public class GetposCommand implements CommandExecutor {
10
11 @Override
12 public boolean onCommand(final CommandSender sender, Command command, String label, String[] args) {
13 if (! (sender instanceof Player) ) {
14 return false;
15 }
16
17
18 Player p = (Player) sender;
19 Location l = p.getLocation();
20
21 String message = String.format("Your current location is %d,%d,%d", (int)l.getX(), (int)l.getY(), (int)l.getZ() );
22 p.sendMessage(message);
23 p.sendMessage( String.format("%f, %f", l.getPitch(), l.getYaw()) );
24 //needs to print facing direction
25
26 // TODO Auto-generated method stub
27 return true;
28 }
29
30 }

  ViewVC Help
Powered by ViewVC 1.1.20