fabric-loader icon indicating copy to clipboard operation
fabric-loader copied to clipboard

[Question] How can I specify mods loading order

Open Phoupraw opened this issue 1 year ago • 7 comments

For example, my mod, A, depends on another mod, B. I want A's ModInitializer be called after B`s, and A's datapack and resourcepack override B's. How can I do this?

Phoupraw avatar Mar 06 '24 17:03 Phoupraw

If your mod A depends on mod B explicitly, B will be loaded first anyway so that A can be loaded.

cD1rtX3 avatar Mar 12 '24 17:03 cD1rtX3

Wrong. Load order is not set by dependencies.

OroArmor avatar Mar 12 '24 17:03 OroArmor

Not technically, no. However, if mod A loads first, it should load B as one of the first things it does, then carry out loading A.

cD1rtX3 avatar Mar 12 '24 23:03 cD1rtX3

It wont initialize an instance of Mod B's mod initializer (nor should it). it may class load it, but. some mods are designed instanced not static.

Linguardium avatar Mar 13 '24 01:03 Linguardium

That's wild.

@Phoupraw, why do you specifically need B to load its initialiser first? It seems like (at least in this case) it would be better if the mods were simply bundled.

Are you the one coding the mod, or is it one made by someone else?

cD1rtX3 avatar Mar 13 '24 12:03 cD1rtX3

That's wild.

@Phoupraw, why do you specifically need B to load its initialiser first? It seems like (at least in this case) it would be better if the mods were simply bundled.

Are you the one coding the mod, or is it one made by someone else?

I am making an addon for Create mod. Create is lazy initalized (by a lib, Registrate). Its registries (items, blocks, and so on) don't be initialized if you just load its classes. Only after its initialiser is invoked, its registries are completed.

Phoupraw avatar Mar 13 '24 13:03 Phoupraw

I am making an addon for Create mod. Create is lazy initalized (by a lib, Registrate). Its registries (items, blocks, and so on) don't be initialized if you just load its classes. Only after its initialiser is invoked, its registries are completed.

use mixin :p

zly2006 avatar Apr 30 '24 04:04 zly2006