Fix fabricApi.module does not respecting offline mode. Closes #412

dev/0.11
modmuss50 2021-07-16 23:25:23 +01:00
parent 69caaccb07
commit a73696a83f
1 changed files with 8 additions and 0 deletions

View File

@ -107,6 +107,14 @@ public class FabricApiExtension {
File mavenPom = new File(extension.getFiles().getUserCache(), "fabric-api/" + fabricApiVersion + ".pom");
if (project.getGradle().getStartParameter().isOffline()) {
if (!mavenPom.exists()) {
throw new RuntimeException("Cannot retrieve fabric-api pom due to being offline");
}
return mavenPom;
}
try {
URL url = new URL(String.format("https://maven.fabricmc.net/net/fabricmc/fabric-api/fabric-api/%1$s/fabric-api-%1$s.pom", fabricApiVersion));
DownloadUtil.downloadIfChanged(url, mavenPom, project.getLogger());