Hacky way to alter forgemods load order as you wish

  • Well, currently i working on addon\mod that alter behaivior of IC2e devices (replace tileentity class at runtime) (allow replicator to replicate all registered items without scanning process or patern storage).


    For some reasons (i dont like APIs) i can's import IC2e API or state loadafter in mod's header soo i "developed" (actually joke, but still, there is no direct answer about it on google) method to change loadorder in runtime.


    Also this method useless if you gone ASM coremod.


    Source code below:


    Stage B run at postinit and ensured to run last.
    Classcast done such wierd way for a reason.

  • Why is this a suggestion?


    Also, if you put dependencies="after:IC2" in your @Mod annotation, it will force you to load after IC2, if IC2 is installed (and if IC2 isn't installed it'll do nothing). Not sure why you don't want to do that.

    Disappointed with the bugs and nerfedness of AtomicStryker Corp's Advanced Machines, and the unupdatedness of Snyke's Enterprises?
    Need low-lag renewable power?
    Come to ImmTech Intragalactical this thread for free UUM!

    Note: UUM may stand for Unnerfed Unbuggy Updated Machines and may not be actual UUM. The extra U was lost due to a bit error.
    Battery snot included.

  • Quote
    Code
    or state loadafter in mod's header


    I know about loadafter annotation, but, this does not allow to define dynamic or config defined loadorder.


    If you want some mod that alter loadorder of other mods, reflections are only way, howto described in FP.


    this is just "note" for developers, not suggestion, not question.

    • Official Post

    RawCode, this is a good Idea. I once tried to use the "after:*" Annotation. Guess what happens if a second Mod (Omnitools) does this aswell. It ends up in crashing because of that.


    But if a Mod uses this Method, it should provide an API way of letting things happen after said hacked post-everything-load Phase, just in case.

  • I have plan:


    1) GUI with drag and drop mod list.
    2) GUI shoud popup at mod list initialization.
    3) Mods will load in order defined by user, no matter what stated in mod annonations.


    i have some problems with GUI, but, this is perfectly possible and will fix some of loadorder issues.

  • I have plan:


    1) GUI with drag and drop mod list.
    2) GUI shoud popup at mod list initialization.
    3) Mods will load in order defined by user, no matter what stated in mod annonations.


    i have some problems with GUI, but, this is perfectly possible and will fix some of loadorder issues.


    Dedicated headless servers? Those don't have a place to show guis, unless you can write a nice CLI interface?