TF-EssentialsX/Essentials/src/com/earth2me/essentials/commands/Commandgetpos.java

26 lines
806 B
Java
Raw Normal View History

package com.earth2me.essentials.commands;
2011-11-18 17:42:26 +00:00
import com.earth2me.essentials.User;
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-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)");
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)");
user.sendMessage("§7Pitch: " + coords.getPitch() + " (Head angle)");
}
}