Skip to content

Commit

Permalink
Merge pull request #146 from TaigoStudio/master
Browse files Browse the repository at this point in the history
add support 1.8.8 and 1.8
  • Loading branch information
laolarou726 authored May 9, 2024
2 parents 70302e8 + 4dea031 commit 85432fc
Showing 1 changed file with 7 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,12 @@ public static string GetForgeArtifactVersion(string mcVersion, string forgeVersi
{
var mcVer = new Version(mcVersion);

return mcVer.Minor is >= 7 and <= 8
? $"{mcVersion}-{forgeVersion}-{mcVersion}"
: $"{mcVersion}-{forgeVersion}";
return (mcVer.Minor, mcVer.Build) switch
{
( 8, 8 or -1) => $"{mcVersion}-{forgeVersion}", //1.8.8, 1.8
( >= 7 and <= 8, _) => $"{mcVersion}-{forgeVersion}-{mcVersion}", //1.7 - 1.8, 1.8.9
_ => $"{mcVersion}-{forgeVersion}" //1.8.9+
};
}

public static bool IsLegacyForgeInstaller(string forgeExecutable, string forgeVersion)
Expand All @@ -30,4 +33,4 @@ public static bool IsLegacyForgeInstaller(string forgeExecutable, string forgeVe

return legacyUniversalJar && installProfileJson;
}
}
}

0 comments on commit 85432fc

Please sign in to comment.