This repository was archived by the owner on Apr 28, 2020. It is now read-only.
File tree Expand file tree Collapse file tree 2 files changed +8
-1
lines changed
src/main/java/org/dimdev/riftloader Expand file tree Collapse file tree 2 files changed +8
-1
lines changed Original file line number Diff line number Diff line change @@ -138,7 +138,7 @@ public static void runClientInstaller() {
138
138
// Copy rift jar to libraries
139
139
try {
140
140
String source = Main .class .getProtectionDomain ().getCodeSource ().getLocation ().getPath ();
141
- if (source .startsWith ("/" )) {
141
+ if (source .startsWith ("/" ) && osName . contains ( "win" ) ) {
142
142
source = source .substring (1 );
143
143
}
144
144
File riftJar =
new File (
minecraftFolder ,
"libraries/org/dimdev/rift/@VERSION@/rift-@[email protected] " );
Original file line number Diff line number Diff line change @@ -243,6 +243,13 @@ public <T> void loadListeners(Class<T> listenerInterface) {
243
243
244
244
for (Class <?> listenerClass : listenerClasses ) {
245
245
if (listenerInterface .isAssignableFrom (listenerClass )) {
246
+ // Initialize the class first, in case it wants to add itself to the listenerInstanceMap
247
+ try {
248
+ Class .forName (listenerClass .getName (), true , listenerClass .getClassLoader ());
249
+ } catch (ClassNotFoundException e ) {
250
+ throw new IllegalStateException (e );
251
+ }
252
+
246
253
// Get the instance of that class, or create a new one if it wasn't instantiated yet
247
254
T listenerInstance = listenerInterface .cast (listenerInstanceMap .get (listenerClass ));
248
255
if (listenerInstance == null ) {
You can’t perform that action at this time.
0 commit comments