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

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

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1474 - (hide annotations) (download)
Sat May 21 18:10:19 2011 UTC (13 years ago) by torben
File size: 762 byte(s)
typecast to int
1 torben 1472 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 torben 1474 String message = String.format("Your current location is %d,%d,%d", (int)l.getX(), (int)l.getY(), (int)l.getZ() );
22 torben 1472 p.sendMessage(message);
23     //needs to print facing direction
24    
25     // TODO Auto-generated method stub
26     return true;
27     }
28    
29     }

  ViewVC Help
Powered by ViewVC 1.1.20