package server.command;
import server.Player;
import server.SyntaxException;
public class AFKCommand extends Command {
public AFKCommand() {
super(CommandCategory.ADMIN, "Sets you as AFK and makes you invisible to non-administrators.");
}
@Override
public void run(Player player) throws SyntaxException {
if (CommandProcessor.nextToken() != null) {
throw new SyntaxException();
}
if (player.isAFK()) {
player.setAFK(false);
player.sendText(true, "You're no longer marked AFK (away from keyboard).");
}
else {
player.setAFK(true);
player.sendText(true, "You're now marked AFK (away from keyboard).");
}
}
@Override
public String[] getSyntax(Player player) {
return new String[] { "" };
}
}