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 @@ -19,6 +19,7 @@
import me.itzg.helpers.modrinth.model.Version;
import me.itzg.helpers.modrinth.model.VersionFile;
import me.itzg.helpers.modrinth.model.VersionType;
import me.itzg.helpers.quilt.QuiltInstaller;
import picocli.CommandLine;
import picocli.CommandLine.ExitCode;
import picocli.CommandLine.Option;
Expand Down Expand Up @@ -216,12 +217,6 @@ private Mono<ModrinthModpackManifest> processModpackZip(ModrinthApiClient apiCli
new InvalidParameterException("Requested modpack is not for minecraft: " + modpackIndex.getGame()));
}

// Fail-fast for Quilt non-support
if (modpackIndex.getDependencies().get(DependencyId.quiltLoader) != null) {
throw new GenericException(
"Quilt mod loader is not yet supported. Please choose alternate file that uses Fabric, if possible");
}

return processModpackFiles(apiClient, modpackIndex)
.collectList()
.map(modFiles ->
Expand Down Expand Up @@ -290,8 +285,16 @@ private String applyModloader(Map<DependencyId, String> dependencies) throws IOE
return minecraftVersion;
}

if (dependencies.get(DependencyId.quiltLoader) != null) {
throw new GenericException("Quilt modloader is not yet supported");
final String quiltVersion = dependencies.get(DependencyId.quiltLoader);
if (quiltVersion != null) {
new QuiltInstaller(QuiltInstaller.DEFAULT_REPO_URL,
sharedFetchArgs.options(),
outputDirectory,
minecraftVersion
)
.setResultsFile(resultsFile)
.setLoaderVersion(quiltVersion)
.install();
}

return minecraftVersion;
Expand Down
3 changes: 2 additions & 1 deletion src/main/java/me/itzg/helpers/modrinth/ModpackLoader.java
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,8 @@
*/
public enum ModpackLoader {
fabric,
forge;
forge,
quilt;

public Loader asLoader() {
return Loader.valueOf(this.name());
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ public class InstallQuiltCommand implements Callable<Integer> {
@ArgGroup(exclusive = false)
SharedFetchArgs sharedFetchArgs = new SharedFetchArgs();

@Option(names = "--repo-url", defaultValue = "https://maven.quiltmc.org/repository/release",
@Option(names = "--repo-url", defaultValue = QuiltInstaller.DEFAULT_REPO_URL,
description = "Default: ${DEFAULT-VALUE}"
)
String repoUrl;
Expand Down
2 changes: 1 addition & 1 deletion src/main/java/me/itzg/helpers/quilt/QuiltInstaller.java
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ public class QuiltInstaller {
public static final String LOADER_ARTIFACT_ID = "quilt-loader";
public static final String INSTALLER_ARTIFACT = "quilt-installer";
public static final String QUILT_GROUP_ID = "org.quiltmc";
public static final String DEFAULT_REPO_URL = "https://maven.quiltmc.org/repository/release";

private final MavenRepoApi mavenRepoApi;
private final Path outputDir;
Expand Down Expand Up @@ -143,7 +144,6 @@ private QuiltManifest runInstaller(Path installerPath, String resolvedLoaderVers

if (resultsFile != null) {
try (ResultsFileWriter resultsFileWriter = new ResultsFileWriter(resultsFile, false)) {
resultsFileWriter.write("VERSION", minecraftVersion);
resultsFileWriter.write("SERVER", resolvedLauncher.toString());
resultsFileWriter.write("FAMILY", "FABRIC");
} catch (IOException e) {
Expand Down