API classloader

  • As you may know any mod with outdated API that manage to load before IC2 will break IC2, reason for this is very simple - same classes does not load multiple times in vanilla class loader.


    Solution for this simple, API must be separate mod, that load by its own and multiple instances not possible.


    discuss.

  • There is pretty old bearded solution to keep interfaces backward compatible. Not as beauty, but quite effective.


  • So if the API is a separate mod then how would IC2 itself interact with it?
    What if the API needs to change to support a feature?

    • Official Post

    As you may know any mod with outdated API that manage to load before IC2 will break IC2, reason for this is very simple - same classes does not load multiple times in vanilla class loader.

    Oh, I thought it was the other way around, that the last loaded Mod overrides the already loaded classes. But if it's like that, then the solution is really as simple as just adding a soft dependancy on the API containing Mod.