Skip to content

Commit

Permalink
fix(modpack): installs being broken when installing multiple versions
Browse files Browse the repository at this point in the history
  • Loading branch information
Mathias-Boulay committed Jan 26, 2025
1 parent 5b99165 commit 163cc8e
Showing 1 changed file with 8 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,14 @@ public class ModpackInstaller {
public static ModLoader installModpack(ModDetail modDetail, int selectedVersion, InstallFunction installFunction) throws IOException {
String versionUrl = modDetail.versionUrls[selectedVersion];
String versionHash = modDetail.versionHashes[selectedVersion];
String modpackName = modDetail.title.toLowerCase(Locale.ROOT).trim().replace(" ", "_" );
String modpackName = (modDetail.title.toLowerCase(Locale.ROOT) + " " + modDetail.versionNames[selectedVersion])
.trim().replaceAll("[\\\\/:*?\"<>| \\t\\n]", "_" );
if (versionHash != null) {
modpackName += "_" + versionHash;
}
if (modpackName.length() > 255){
modpackName = modpackName.substring(0,255);
}

// Build a new minecraft instance, folder first

Expand Down

0 comments on commit 163cc8e

Please sign in to comment.