Open Janrupf opened 4 years ago
Loader does have a PreLaunchEntrypoint that ensures that the classloader is setup correctaly. However this is still later than you need.
Adding mods later isnt an easy thing to slove as the dependency resoultion may fail without the added mods.
What you could do now is create a wrapper that calls fabric-loader once you have downloaded the mods, but this will requrie it being on the classpath at startup.
This isnt a trivial thing to slove, but its something that has been spoken about. Loader should really have a solid API to allow mods to be added after the first loading pass. Im not too sure how it will look when its done.
This issue is similar to https://github.com/FabricMC/fabric-loader/issues/175
You might want to be following the FabLab's venture into allowing this.
I've been thinking up a concept for this, but I am going to talk to Player to flesh out some of them before I end up nuking half of the loader codebase 😛
The biggest issue I see there is moving half of loader into api territory if we're not careful..
Imo a solution would be to expose an api for the mod discovery (mod candidate, etc.)
A simple follow-up on this issue ticket. I/We have a “mod” that does the following:
, and I have done some preliminary research on this, only found it being impossible on Fabric Loader (need to implement custom ModCandidateFinder
which is non-API, plus no possible time point to inject this custom ModCandidateFinder
impl). After searching existing issue tickets, I believe that our use case is similar to that of OP's, thus a follow-up instead of a new ticket.
This “mod” is intended for use in in-game conventions (think BTM/LimboCon/BlanketCon, modding jams, etc.) where organizers anticipate rapid, frequent mod updates, but do not wish to rely on a specific launcher to handle the mod updates.
Possible workarounds are much appreciated.
I wouldn't bother with workarounds, a proper solution is not too far off at this point.
I'm developing a small mod which allows to download mods after launching the game. Some mod platforms don't allow distributing third party jars, so downloading them right before launch is the only option. In order for this to work, I need an entry point which executes my code before the rest of the mods are loaded. My current implementation only works on Forge and Launchwrapper, because I use Forge to detect my jar from the mods folder and inject a tweaker with a very low loading order, which then bootstraps my system, installs the mods and then continues the game launch. However, I have not been able to figure out a way to get the same effect on Fabric. I can imagine, that this would be possible, if the Fabric loader would read the jar files from the mods directory, look for a special manifest entry and then execute code in case such entry is found.