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

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

public class Commandburn extends EssentialsCommand
{

    public Commandburn()
    {
        super("burn");
    }

    @Override
    public void run(Server server, Essentials parent, User user, String commandLabel, String[] args) throws Exception
    {
        if (args.length < 2)
        {
            user.sendMessage("§cUsage: /burn [player] [seconds]");
            return;
        }

        User.charge(user, this);
        for (Player p : server.matchPlayer(args[0]))
        {
            p.setFireTicks(Integer.parseInt(args[1]) * 20);
            user.sendMessage("§cYou set " + p.getDisplayName() + " on fire for " + Integer.parseInt(args[1]) + "seconds.");
        }
    }
}