mirror of
https://github.com/HMCL-dev/HMCL.git
synced 2025-01-24 14:34:15 +08:00
fix modrinth modpack install (#1702)
* fix modrinth modpack install * fix NullPointerException
This commit is contained in:
parent
6a81f4d240
commit
5fe1ef899d
@ -102,6 +102,8 @@ public class ModrinthCompletionTask extends Task<Void> {
|
||||
Path runDirectory = repository.getRunDirectory(version).toPath();
|
||||
|
||||
for (ModrinthManifest.File file : manifest.getFiles()) {
|
||||
if (file.getEnv() != null && file.getEnv().getOrDefault("client", "required").equals("unsupported"))
|
||||
continue;
|
||||
Path filePath = runDirectory.resolve(file.getPath());
|
||||
if (!Files.exists(filePath) && !file.getDownloads().isEmpty()) {
|
||||
FileDownloadTask task = new FileDownloadTask(file.getDownloads().get(0), filePath.toFile());
|
||||
|
Loading…
Reference in New Issue
Block a user