summaryrefslogtreecommitdiffstats
path: root/Essentials/src/com/earth2me/essentials/commands/Commandgetpos.java
blob: b8616e75feffca8c22d8dfb86c60de066bcfd1ba (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
package com.earth2me.essentials.commands;

import org.bukkit.Location;
import org.bukkit.Server;
import com.earth2me.essentials.User;


public class Commandgetpos extends EssentialsCommand
{
	public Commandgetpos()
	{
		super("getpos");
	}

	@Override
	public void run(final Server server, final User user, final String commandLabel, final String[] args) throws Exception
	{
		final Location coords = user.getLocation();
		user.sendMessage("§7X: " + coords.getBlockX() + " (+East <-> -West)");
		user.sendMessage("§7Y: " + coords.getBlockY() + " (+Up <-> -Down)");
		user.sendMessage("§7Z: " + coords.getBlockZ() + " (+South <-> -North)");
		user.sendMessage("§7Yaw: " + (coords.getYaw() + 180 + 360) % 360 + " (Rotation)");
		user.sendMessage("§7Pitch: " + coords.getPitch() + " (Head angle)");
	}
}