2011-03-19 22:39:51 +00:00
|
|
|
package com.earth2me.essentials.commands;
|
|
|
|
|
2011-11-18 17:42:26 +00:00
|
|
|
import com.earth2me.essentials.User;
|
2011-03-19 22:39:51 +00:00
|
|
|
import org.bukkit.Location;
|
|
|
|
import org.bukkit.Server;
|
|
|
|
|
|
|
|
|
|
|
|
public class Commandgetpos extends EssentialsCommand
|
|
|
|
{
|
|
|
|
public Commandgetpos()
|
|
|
|
{
|
|
|
|
super("getpos");
|
|
|
|
}
|
|
|
|
|
|
|
|
@Override
|
2011-11-18 12:06:59 +00:00
|
|
|
public void run(final Server server, final User user, final String commandLabel, final String[] args) throws Exception
|
2011-03-19 22:39:51 +00:00
|
|
|
{
|
2011-11-18 12:06:59 +00:00
|
|
|
final Location coords = user.getLocation();
|
2011-10-14 23:13:24 +00:00
|
|
|
user.sendMessage("§7X: " + coords.getBlockX() + " (+East <-> -West)");
|
2011-03-19 22:39:51 +00:00
|
|
|
user.sendMessage("§7Y: " + coords.getBlockY() + " (+Up <-> -Down)");
|
2011-10-14 23:13:24 +00:00
|
|
|
user.sendMessage("§7Z: " + coords.getBlockZ() + " (+South <-> -North)");
|
|
|
|
user.sendMessage("§7Yaw: " + (coords.getYaw() + 180 + 360) % 360 + " (Rotation)");
|
2011-03-19 22:39:51 +00:00
|
|
|
user.sendMessage("§7Pitch: " + coords.getPitch() + " (Head angle)");
|
|
|
|
}
|
|
|
|
}
|