adds forge support, fixes some critical errors

This commit is contained in:
2023-10-08 13:38:00 -06:00
parent 6944cbb9f7
commit ad4629576c
21 changed files with 3484 additions and 132 deletions

View File

@@ -74,6 +74,13 @@ export type ModrinthProject = {
monetization_status: string;
};
export type ModrinthGameVersion = {
version: string;
version_type: string;
data: string;
major: boolean;
}
export class Modrinth {
static apiRoot = "https://api.modrinth.com/v2";
@@ -109,4 +116,9 @@ export class Modrinth {
const res = await fetch(this.apiRoot + "/project/" + id);
return await res.json() as ModrinthProject;
}
static async getGameVersions() {
const res = await fetch(this.apiRoot + '/tag/game_version');
return await res.json() as ModrinthGameVersion[];
}
}