Fix forge 1.13 installation
This commit is contained in:
@@ -58,7 +58,8 @@ public final class ForgeInstallTask extends TaskResult<Version> {
|
||||
public void preExecute() throws Exception {
|
||||
installer = Files.createTempFile("forge-installer", ".jar");
|
||||
|
||||
dependent = new FileDownloadTask(NetworkUtils.toURL(remote.getUrl()), installer.toFile());
|
||||
dependent = new FileDownloadTask(NetworkUtils.toURL(remote.getUrl()), installer.toFile())
|
||||
.setCaching(true);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -34,14 +34,16 @@ public class ForgeNewInstallProfile {
|
||||
private final int spec;
|
||||
private final String minecraft;
|
||||
private final String json;
|
||||
private final Artifact path;
|
||||
private final List<Library> libraries;
|
||||
private final List<Processor> processors;
|
||||
private final Map<String, Datum> data;
|
||||
|
||||
public ForgeNewInstallProfile(int spec, String minecraft, String json, List<Library> libraries, List<Processor> processors, Map<String, Datum> data) {
|
||||
public ForgeNewInstallProfile(int spec, String minecraft, String json, Artifact path, List<Library> libraries, List<Processor> processors, Map<String, Datum> data) {
|
||||
this.spec = spec;
|
||||
this.minecraft = minecraft;
|
||||
this.json = json;
|
||||
this.path = path;
|
||||
this.libraries = libraries;
|
||||
this.processors = processors;
|
||||
this.data = data;
|
||||
@@ -69,6 +71,14 @@ public class ForgeNewInstallProfile {
|
||||
return json;
|
||||
}
|
||||
|
||||
/**
|
||||
* Maven artifact path for the main jar to install.
|
||||
* @return artifact path of the main jar.
|
||||
*/
|
||||
public Artifact getPath() {
|
||||
return path;
|
||||
}
|
||||
|
||||
/**
|
||||
* Libraries that processors depend on.
|
||||
* @return the required dependencies.
|
||||
|
||||
@@ -107,6 +107,14 @@ public class ForgeNewInstallTask extends TaskResult<Version> {
|
||||
FileUtils.copyFile(file, dest);
|
||||
}
|
||||
}
|
||||
|
||||
{
|
||||
Path mainJar = profile.getPath().getPath(fs.getPath("maven"));
|
||||
if (Files.exists(mainJar)) {
|
||||
Path dest = gameRepository.getArtifactFile(version, profile.getPath());
|
||||
FileUtils.copyFile(mainJar, dest);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
dependents.add(new GameLibrariesTask(dependencyManager, version, profile.getLibraries()));
|
||||
|
||||
@@ -89,6 +89,7 @@ public final class GameAssetDownloadTask extends Task {
|
||||
String url = dependencyManager.getDownloadProvider().getAssetBaseURL() + assetObject.getLocation();
|
||||
FileDownloadTask task = new FileDownloadTask(NetworkUtils.toURL(url), file, new FileDownloadTask.IntegrityCheck("SHA-1", assetObject.getHash()));
|
||||
task.setName(assetObject.getHash());
|
||||
task.setCaching(true);
|
||||
dependencies.add(task
|
||||
.setCacheRepository(dependencyManager.getCacheRepository())
|
||||
.setCaching(true)
|
||||
|
||||
@@ -128,12 +128,12 @@ public class LibraryDownloadTask extends Task {
|
||||
try {
|
||||
URL packXz = NetworkUtils.toURL(url + ".pack.xz");
|
||||
if (NetworkUtils.urlExists(packXz)) {
|
||||
task = new FileDownloadTask(packXz, xzFile, null);
|
||||
task = new FileDownloadTask(packXz, xzFile, null).setCaching(true);
|
||||
xz = true;
|
||||
} else {
|
||||
task = new FileDownloadTask(NetworkUtils.toURL(url),
|
||||
jar,
|
||||
library.getDownload().getSha1() != null ? new IntegrityCheck("SHA-1", library.getDownload().getSha1()) : null);
|
||||
library.getDownload().getSha1() != null ? new IntegrityCheck("SHA-1", library.getDownload().getSha1()) : null).setCaching(true);
|
||||
xz = false;
|
||||
}
|
||||
} catch (IOException e) {
|
||||
|
||||
@@ -140,7 +140,7 @@ public final class CurseCompletionTask extends Task {
|
||||
for (CurseManifestFile file : newManifest.getFiles())
|
||||
if (StringUtils.isNotBlank(file.getFileName())) {
|
||||
if (!modManager.hasSimpleMod(file.getFileName())) {
|
||||
dependencies.add(new FileDownloadTask(file.getUrl(), modManager.getSimpleModPath(file.getFileName()).toFile()));
|
||||
dependencies.add(new FileDownloadTask(file.getUrl(), modManager.getSimpleModPath(file.getFileName()).toFile()).setCaching(true));
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user