public void func_50032_g(int par1)
    {
        int var2 = this.text.length();

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

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

        this.field_50048_p = par1;

        if (this.fontRenderer != null)
        {
            if (this.field_50041_n > var2)
            {
                this.field_50041_n = var2;
            }

            int var3 = this.func_50019_l();
            String var4 = this.fontRenderer.trimStringToWidth(this.text.substring(this.field_50041_n), var3);
            int var5 = var4.length() + this.field_50041_n;

            if (par1 == this.field_50041_n)
            {
                this.field_50041_n -= this.fontRenderer.trimStringToWidth(this.text, var3, true).length();
            }

            if (par1 > var5)
            {
                this.field_50041_n += par1 - var5;
            }
            else if (par1 <= this.field_50041_n)
            {
                this.field_50041_n -= this.field_50041_n - par1;
            }

            if (this.field_50041_n < 0)
            {
                this.field_50041_n = 0;
            }

            if (this.field_50041_n > var2)
            {
                this.field_50041_n = var2;
            }
        }
    }