Skip to content

Commit c02b787

Browse files
committed
use the config in the dependency loader for toggling downloads
1 parent ed7ca48 commit c02b787

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

src/main/java/com/falsepattern/lib/dependencies/DependencyLoader.java

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,8 @@
1515
import java.util.Map;
1616
import java.util.Set;
1717
import javax.net.ssl.HttpsURLConnection;
18+
19+
import com.falsepattern.lib.internal.LibraryConfig;
1820
import lombok.Builder;
1921
import lombok.NonNull;
2022
import lombok.val;
@@ -127,6 +129,14 @@ public static void loadLibrary(String loadingModId,
127129
}
128130
}
129131
}
132+
if (!LibraryConfig.ENABLE_LIBRARY_DOWNLOADS) {
133+
val errorMessage = "Failed to load library " + groupId + ":" + artifactId + ":" + preferredVersion +
134+
((suffix != null) ? ":" + suffix : "") + ": FalsePatternLib library downloading has " +
135+
"been disabled in the config, and the library is not present on disk! Requested by mod: " +
136+
loadingModId;
137+
FalsePatternLib.getLog().fatal(errorMessage);
138+
throw new IllegalStateException(errorMessage);
139+
}
130140
for (var repo : mavenRepositories) {
131141
try {
132142
if (!repo.endsWith("/")) {

0 commit comments

Comments
 (0)