gorilla-devs / ferium

Fast and multi-source CLI program for managing Minecraft mods and modpacks from Modrinth, CurseForge, and GitHub Releases
Mozilla Public License 2.0
1.16k stars 49 forks source link

Mod Dependency Overrides #127

Open Southpaw1496 opened 2 years ago

Southpaw1496 commented 2 years ago

Tasks


The problem

Fabric mods that run on Quilt through backwards compatibility and use Fabric API require Quilted Fabric API, which is currently distributed as a mod on Modrinth and CurseForge (under Quilt Standard Libraries). However, because they are Fabric mods, they depend on Fabric API, but this conflicts with Quilt (which is why Quilted Fabric API exists), which means that after you've added a mod that depends on Fabric API, you have to remove Fabric API and manually install QSL.

Similar issues are present elsewhere. For example, Iris depends on Sodium, but some people may prefer to use Sodium Extra, and so after installing Iris they must then remove Sodium and install Sodium Extra manually.

My solutions

Add a command to override dependencies with other mods, for example, ferium override. You'd provide two IDs/slugs (GitHub Releases doesn't have versions, so I don't think it needs to be considered), and from then on, every time a dependency is mentioned, it would be substituted with the override. For example, to override Fabric API with Quilt Standard Libraries, you might type:

ferium override fabric-api qsl

Flags

I had some ideas for flags that might be useful for this command:

--global Override is applied throughout all profiles

--global-loader Override is applied to all profiles that match the current profile's Loader (useful for overriding Fabric API with QSL on all Quilt profiles, for example).

--global-version Override is applied to all profiles that match the current profile's Version

--version <VERSION_ID> Some mods depend on a specific version of another mod, and while they probably won't need a specific version of the replacement mod, it's also a possibility. This would also allow you to override a dependency to a different version than is depended on.

If it is possible to distinguish version slugs from mod ID slugs, you could instead just specify the version IDs to override a dependency to a specific version, (for example ferium override 64nlF7yO hPStWdDs) but I think if a project is specified as the override, then it should also override version-specific dependencies (so overriding Fabric API with QSL would also override any mod that depended on a specific version of Fabric API, not just Fabric API in general)

I imagine that it's possible to have two --versions, in a single command, the one after the dependency to override would specify a version of the dependency to override, and the one after the override would specify a specific version to override, so for example ferium override fabric-api --version 64nlF7yO qsl --version hPStWdD would specifically override version 64nlF7yO of Fabric API with version hPStWdDs of QSL. If it's not possible to have two identical flags in one command, you could just have --dependency-version and --override-version or something similar.

theRookieCoder commented 2 years ago

Yeah someone else wanted this too. The current workaround is to either use the --dependencies none flag, or just remove the unwanted mod once you've added everything

theRookieCoder commented 1 year ago

From #239, there should also be the ability to disable adding a specific dependency as well.