fix modrinth modpack install (#1702)
* fix modrinth modpack install * fix NullPointerException
This commit is contained in:
@@ -102,6 +102,8 @@ public class ModrinthCompletionTask extends Task<Void> {
|
|||||||
Path runDirectory = repository.getRunDirectory(version).toPath();
|
Path runDirectory = repository.getRunDirectory(version).toPath();
|
||||||
|
|
||||||
for (ModrinthManifest.File file : manifest.getFiles()) {
|
for (ModrinthManifest.File file : manifest.getFiles()) {
|
||||||
|
if (file.getEnv() != null && file.getEnv().getOrDefault("client", "required").equals("unsupported"))
|
||||||
|
continue;
|
||||||
Path filePath = runDirectory.resolve(file.getPath());
|
Path filePath = runDirectory.resolve(file.getPath());
|
||||||
if (!Files.exists(filePath) && !file.getDownloads().isEmpty()) {
|
if (!Files.exists(filePath) && !file.getDownloads().isEmpty()) {
|
||||||
FileDownloadTask task = new FileDownloadTask(file.getDownloads().get(0), filePath.toFile());
|
FileDownloadTask task = new FileDownloadTask(file.getDownloads().get(0), filePath.toFile());
|
||||||
|
|||||||
Reference in New Issue
Block a user