diff options
Diffstat (limited to 'spark-forge')
-rw-r--r-- | spark-forge/src/main/java/me/lucko/spark/forge/ForgeClassSourceLookup.java | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/spark-forge/src/main/java/me/lucko/spark/forge/ForgeClassSourceLookup.java b/spark-forge/src/main/java/me/lucko/spark/forge/ForgeClassSourceLookup.java index fc4af30..7900bc3 100644 --- a/spark-forge/src/main/java/me/lucko/spark/forge/ForgeClassSourceLookup.java +++ b/spark-forge/src/main/java/me/lucko/spark/forge/ForgeClassSourceLookup.java @@ -22,15 +22,15 @@ package me.lucko.spark.forge; import me.lucko.spark.common.util.ClassSourceLookup; -import java.net.URL; +import cpw.mods.modlauncher.TransformingClassLoader; -public class ForgeClassSourceLookup extends ClassSourceLookup.ByCodeSource { +public class ForgeClassSourceLookup implements ClassSourceLookup { @Override - protected String identifyUrl(URL url) { - if (url.getProtocol().equals("modjar")) { - String host = url.getHost(); - return host.equals("forge") ? null : host; + public String identify(Class<?> clazz) { + if (clazz.getClassLoader() instanceof TransformingClassLoader) { + String name = clazz.getModule().getName(); + return name.equals("forge") || name.equals("minecraft") ? null : name; } return null; } |