private void downloadAndInstallResource(URL par1URL, String par2Str, long par3, int par5)
    {
        try
        {
            int var6 = par2Str.indexOf("/");
            String var7 = par2Str.substring(0, var6);

            if (!var7.equals("sound") && !var7.equals("newsound"))
            {
                if (par5 != 1)
                {
                    return;
                }
            }
            else if (par5 != 0)
            {
                return;
            }

            File var8 = new File(this.resourcesFolder, par2Str);

            if (!var8.exists() || var8.length() != par3)
            {
                var8.getParentFile().mkdirs();
                String var9 = par2Str.replaceAll(" ", "%20");
                this.downloadResource(new URL(par1URL, var9), var8, par3);

                if (this.closing)
                {
                    return;
                }
            }

            this.mc.installResource(par2Str, var8);
        }
        catch (Exception var10)
        {
            var10.printStackTrace();
        }
    }