mirror of
https://github.com/EssentialsX/Essentials.git
synced 2024-12-23 17:47:34 +01:00
[Fix] Allow console to afk others
This commit is contained in:
parent
22efa3e000
commit
8604debc4e
@ -2,6 +2,7 @@ package com.earth2me.essentials.commands;
|
||||
|
||||
import static com.earth2me.essentials.I18n._;
|
||||
import com.earth2me.essentials.User;
|
||||
import org.bukkit.command.CommandSender;
|
||||
import org.bukkit.Server;
|
||||
|
||||
|
||||
@ -26,6 +27,20 @@ public class Commandafk extends EssentialsCommand
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void run(Server server, CommandSender sender, String commandLabel, String[] args) throws Exception
|
||||
{
|
||||
if (args.length > 0)
|
||||
{
|
||||
User afkUser = getPlayer(server, args, 0, true, false);
|
||||
toggleAfk(afkUser);
|
||||
}
|
||||
else
|
||||
{
|
||||
throw new NotEnoughArgumentsException();
|
||||
}
|
||||
}
|
||||
|
||||
private void toggleAfk(User user)
|
||||
{
|
||||
user.setDisplayNick();
|
||||
@ -53,3 +68,4 @@ public class Commandafk extends EssentialsCommand
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user