diff --git a/locales/version b/locales/version index ee0b85b..bd6dc88 100644 --- a/locales/version +++ b/locales/version @@ -1 +1 @@ -4.3.0-beta.3 \ No newline at end of file +4.3.0-beta.4 \ No newline at end of file diff --git a/package-lock.json b/package-lock.json index ae04f3b..0976130 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "dmclc", - "version": "4.3.0-beta.3", + "version": "4.3.0-beta.4", "lockfileVersion": 2, "requires": true, "packages": { "": { "name": "dmclc", - "version": "4.3.0-beta.3", + "version": "4.3.0-beta.4", "license": "MIT", "dependencies": { "compressing": "^1.9.1", diff --git a/package.json b/package.json index 08621d8..7c50f38 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "dmclc", - "version": "4.3.0-beta.3", + "version": "4.3.0-beta.4", "description": "Dolphin Minecraft Launcher Core", "typings": "./lib/index.d.ts", "module": "./lib/index.js", diff --git a/src/launcher.ts b/src/launcher.ts index 995c3f1..3c040d8 100644 --- a/src/launcher.ts +++ b/src/launcher.ts @@ -106,7 +106,7 @@ export class Launcher { specialNatives: Record; }; private realRootPath = ""; - static readonly version = "4.3.0-beta.3"; + static readonly version = "4.3.0-beta.4"; /** * Create a new Launcher object. * @throws {@link FormattedError} diff --git a/src/loaders/forge.ts b/src/loaders/forge.ts index fbe36f9..903077c 100644 --- a/src/loaders/forge.ts +++ b/src/loaders/forge.ts @@ -6,6 +6,10 @@ export class ForgeLoader extends ForgeLikeLoader { protected supportsOld = false; name = "forge"; + matchVersion(loader: string, mc: string): boolean { + return loader.startsWith(`${mc}-`); + } + getArchiveBaseName(MCVersion: string): string { return "forge"; } diff --git a/src/loaders/forgelike/forgelike.ts b/src/loaders/forgelike/forgelike.ts index f0e82e3..3b006ca 100644 --- a/src/loaders/forgelike/forgelike.ts +++ b/src/loaders/forgelike/forgelike.ts @@ -34,6 +34,7 @@ export abstract class ForgeLikeLoader implements Loader { if(MCVersion.extras.version === "Unknown") { @@ -48,7 +49,7 @@ export abstract class ForgeLikeLoader implements Loader v.startsWith(`${MCVersion.extras.version}-`)); + return versions.filter((v: string) => this.matchVersion(v, MCVersion.extras.version)); } async install (MCVersion: MinecraftVersion, version: string): Promise { diff --git a/src/loaders/neoforge.ts b/src/loaders/neoforge.ts index f4ea50b..5b4855e 100644 --- a/src/loaders/neoforge.ts +++ b/src/loaders/neoforge.ts @@ -6,8 +6,15 @@ export class NeoForgeLoader extends ForgeLikeLoader { protected supportsOld = false; name = "neoforge"; + matchVersion(loader: string, mc: string): boolean { + if (mc === "1.20.1") { + return loader.startsWith("1.20.1-"); + } else if (mc.includes("-") || mc.includes("w")) return false; + return loader.startsWith(mc.slice(2)); + } + getArchiveBaseName(MCVersion: string): string { - if (MCVersion.startsWith("1.20.1")) { + if (MCVersion === "1.20.1") { return "forge"; } return "neoforge";