Fixed version normalization for legacy versions

This commit is contained in:
Kir_Antipov 2024-01-03 18:17:33 +00:00
parent 926b1a264b
commit f9620d09b5

View file

@ -185,7 +185,7 @@ function normalizeUnknownMinecraftVersion(version: string, releaseVersion?: stri
return SPECIAL_VERSIONS.get(version);
}
if (!releaseVersion || version === releaseVersion) {
if (!releaseVersion || version === releaseVersion || version.substring(1).startsWith(releaseVersion)) {
return normalizeOldMinecraftVersion(version);
}
@ -207,6 +207,11 @@ function normalizeUnknownMinecraftVersion(version: string, releaseVersion?: stri
} else {
version = normalizeOldMinecraftVersion(version);
}
if (version.startsWith(`${releaseVersion}-`)) {
return version;
}
return `${releaseVersion}-${version}`;
}