@Override
    public void run() {
        File musicFolder = new File(dir, "music");
        File stepsFolder = new File(new File(dir, "newsound"), "step");
        File digFolder = new File(new File(dir, "sound3"), "dig");
        File randomFolder = new File(new File(dir, "sound3"), "random");
        File newMusicFolder = new File(dir, "newmusic");

        try {
            GameSettings.PercentString = "5%";
            GameSettings.StatusString = "Downloading music and sounds...";
            LogUtil.logInfo("Downloading music and sounds...");

            int percent = 5;
            for (String fileName : resourceFiles) {
                if (percent >= 80) {
                    percent = 80;
                }
                percent += 3;
                File file = new File(dir, fileName);
                if (!file.exists()) {
                    GameSettings.PercentString = percent + "%";
                    GameSettings.StatusString = "Downloading https://s3.amazonaws.com/MinecraftResources/"
                            + fileName + "...";
                    LogUtil.logInfo("Downloading https://s3.amazonaws.com/MinecraftResources/"
                            + fileName);
                    URL url = new URL("https://s3.amazonaws.com/MinecraftResources/" + fileName);
                    try (InputStream is = url.openStream()) {
                        StreamingUtil.copyStreamToFile(is, file);
                    }

                    GameSettings.StatusString = "Downloaded https://s3.amazonaws.com/MinecraftResources/"
                            + fileName + "!";
                    LogUtil.logInfo("Downloaded https://s3.amazonaws.com/MinecraftResources/"
                            + fileName);
                }
            }
            GameSettings.PercentString = "85%";
            GameSettings.StatusString = "Downloaded music and sounds!";
            LogUtil.logInfo("Done downloading music and sounds!");
            GameSettings.StatusString = "";
            GameSettings.PercentString = "";
            done = true;
        } catch (Exception ex) {
            LogUtil.logError("Error downloading music and sounds!", ex);
        }

        for (int i = 1; i <= 3; i++) {
            minecraft.sound.registerMusic("calm" + i + ".ogg", new File(musicFolder, "calm" + i
                    + ".ogg"));
            minecraft.sound.registerSound(new File(randomFolder, "glass" + i + ".ogg"),
                    "random/glass" + i + ".ogg");
        }

        for (int i = 1; i <= 4; i++) {
            minecraft.sound.registerMusic("calm" + i + ".ogg", new File(newMusicFolder, "hal" + i
                    + ".ogg"));
            minecraft.sound.registerSound(new File(stepsFolder, "grass" + i + ".ogg"), "step/grass"
                    + i + ".ogg");
            minecraft.sound.registerSound(new File(stepsFolder, "gravel" + i + ".ogg"),
                    "step/gravel" + i + ".ogg");
            minecraft.sound.registerSound(new File(stepsFolder, "stone" + i + ".ogg"), "step/stone"
                    + i + ".ogg");
            minecraft.sound.registerSound(new File(stepsFolder, "wood" + i + ".ogg"), "step/wood"
                    + i + ".ogg");
            minecraft.sound.registerSound(new File(stepsFolder, "cloth" + i + ".ogg"), "step/cloth"
                    + i + ".ogg");
            minecraft.sound.registerSound(new File(stepsFolder, "sand" + i + ".ogg"), "step/sand"
                    + i + ".ogg");
            minecraft.sound.registerSound(new File(stepsFolder, "snow" + i + ".ogg"), "step/snow"
                    + i + ".ogg");
            minecraft.sound.registerSound(new File(digFolder, "grass" + i + ".ogg"), "dig/grass"
                    + i + ".ogg");
            minecraft.sound.registerSound(new File(digFolder, "gravel" + i + ".ogg"), "dig/gravel"
                    + i + ".ogg");
            minecraft.sound.registerSound(new File(digFolder, "stone" + i + ".ogg"), "dig/stone"
                    + i + ".ogg");
            minecraft.sound.registerSound(new File(digFolder, "wood" + i + ".ogg"), "dig/wood" + i
                    + ".ogg");
            minecraft.sound.registerSound(new File(digFolder, "cloth" + i + ".ogg"), "dig/cloth"
                    + i + ".ogg");
            minecraft.sound.registerSound(new File(digFolder, "sand" + i + ".ogg"), "dig/sand" + i
                    + ".ogg");
            minecraft.sound.registerSound(new File(digFolder, "snow" + i + ".ogg"), "dig/snow" + i
                    + ".ogg");
        }

        finished = true;
    }