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

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

            File file = new File(resourcesFolder, par2Str);

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

                if (closing)
                {
                    return;
                }
            }

            mc.installResource(par2Str, file);
        }
        catch (Exception exception)
        {
            exception.printStackTrace();
        }
    }