ModMenu icon indicating copy to clipboard operation
ModMenu copied to clipboard

Expose mod list through API

Open NebelNidas opened this issue 4 years ago • 2 comments

I'm programming a mod which needs to know which other mods are installed, but I don't want to fetch any libraries etc. Therefore, I'm asking for the API to provide a way of getting all installed mods, but unlike FabricLoader.getInstance().getAllMods(), it should be able to expose the modmenu specific metadata (like if it is a library, deprecated, which parent it belongs to etc.).

NebelNidas avatar Jun 10 '21 13:06 NebelNidas

Can't you just fetch the metadata from the ModContainers returned by Fabric just like ModMenu would do it? (ModMenu metadata is just regular Fabric metadata ("Custom Values"), under the modmenu name, except for FAPI, which has a slightly more complex process)

altrisi avatar Jun 13 '21 20:06 altrisi

That would of course be a solution, but imagine having multiple mods do that. That would result in quite a bit of redundancy and overhead, for a thing modmenu already scans through. And as you mentioned, manually adding exceptions for libraries like FAPI can be additionally annoying :/

NebelNidas avatar Jun 14 '21 07:06 NebelNidas