public void func_73800_i(int par1)
    {
        int i = text.length();

        if (par1 > i)
        {
            par1 = i;
        }

        if (par1 < 0)
        {
            par1 = 0;
        }

        selectionEnd = par1;

        if (fontRenderer != null)
        {
            if (field_73816_n > i)
            {
                field_73816_n = i;
            }

            int j = getWidth();
            String s = fontRenderer.trimStringToWidth(text.substring(field_73816_n), j);
            int k = s.length() + field_73816_n;

            if (par1 == field_73816_n)
            {
                field_73816_n -= fontRenderer.trimStringToWidth(text, j, true).length();
            }

            if (par1 > k)
            {
                field_73816_n += par1 - k;
            }
            else if (par1 <= field_73816_n)
            {
                field_73816_n -= field_73816_n - par1;
            }

            if (field_73816_n < 0)
            {
                field_73816_n = 0;
            }

            if (field_73816_n > i)
            {
                field_73816_n = i;
            }
        }
    }