mirror of
https://github.com/TotalFreedomMC/TF-EssentialsX.git
synced 2024-06-25 23:40:58 +00:00
![Josh Roy](/assets/img/avatar_default.png)
Gradle is better than Maven, don't @ me. okay but actually it's [faster](https://www.youtube.com/watch?v=atuFSv2bLa8&feature=youtu.be&t=77), compiles and tests in parallel more efficiently, and more epic stuff).
39 lines
1.2 KiB
Java
39 lines
1.2 KiB
Java
package com.earth2me.essentials.commands;
|
|
|
|
import com.earth2me.essentials.CommandSource;
|
|
import com.earth2me.essentials.User;
|
|
import org.bukkit.Server;
|
|
|
|
import java.util.Collections;
|
|
import java.util.List;
|
|
|
|
import static com.earth2me.essentials.I18n.tl;
|
|
|
|
public class Commandburn extends EssentialsCommand {
|
|
public Commandburn() {
|
|
super("burn");
|
|
}
|
|
|
|
@Override
|
|
protected void run(final Server server, final CommandSource sender, final String commandLabel, final String[] args) throws Exception {
|
|
if (args.length < 2) {
|
|
throw new NotEnoughArgumentsException();
|
|
}
|
|
|
|
final User user = getPlayer(server, sender, args, 0);
|
|
user.getBase().setFireTicks(Integer.parseInt(args[1]) * 20);
|
|
sender.sendMessage(tl("burnMsg", user.getDisplayName(), Integer.parseInt(args[1])));
|
|
}
|
|
|
|
@Override
|
|
protected List<String> getTabCompleteOptions(final Server server, final CommandSource sender, final String commandLabel, final String[] args) {
|
|
if (args.length == 1) {
|
|
return getPlayers(server, sender);
|
|
} else if (args.length == 2) {
|
|
return COMMON_DURATIONS;
|
|
} else {
|
|
return Collections.emptyList();
|
|
}
|
|
}
|
|
}
|