From 3a48a9cd731238c2a5f664362fb073732b426ef5 Mon Sep 17 00:00:00 2001 From: LexManos Date: Sat, 13 Aug 2016 13:28:21 -0700 Subject: [PATCH] Skip searching for mods in the JAVA_HOME directory. Closes #2249 and #2250 --- src/main/java/net/minecraftforge/fml/common/ModClassLoader.java | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/main/java/net/minecraftforge/fml/common/ModClassLoader.java b/src/main/java/net/minecraftforge/fml/common/ModClassLoader.java index ea234836d..8565a6471 100644 --- a/src/main/java/net/minecraftforge/fml/common/ModClassLoader.java +++ b/src/main/java/net/minecraftforge/fml/common/ModClassLoader.java @@ -103,6 +103,8 @@ public class ModClassLoader extends URLClassLoader public boolean isDefaultLibrary(File file) { + String home = System.getProperty("java.home"); // Nullcheck just in case some JVM decides to be stupid + if (home != null && file.getAbsolutePath().startsWith(home)) return true; // Should really pull this from the json somehow, but we dont have that at runtime. String name = file.getName(); if (!name.endsWith(".jar")) return false;