diff --git a/src/main/java/org/dimdev/riftloader/Main.java b/src/main/java/org/dimdev/riftloader/Main.java index a3899ed..347cdfa 100644 --- a/src/main/java/org/dimdev/riftloader/Main.java +++ b/src/main/java/org/dimdev/riftloader/Main.java @@ -138,7 +138,7 @@ public static void runClientInstaller() { // Copy rift jar to libraries try { String source = Main.class.getProtectionDomain().getCodeSource().getLocation().getPath(); - if (source.startsWith("/")) { + if (source.startsWith("/") && osName.contains("win")) { source = source.substring(1); } File riftJar = new File(minecraftFolder, "libraries/org/dimdev/rift/@VERSION@/rift-@VERSION@.jar"); diff --git a/src/main/java/org/dimdev/riftloader/RiftLoader.java b/src/main/java/org/dimdev/riftloader/RiftLoader.java index b5a4fe0..8facf0e 100644 --- a/src/main/java/org/dimdev/riftloader/RiftLoader.java +++ b/src/main/java/org/dimdev/riftloader/RiftLoader.java @@ -243,6 +243,13 @@ public void loadListeners(Class listenerInterface) { for (Class listenerClass : listenerClasses) { if (listenerInterface.isAssignableFrom(listenerClass)) { + // Initialize the class first, in case it wants to add itself to the listenerInstanceMap + try { + Class.forName(listenerClass.getName(), true, listenerClass.getClassLoader()); + } catch (ClassNotFoundException e) { + throw new IllegalStateException(e); + } + // Get the instance of that class, or create a new one if it wasn't instantiated yet T listenerInstance = listenerInterface.cast(listenerInstanceMap.get(listenerClass)); if (listenerInstance == null) {