mirror of
https://github.com/HMCL-dev/HMCL.git
synced 2025-09-09 20:06:39 -04:00
update
This commit is contained in:
parent
6e898149ab
commit
df64bb0efa
@ -75,7 +75,9 @@ public final class MinecraftInstanceTask<T> extends Task<ModpackConfiguration<T>
|
|||||||
}
|
}
|
||||||
|
|
||||||
ModpackConfiguration<T> configuration = new ModpackConfiguration<>(manifest, type, name, version, overrides);
|
ModpackConfiguration<T> configuration = new ModpackConfiguration<>(manifest, type, name, version, overrides);
|
||||||
JsonUtils.writeToJsonFile(jsonFile.toPath(), configuration);
|
Path jsonPath = jsonFile.toPath();
|
||||||
|
Files.createDirectories(jsonPath.getParent());
|
||||||
|
JsonUtils.writeToJsonFile(jsonPath, configuration);
|
||||||
setResult(configuration);
|
setResult(configuration);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -28,6 +28,7 @@ import org.jackhuang.hmcl.util.gson.JsonUtils;
|
|||||||
|
|
||||||
import java.io.File;
|
import java.io.File;
|
||||||
import java.io.IOException;
|
import java.io.IOException;
|
||||||
|
import java.nio.file.Files;
|
||||||
import java.nio.file.Path;
|
import java.nio.file.Path;
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
import java.util.Collection;
|
import java.util.Collection;
|
||||||
@ -136,6 +137,7 @@ public final class CurseInstallTask extends Task<Void> {
|
|||||||
}
|
}
|
||||||
|
|
||||||
Path root = repository.getVersionRoot(name).toPath();
|
Path root = repository.getVersionRoot(name).toPath();
|
||||||
|
Files.createDirectories(root);
|
||||||
JsonUtils.writeToJsonFile(root.resolve("manifest.json"), JsonUtils.GSON.toJson(manifest));
|
JsonUtils.writeToJsonFile(root.resolve("manifest.json"), JsonUtils.GSON.toJson(manifest));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -173,6 +173,7 @@ public class McbbsModpackCompletionTask extends CompletableFutureTask<Void> {
|
|||||||
return executor.all(tasks.stream().filter(Objects::nonNull).collect(Collectors.toList()));
|
return executor.all(tasks.stream().filter(Objects::nonNull).collect(Collectors.toList()));
|
||||||
})).thenAcceptAsync(wrapConsumer(unused1 -> {
|
})).thenAcceptAsync(wrapConsumer(unused1 -> {
|
||||||
Path manifestFile = repository.getModpackConfiguration(version).toPath();
|
Path manifestFile = repository.getModpackConfiguration(version).toPath();
|
||||||
|
Files.createDirectories(manifestFile.getParent());
|
||||||
JsonUtils.writeToJsonFile(manifestFile,
|
JsonUtils.writeToJsonFile(manifestFile,
|
||||||
new ModpackConfiguration<>(manifest, this.configuration.getType(), this.manifest.getName(), this.manifest.getVersion(),
|
new ModpackConfiguration<>(manifest, this.configuration.getType(), this.manifest.getName(), this.manifest.getVersion(),
|
||||||
this.manifest.getFiles().stream()
|
this.manifest.getFiles().stream()
|
||||||
|
@ -179,6 +179,7 @@ public class ServerModpackCompletionTask extends Task<Void> {
|
|||||||
public void postExecute() throws Exception {
|
public void postExecute() throws Exception {
|
||||||
if (manifest == null || StringUtils.isBlank(manifest.getManifest().getFileApi())) return;
|
if (manifest == null || StringUtils.isBlank(manifest.getManifest().getFileApi())) return;
|
||||||
Path manifestFile = repository.getModpackConfiguration(version).toPath();
|
Path manifestFile = repository.getModpackConfiguration(version).toPath();
|
||||||
|
Files.createDirectories(manifestFile.getParent());
|
||||||
JsonUtils.writeToJsonFile(manifestFile, new ModpackConfiguration<>(remoteManifest, this.manifest.getType(), this.manifest.getName(), this.manifest.getVersion(), remoteManifest.getFiles()));
|
JsonUtils.writeToJsonFile(manifestFile, new ModpackConfiguration<>(remoteManifest, this.manifest.getType(), this.manifest.getName(), this.manifest.getVersion(), remoteManifest.getFiles()));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user