Patchouli doesn't respect mods with multiple content roots on fabric
MattiDragon opened this issue ยท 0 comments
Mod loader
Fabric
Minecraft version
1.18.2
Patchouli version
1.18.2-71.1-FABRIC
Modloader version
Loader: 0.13.3 Api: 0.51.1+1.18.2
Modpack info
No response
The latest.log file
Issue description
Fabric loader is designed in such a way that mods can have multiple root paths. This is mostly used in a development environment to include resource from multiple sources. Currently patchouli call the deprecated ModContainer#getRootPath
method in FabricXplatModContainer#getRootPath
. This causes patchouli to only read books from one root and not all of them, causing issues for some mods.
Fixing this issue would require using the new ModContainer#getRootPaths
that returns multiple roots. It would require a minor restructure of the searching code, but nothing major.
Steps to reproduce
Getting a setup with multiple roots is kind of complicated so I'll just show how to it with my mod:
- Clone https://github.com/MattiDragon/extendeddrawers
- Run
./gradlew runClient
to start minecraft - Note how patchouli can't find the book specified in
src/main/resources
- Note how other systems using the multi-root method do find assets there
Other information
Multiple roots are an official fabric feature that a mod should expect to be used.
These lines add the other root (note that it already has to be on classpath if you make a test setup):
https://github.com/mattidragon/extendeddrawers/blob/1.18/build.gradle#L55-L60
This issue doesn't happen with the built jar as all the roots are merged into the same jar