summaryrefslogtreecommitdiffstats
path: root/Essentials/src/com/earth2me/essentials/commands/Commandtphere.java
blob: 3a003b2576eb468cbcaa8e3611f4fb5c6c00d91b (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
26
27
28
29
30
31
32
33
34
package com.earth2me.essentials.commands;

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


public class Commandtphere extends EssentialsCommand
{
	public Commandtphere()
	{
		super("tphere");
	}

	@Override
	public String[] getTriggers()
	{
		return new String[]
				{
					getName(), "telehere", "s"
				};
	}

	@Override
	public void run(Server server, Essentials parent, User player, String commandLabel, String[] args) throws Exception
	{
		User p = getPlayer(server, args, 0);
		if (!p.isTeleEnabled()) throw new Exception(p.getDisplayName() + " has teleportation disabled.");
		player.charge(this);
		p.teleportTo(player);
		player.sendMessage("§7Teleporting...");
		p.sendMessage("§7Teleporting...");
	}
}