public void completePlayerName()
    {
        Iterator var2;
        GuiPlayerInfo var3;

        if (this.field_50060_d)
        {
            this.inputField.func_50021_a(-1);

            if (this.field_50067_h >= this.field_50068_i.size())
            {
                this.field_50067_h = 0;
            }
        }
        else
        {
            int var1 = this.inputField.func_50028_c(-1);

            if (this.inputField.func_50035_h() - var1 < 1)
            {
                return;
            }

            this.field_50068_i.clear();
            this.field_50061_e = this.inputField.getText().substring(var1);
            this.field_50059_f = this.field_50061_e.toLowerCase();
            var2 = ((EntityClientPlayerMP)this.mc.thePlayer).sendQueue.playerNames.iterator();

            while (var2.hasNext())
            {
                var3 = (GuiPlayerInfo)var2.next();

                if (var3.nameStartsWith(this.field_50059_f))
                {
                    this.field_50068_i.add(var3);
                }
            }

            if (this.field_50068_i.size() == 0)
            {
                return;
            }

            this.field_50060_d = true;
            this.field_50067_h = 0;
            this.inputField.func_50020_b(var1 - this.inputField.func_50035_h());
        }

        if (this.field_50068_i.size() > 1)
        {
            StringBuilder var4 = new StringBuilder();

            for (var2 = this.field_50068_i.iterator(); var2.hasNext(); var4.append(var3.name))
            {
                var3 = (GuiPlayerInfo)var2.next();

                if (var4.length() > 0)
                {
                    var4.append(", ");
                }
            }

            this.mc.ingameGUI.addChatMessage(var4.toString());
        }

        this.inputField.func_50031_b(((GuiPlayerInfo)this.field_50068_i.get(this.field_50067_h++)).name);
    }