public static List <ClassifierLibrary> SiphonClassifiers(MinecraftProfile ver) { List <ClassifierLibrary> result = new List <ClassifierLibrary>(); foreach (var libc in ver.Libraries) { if (libc.Downloads != null) { JObject obj = libc.Downloads.JSON; if (obj["downloads"]["classifiers"] != null) { if (obj["downloads"]["classifiers"]["natives-windows"] != null) { ClassifierLibrary lib = new ClassifierLibrary(); lib.LibraryDirector = obj["downloads"]["classifiers"]["natives-windows"]["path"].ToString(); lib.SiteURL = obj["downloads"]["classifiers"]["natives-windows"]["url"].ToString(); lib.HashCode = obj["downloads"]["classifiers"]["natives-windows"]["sha1"].ToString(); lib.Profile = ver; result.Add(lib); } } } } return(result); }
public LibraryDownloads(JObject json, MinecraftProfile profile, VersionLibrary parent) { this.Parent = parent; JSON = json; this.Profile = profile; Download.AddRange(ArtifactLibrary.GetLibraryFromLibDownload(this)); Download.AddRange(ClassifierLibrary.GetLibraryFromLibDownload(this)); }
public static List <ClassifierLibrary> GetLibraryFromLibDownload(LibraryDownloads download) { List <ClassifierLibrary> result = new List <ClassifierLibrary>(); JObject obj = download.JSON; if (obj["downloads"]["classifiers"] != null) { if (obj["downloads"]["classifiers"]["natives-windows"] != null) { ClassifierLibrary lib = new ClassifierLibrary(); lib.LibraryDirector = obj["downloads"]["classifiers"]["natives-windows"]["path"].ToString(); lib.SiteURL = obj["downloads"]["classifiers"]["natives-windows"]["url"].ToString(); lib.HashCode = obj["downloads"]["classifiers"]["natives-windows"]["sha1"].ToString(); lib.Profile = download.Profile; result.Add(lib); } } return(result); }