package com.spiderrobotman.Gamemode4Engine.command;

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) {
        if (command.getName().equalsIgnoreCase("realname") && args.length == 1) {
            if (cs instanceof Player) {
                Player sender = (Player) cs;

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

                for (String name : NickCommand.nicks.values()) {

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

        return null;
    }
}

@@ -985,16 +985,44 @@
 sEmpty()
+ && flat.beginsWith(args%5B0%5D)
 ) %7B%0A    

Fix tab completion bug