package com.spiderrobotman.Gamemode4Engine.command;

import com.spiderrobotman.Gamemode4Engine.util.TextUtil;
import org.bukkit.ChatColor;
import org.bukkit.command.Command;
import org.bukkit.command.CommandSender;
import org.bukkit.command.TabCompleter;
import org.bukkit.entity.Player;

import java.util.ArrayList;
import java.util.List;

/**
 * Project: Gamemode4Engine
 * Author: SpiderRobotMan
 * Date: May 18 2016
 * Website: http://www.spiderrobotman.com
 */
public class RealNameTabCompleter implements TabCompleter {
    @Override
    public List<String> onTabComplete(CommandSender cs, Command command, String s, String[] args) {

        TextUtil.logInfo("tab complete");

        if (command.getName().equalsIgnoreCase("realname") && args.length == 1) {
            TextUtil.logInfo("tab complete 2");
            if (cs instanceof Player) {
                Player sender = (Player) cs;

                List<String> list = new ArrayList<>();

                for (String name : NickCommand.nicks.values()) {
                    TextUtil.logInfo("tab complete 3 " + name);

                    String flat = ChatColor.stripColor(name.replace("&", "§"));
                    if (!name.isEmpty()) {
                        list.add(flat);
                    }
                }
                return list;
            }
        }

        return null;
    }
}

@@ -50,65 +50,8 @@
 d;%0A%0A
-import com.spiderrobotman.Gamemode4Engine.util.TextUtil;%0A
 impo
@@ -580,52 +580,8 @@
 ) %7B%0A
-%0A        TextUtil.logInfo(%22tab complete%22);%0A%0A
     
@@ -662,56 +662,8 @@
 ) %7B%0A
-            TextUtil.logInfo(%22tab complete 2%22);%0A
     
@@ -796,24 +796,24 @@
 yList%3C%3E();%0A%0A
+
             
@@ -868,72 +868,8 @@
 )) %7B
-%0A                    TextUtil.logInfo(%22tab complete 3 %22 + name);
 %0A%0A  

remove debug messages