From f9620d09b54d6f251c1c86087df65d87a0c74a45 Mon Sep 17 00:00:00 2001 From: Kir_Antipov Date: Wed, 3 Jan 2024 18:17:33 +0000 Subject: [PATCH] Fixed version normalization for legacy versions --- src/games/minecraft/minecraft-version-lookup.ts | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/games/minecraft/minecraft-version-lookup.ts b/src/games/minecraft/minecraft-version-lookup.ts index 63e94c8..50e2fcc 100644 --- a/src/games/minecraft/minecraft-version-lookup.ts +++ b/src/games/minecraft/minecraft-version-lookup.ts @@ -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}`; }