public static int downloadInstalledLibraries(String jsonMarker, File librariesDir, IMonitor monitor, List<JsonNode> libraries, int progress, List<String> grabbed, List<String> bad) {
        for (JsonNode library : libraries) {
            String libName = library.getStringValue("name");
            monitor.setNote(String.format("Considering library %s", libName));
            if (library.isBooleanValue(jsonMarker) && library.getBooleanValue(jsonMarker)) {
                String[] nameparts = Iterables.toArray(Splitter.on(':').split(libName), String.class);
                nameparts[0] = nameparts[0].replace('.', '/');
                String jarName = nameparts[1] + '-' + nameparts[2] + ".jar";
                String pathName = nameparts[0] + '/' + nameparts[1] + '/' + nameparts[2] + '/' + jarName;
                File libPath = new File(librariesDir, pathName.replace('/', File.separatorChar));
                String libURL = library.isStringValue("url") ? library.getStringValue("url") + "/" : "https://s3.amazonaws.com/Minecraft.Download/libraries/";
                if (libPath.exists()) {
                    monitor.setNote(String.format("Skipping library at %s", libPath.getPath()));
                    monitor.setProgress(progress++);
                    continue;
                }
                libPath.getParentFile().mkdirs();
                monitor.setNote(String.format("Downloading library %s", libName));
                libURL += pathName;
                if (!downloadFile(libName, libPath, libURL)) {
                    bad.add(libName);
                } else {
                    grabbed.add(libName);
                }
            }
            monitor.setProgress(progress++);
        }
        return progress;
    }