package io.github.dead_i.bungeerelay.commands;

import io.github.dead_i.bungeerelay.IRC;
import io.github.dead_i.bungeerelay.Util;
import net.md_5.bungee.api.ChatColor;
import net.md_5.bungee.api.CommandSender;
import net.md_5.bungee.api.chat.TextComponent;
import net.md_5.bungee.api.plugin.Command;
import net.md_5.bungee.api.plugin.Plugin;

public class IRCNickCommand extends Command {
    Plugin plugin;
    public IRCNickCommand(Plugin plugin) {
        super("ircnick", "irc.nick");
        this.plugin = plugin;
    }

    @Override
    public void execute(CommandSender sender, String[] args) {
        if (args.length == 0) {
            sender.sendMessage(new TextComponent(ChatColor.RED + "Usage: /ircnick <nick>"));
            return;
        }
		if (!IRC.sock.isConnected()) {
            sender.sendMessage(new TextComponent(ChatColor.RED + "The proxy is not connected to IRC."));
            return;
        }

		String uid = Util.getUidByNick(args[0]);
        if (uid != null) {
            sender.sendMessage(new TextComponent(ChatColor.RED + "The nick " + args[0] + " is already in use."));
            return;
        }
		IRC.out.println(":" + IRC.uids.get(sender) + " NICK " + args[0]);
    }
}

@@ -1135,17 +1135,16 @@
       %7D%0A
-%09
 %09IRC.out
@@ -1195,23 +1195,65 @@
  %22 + args%5B0%5D
+ + %22 %22 + System.currentTimeMillis() / 1000
 );%0A    %7D%0A%7D%0A

fix ircnick