Search in sources :

Example 1 with UpdateRankTask

use of me.itsmas.network.server.rank.UpdateRankTask in project Network-depr by Mas281.

the class UserCommands method onSetRankCommand.

@Command("setrank")
@Usage("<player> <rank> [prefix]")
@RequiredRank(Rank.ADMIN)
public void onSetRankCommand(User user, User target, Rank rank, @Optional String prefix) {
    if (prefix == null) {
        prefix = rank.getName();
    }
    target.setRank(rank, prefix);
    String formatted = target.getFormattedRank();
    core.getTaskManager().scheduleTask(new UpdateRankTask(target, rank, prefix, user.getName(), user.getUniqueId()));
    user.sendMessage("command.rank.executed", target.getName(), formatted);
    user.addLog("Updated rank of %s [%s] to %s [%s]", target.getName(), target.getUniqueId(), rank.getName(), prefix);
}
Also used : UpdateRankTask(me.itsmas.network.server.rank.UpdateRankTask) Usage(me.itsmas.network.server.command.annotations.Usage) Command(me.itsmas.network.server.command.annotations.Command) RequiredRank(me.itsmas.network.server.command.annotations.RequiredRank)

Aggregations

Command (me.itsmas.network.server.command.annotations.Command)1 RequiredRank (me.itsmas.network.server.command.annotations.RequiredRank)1 Usage (me.itsmas.network.server.command.annotations.Usage)1 UpdateRankTask (me.itsmas.network.server.rank.UpdateRankTask)1