FabricMC / fabric-loader

Fabric's mostly-version-independent mod loader.
Apache License 2.0
610 stars 257 forks source link

Mod Initializers should run earlier on servers #179

Open valoeghese opened 4 years ago

valoeghese commented 4 years ago

(see https://discordapp.com/channels/507304429255393322/566276937035546624/653863270448365568) Basically, servers load the level type (LevelGeneratorType) early on, before mods are loaded. This means that modded level types are not initialised by then. In turn, minecraft then resets the custom level type specified in the server properties to the DEFAULT level type, since it cannot find the custom level type.

In the past, I have combatted this by making a mixin to LevelGeneratorType#getTypeFromName, hardcoding it to return my level type when my level type's name is passed, however this shouldn't be neccesary for mods to have their level types loaded by a server.

One solution, proposed by liach, is to make mod initialisers run earlier server-side. If you have alternate solutions, please note them in this issue thread. Thanks.

i509VCB commented 4 years ago

This also partially relates to the fact that the command manager is created before the server is loaded, thereby requiring two mixins to register commands.

In 1.16-pre5, the entrypoint is later than commands loading now because the game has to validate data before load.