Skip to content

Commit 8304be7

Browse files
feat: add dependencies to ignored mods
1 parent 6ce08f9 commit 8304be7

File tree

1 file changed

+8
-3
lines changed

1 file changed

+8
-3
lines changed

src/main/java/gg/skytils/skytilsmod/tweaker/DependencyLoader.java

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@
1919
package gg.skytils.skytilsmod.tweaker;
2020

2121
import com.aayushatharva.brotli4j.Brotli4jLoader;
22+
import net.minecraftforge.fml.relauncher.CoreModManager;
2223

2324
import java.io.File;
2425
import java.io.InputStream;
@@ -40,7 +41,7 @@ public static void loadDependencies() {
4041
if (Security.getProvider("BC") == null) loadBCProv();
4142
}
4243

43-
public static File loadDependency(String path) throws Throwable {
44+
public static File loadDependency(String path, boolean isMod) throws Throwable {
4445
File downloadLocation = new File("./libraries/" + path);
4546
Path downloadPath = downloadLocation.toPath();
4647

@@ -55,12 +56,16 @@ public static File loadDependency(String path) throws Throwable {
5556

5657
addToClasspath(downloadLocation.toURI().toURL());
5758

59+
if (!isMod) {
60+
CoreModManager.getIgnoredMods().add(downloadLocation.getName());
61+
}
62+
5863
return downloadLocation;
5964
}
6065

6166
public static void loadBCProv() {
6267
try {
63-
loadDependency("org/bouncycastle/bcprov-jdk18on/1.78.1/bcprov-jdk18on-1.78.1.jar");
68+
loadDependency("org/bouncycastle/bcprov-jdk18on/1.78.1/bcprov-jdk18on-1.78.1.jar", false);
6469
System.out.println("Bouncy Castle provider loaded");
6570
} catch (Throwable t) {
6671
System.out.println("Failed to load Bouncy Castle providers");
@@ -77,7 +82,7 @@ public static void loadBrotli() {
7782

7883
try {
7984
String brotli4jPlatform = getBrotli4jPlatform();
80-
loadDependency(String.format("com/aayushatharva/brotli4j/native-%s/1.16.0/native-%s-1.16.0.jar", brotli4jPlatform, brotli4jPlatform));
85+
loadDependency(String.format("com/aayushatharva/brotli4j/native-%s/1.16.0/native-%s-1.16.0.jar", brotli4jPlatform, brotli4jPlatform), false);
8186
Brotli4jLoader.ensureAvailability();
8287
hasNativeBrotli = true;
8388
System.out.println("Native Brotli loaded");

0 commit comments

Comments
 (0)