aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/main/java/makamys/neodymium/util/virtualjar/VirtualJar.java7
1 files changed, 6 insertions, 1 deletions
diff --git a/src/main/java/makamys/neodymium/util/virtualjar/VirtualJar.java b/src/main/java/makamys/neodymium/util/virtualjar/VirtualJar.java
index d5049b4..21f5f33 100644
--- a/src/main/java/makamys/neodymium/util/virtualjar/VirtualJar.java
+++ b/src/main/java/makamys/neodymium/util/virtualjar/VirtualJar.java
@@ -30,7 +30,7 @@ public class VirtualJar {
LOGGER.debug("Registering URL protocol handler: " + PROTOCOL);
// We want the Handler to always be loaded by the same class loader.
- Launch.classLoader.addClassLoaderExclusion("makamys." + MODID + ".util.virtualjar.protocol." + PROTOCOL);
+ Launch.classLoader.addClassLoaderExclusion(getPackage() + ".protocol." + PROTOCOL + ".");
// The Handler is loaded by the AppClassLoader, but it needs to access the state of VirtualJar, which is loaded
// by the LaunchClassLoader. The solution? Make the Handler just a proxy that delegates the real work to
@@ -42,6 +42,11 @@ public class VirtualJar {
registered = true;
}
+ private static String getPackage() {
+ String name = VirtualJar.class.getName();
+ return name.substring(0, name.lastIndexOf('.'));
+ }
+
public static void add(IVirtualJar jar) {
registerHandler();