architectury / architectury-loom

A Gradle plugin to setup environments for Fabric, Forge, NeoForge and Quilt modding.
https://docs.architectury.dev/loom/introduction
MIT License
106 stars 36 forks source link

Non-mod transitive dependencies are not loaded on Forge #201

Open SquidDev opened 3 months ago

SquidDev commented 3 months ago

This was originally https://github.com/cc-tweaked/CC-Tweaked/discussions/1752. I'm afraid I don't use Architectury myself, just reporting what feels like a bug.

Consider the following setup:

On ForgeGradle, this works fine, because the dependencies are loaded via jarjar.

However, Architectury-Loom strips out jarjar metadata, instead assuming the jars will be loaded from the classpath. This works fine for actual mods, but because BSL/FML is A Bucket Of Fun, non-mod jars should be ignored entirely! This means that mod B needs to manually add of A's dependencies with forgeRuntimeLibrary!

SquidDev commented 3 months ago

Ideally it should be possible to infer forgeRuntimeLibrary automatically - the legacy classpath can just contain any dependency that doesn't contain a mods.toml or FMLModType in its META-INF.mf.

Juuxel commented 3 months ago

Sort of a duplicate of #58. It should be possible, but I think there are some non-mod classpath jars that get special treatment from Neo/Forge and would need to be excluded from an automatically generated forgeRuntimeLibrary.

SquidDev commented 3 months ago

"non-mod classpath jars that get special treatment from Neo/Forge" <- Oh, do you have any notes on this? I did a look through FML/BSL a few months back, and couldn't spot anything aside from FMLModType/mods.toml (and of course MOD_CLASSES), but may have missed something.

Juuxel commented 3 months ago

I was thinking of the libraries that are on the module path. Based on an example dev env though, they also seem to be present in the BSL classpath file, just with different versions (the module path has locked older versions while the BSL classpath has newer versions pulled in by Forge etc).