Is there a way to register multiple ModPlugins?
Simply put, I'd like to have the initial ModPlugin verify that the mod's prerequisites are met, then bootstrap the other mod plugin once that's done. Alternatively, have one ModPlugin have its onApplicationLoad get called before the other.
There are workarounds; I could have my verification ModPlugin act as a wrapper for my main plugin, passing through lifecycle method calls. Or I could simply move all of the login in my main plugin into the verification plugin. It'd be cleaner, though, to be able to programmatically add the main modplugin at runtime.
I tried using
Global.getSettings().getModManager().getEnabledModPlugins().add(new LifecyclePlugin());
but it throws a ConcurrentModificationException. Not surprised, it's only meant as a getter.
The less simple reason that I'm trying this is because my main modplugin is in Kotlin, which requires that LazyLib be present or else the class won't even load (LazyLib has the Kotlin runtime) - it crashes during instantiation. I can write a ModPlugin in Java that checks for LazyLib, then bootstraps the Kotlin ModPlugin. And yes, I coulllllld move the logic from the kotlin modplugin to the java one, but....