Fix forge 1.13 installation
This commit is contained in:
@@ -112,7 +112,7 @@ def createExecutable(String suffix, String header) {
|
|||||||
|
|
||||||
processResources {
|
processResources {
|
||||||
ext.convertToBSS = { String resource ->
|
ext.convertToBSS = { String resource ->
|
||||||
exclude resource
|
// exclude resource
|
||||||
doFirst {
|
doFirst {
|
||||||
def cssFile = new File(this.projectDir, "src/main/resources/" + resource)
|
def cssFile = new File(this.projectDir, "src/main/resources/" + resource)
|
||||||
def bssFile = new File(this.projectDir, "build/compiled-resources/" + resource[0..-4] + "bss")
|
def bssFile = new File(this.projectDir, "build/compiled-resources/" + resource[0..-4] + "bss")
|
||||||
|
|||||||
@@ -95,7 +95,7 @@ download.failed=Failed to download
|
|||||||
download.failed.empty=No candidates. Click here to return.
|
download.failed.empty=No candidates. Click here to return.
|
||||||
download.failed.refresh=Unable to load version list. Click here to retry.
|
download.failed.refresh=Unable to load version list. Click here to retry.
|
||||||
download.provider.bmclapi=BMCLAPI (bangbang93, https://bmclapi2.bangbang93.com/)
|
download.provider.bmclapi=BMCLAPI (bangbang93, https://bmclapi2.bangbang93.com/)
|
||||||
download.provider.mojang=Mojang
|
download.provider.mojang=Mojang (Forge and OptiFine installation being downloaded from BMCLAPI)
|
||||||
|
|
||||||
extension.bat=Windows Bat file
|
extension.bat=Windows Bat file
|
||||||
extension.mod=Mod file
|
extension.mod=Mod file
|
||||||
|
|||||||
@@ -94,7 +94,7 @@ download.failed=下載失敗
|
|||||||
download.failed.empty=沒有可供安裝的版本,點擊此處返回。
|
download.failed.empty=沒有可供安裝的版本,點擊此處返回。
|
||||||
download.failed.refresh=載入版本列表失敗,點擊此處重試。
|
download.failed.refresh=載入版本列表失敗,點擊此處重試。
|
||||||
download.provider.bmclapi=BMCLAPI(bangbang93,https://bmclapi2.bangbang93.com/)
|
download.provider.bmclapi=BMCLAPI(bangbang93,https://bmclapi2.bangbang93.com/)
|
||||||
download.provider.mojang=官方伺服器(Mojang)
|
download.provider.mojang=官方伺服器(Forge 和 OptiFine 自動安裝的下載來源是 BMCLAPI)
|
||||||
|
|
||||||
extension.bat=Windows 腳本
|
extension.bat=Windows 腳本
|
||||||
extension.mod=模組檔案
|
extension.mod=模組檔案
|
||||||
|
|||||||
@@ -94,7 +94,7 @@ download.failed=下载失败
|
|||||||
download.failed.empty=没有可供安装的版本,点击此处返回。
|
download.failed.empty=没有可供安装的版本,点击此处返回。
|
||||||
download.failed.refresh=加载版本列表失败,点击此处重试。
|
download.failed.refresh=加载版本列表失败,点击此处重试。
|
||||||
download.provider.bmclapi=BMCLAPI(bangbang93,https://bmclapi2.bangbang93.com/)
|
download.provider.bmclapi=BMCLAPI(bangbang93,https://bmclapi2.bangbang93.com/)
|
||||||
download.provider.mojang=官方(Mojang)
|
download.provider.mojang=官方(Forge 和 OptiFine 自动安装使用 BMCLAPI 下载源)
|
||||||
|
|
||||||
extension.bat=Windows 脚本
|
extension.bat=Windows 脚本
|
||||||
extension.mod=模组文件
|
extension.mod=模组文件
|
||||||
|
|||||||
@@ -58,7 +58,8 @@ public final class ForgeInstallTask extends TaskResult<Version> {
|
|||||||
public void preExecute() throws Exception {
|
public void preExecute() throws Exception {
|
||||||
installer = Files.createTempFile("forge-installer", ".jar");
|
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
|
@Override
|
||||||
|
|||||||
@@ -34,14 +34,16 @@ public class ForgeNewInstallProfile {
|
|||||||
private final int spec;
|
private final int spec;
|
||||||
private final String minecraft;
|
private final String minecraft;
|
||||||
private final String json;
|
private final String json;
|
||||||
|
private final Artifact path;
|
||||||
private final List<Library> libraries;
|
private final List<Library> libraries;
|
||||||
private final List<Processor> processors;
|
private final List<Processor> processors;
|
||||||
private final Map<String, Datum> data;
|
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.spec = spec;
|
||||||
this.minecraft = minecraft;
|
this.minecraft = minecraft;
|
||||||
this.json = json;
|
this.json = json;
|
||||||
|
this.path = path;
|
||||||
this.libraries = libraries;
|
this.libraries = libraries;
|
||||||
this.processors = processors;
|
this.processors = processors;
|
||||||
this.data = data;
|
this.data = data;
|
||||||
@@ -69,6 +71,14 @@ public class ForgeNewInstallProfile {
|
|||||||
return json;
|
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.
|
* Libraries that processors depend on.
|
||||||
* @return the required dependencies.
|
* @return the required dependencies.
|
||||||
|
|||||||
@@ -107,6 +107,14 @@ public class ForgeNewInstallTask extends TaskResult<Version> {
|
|||||||
FileUtils.copyFile(file, dest);
|
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()));
|
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();
|
String url = dependencyManager.getDownloadProvider().getAssetBaseURL() + assetObject.getLocation();
|
||||||
FileDownloadTask task = new FileDownloadTask(NetworkUtils.toURL(url), file, new FileDownloadTask.IntegrityCheck("SHA-1", assetObject.getHash()));
|
FileDownloadTask task = new FileDownloadTask(NetworkUtils.toURL(url), file, new FileDownloadTask.IntegrityCheck("SHA-1", assetObject.getHash()));
|
||||||
task.setName(assetObject.getHash());
|
task.setName(assetObject.getHash());
|
||||||
|
task.setCaching(true);
|
||||||
dependencies.add(task
|
dependencies.add(task
|
||||||
.setCacheRepository(dependencyManager.getCacheRepository())
|
.setCacheRepository(dependencyManager.getCacheRepository())
|
||||||
.setCaching(true)
|
.setCaching(true)
|
||||||
|
|||||||
@@ -128,12 +128,12 @@ public class LibraryDownloadTask extends Task {
|
|||||||
try {
|
try {
|
||||||
URL packXz = NetworkUtils.toURL(url + ".pack.xz");
|
URL packXz = NetworkUtils.toURL(url + ".pack.xz");
|
||||||
if (NetworkUtils.urlExists(packXz)) {
|
if (NetworkUtils.urlExists(packXz)) {
|
||||||
task = new FileDownloadTask(packXz, xzFile, null);
|
task = new FileDownloadTask(packXz, xzFile, null).setCaching(true);
|
||||||
xz = true;
|
xz = true;
|
||||||
} else {
|
} else {
|
||||||
task = new FileDownloadTask(NetworkUtils.toURL(url),
|
task = new FileDownloadTask(NetworkUtils.toURL(url),
|
||||||
jar,
|
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;
|
xz = false;
|
||||||
}
|
}
|
||||||
} catch (IOException e) {
|
} catch (IOException e) {
|
||||||
|
|||||||
@@ -140,7 +140,7 @@ public final class CurseCompletionTask extends Task {
|
|||||||
for (CurseManifestFile file : newManifest.getFiles())
|
for (CurseManifestFile file : newManifest.getFiles())
|
||||||
if (StringUtils.isNotBlank(file.getFileName())) {
|
if (StringUtils.isNotBlank(file.getFileName())) {
|
||||||
if (!modManager.hasSimpleMod(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