Fix fabricApi.module does not respecting offline mode. Closes #412
This commit is contained in:
parent
69caaccb07
commit
a73696a83f
1 changed files with 8 additions and 0 deletions
|
@ -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());
|
||||
|
|
Loading…
Reference in a new issue