Mods relying on Guava's `ClassPath` are broken.
Describe the bug
Same as title.
Steps to reproduce
- Create
ClassPathfrom current ClassLoader. - No class files discovered.
Logs
Silent failures.
Additional context
I'm aware that ClassPath doesn't really work on Forge by default, as it requires a URLClassLoader somewhere in the hierarchy, which neither TransformingClassLoader nor ModuleClassLoader are, but some mods on Fabric use it.
Can you list an example mod that uses this for testing purposes?
My own Andromeda (I'm so sorry 😅) to discover modules and mixins and Fabrication, in the past, also to discover mixins. Now they use an auto-generated classpath file, but it will fallback to ClassPath if the file is removed from the jar.
Btw, I don't think it can be easily fixed, since even if you extract URLs from the ModuleClassLoader, those URLs use the UnionFileSystem.
Unfortunately I can't think of any way to avoid this on our side, sorry. Forge and Neo both use UnionFS down to the very core, and it's likely not gonna change anytime soon. Even if we were to process the union URLs and try to get the primary source, we can't account for nested JARs from which mods are loaded. If Neo decides to drop UnionPaths in the future, I'll make sure to post and update here.