summaryrefslogtreecommitdiffstats
path: root/Essentials/src/com/earth2me/essentials/commands/Commandsetwarp.java
blob: c62403292232af13331600712146c8c6e58ca494 (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
package com.earth2me.essentials.commands;

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


public class Commandsetwarp extends EssentialsCommand
{
	public Commandsetwarp()
	{
		super("setwarp");
	}

	@Override
	public void run(Server server, User user, String commandLabel, String[] args) throws Exception
	{
		if (args.length < 1)
		{
			throw new NotEnoughArgumentsException();
		}

		charge(user);
		Location loc = user.getLocation();
		ess.getWarps().setWarp(args[0], loc);
		user.sendMessage(Util.format("warpSet", args[0]));
	}
}