Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -142,6 +142,9 @@ public class CurseForgeInstaller {
@Getter @Setter
Duration fileDownloadRetryMinDelay = Duration.ofSeconds(5);

@Getter @Setter
private String customModLoaderVersion;

/**
*/
public void installFromModpackZip(Path modpackZip, String slug) {
Expand Down Expand Up @@ -972,7 +975,13 @@ private void prepareModLoader(String id, String minecraftVersion) {
}

final String provider = parts[0];
final String loaderVersion = parts.length == 2 ? parts[1] : parts[2];
String loaderVersion = parts.length == 2 ? parts[1] : parts[2];

// Override with custom versions if provided
if (customModLoaderVersion != null) {
log.info("Overriding mod loader version from {} to {}", loaderVersion, customModLoaderVersion);
loaderVersion = customModLoaderVersion;
}

try (SharedFetch sharedFetch = Fetch.sharedFetch("install-curseforge", sharedFetchOptions)) {

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -89,6 +89,11 @@ public class InstallCurseForgeCommand implements Callable<Integer> {
)
String apiKey;

@Option(names = "--mod-loader-version", paramLabel = "VERSION",
description = "Override the mod loader version specified in the modpack"
)
String modLoaderVersion;

@ArgGroup(exclusive = false)
ExcludeIncludeArgs excludeIncludeArgs = new ExcludeIncludeArgs();

Expand Down Expand Up @@ -233,7 +238,8 @@ public Integer call() throws Exception {
.setForgeUrlArgs(forgeUrlArgs)
.setMaxConcurrentDownloads(maxConcurrentDownloads)
.setFileDownloadRetries(fileDownloadRetries)
.setFileDownloadRetryMinDelay(fileDownloadRetryMinDelay);
.setFileDownloadRetryMinDelay(fileDownloadRetryMinDelay)
.setCustomModLoaderVersion(modLoaderVersion);

if (apiBaseUrl != null) {
installer.setApiBaseUrl(apiBaseUrl);
Expand Down