Skip to content
This repository has been archived by the owner on Jan 18, 2023. It is now read-only.

Commit

Permalink
finally fix this xd
Browse files Browse the repository at this point in the history
  • Loading branch information
DaMatrix committed Dec 27, 2017
1 parent e95fc77 commit 60985db
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions src/main/java/valkyrienwarfare/ValkyrienWarfareMod.java
Original file line number Diff line number Diff line change
Expand Up @@ -301,10 +301,16 @@ public void fmlConstruct(FMLConstructionEvent event) {
}
}

allAddons.forEach(className -> {
ALLADDONS: for (String className : allAddons) {
try {
Class<?> abstractclass = Class.forName(className);
if (abstractclass.isAnnotationPresent(VWAddon.class)) {
for (Module registered : addons) {
if (registered.getClass().getCanonicalName().equals(abstractclass.getCanonicalName())) {
System.out.println("Addon " + abstractclass.getCanonicalName() + " already registered, skipping...");
continue ALLADDONS;
}
}
Module module = (Module) abstractclass.newInstance();
registerAddon(module);
} else {
Expand All @@ -314,7 +320,7 @@ public void fmlConstruct(FMLConstructionEvent event) {
e.printStackTrace();
System.out.println("Not loading addon: " + className);
}
});
};
}

@EventHandler
Expand Down

0 comments on commit 60985db

Please sign in to comment.