Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ModContainer#getRootPaths() doesn't seem to include classes build directory #1009

Open
mineLdiver opened this issue Dec 28, 2024 · 4 comments

Comments

@mineLdiver
Copy link

Running FabricLoader.getInstance().getModContainer("modid").get().getRootPaths() on the workspace's mod only returns its resources build folder, not classes.

However, in a workspace with subprojects, the subprojects do get their classes included, but only because Gradle compiles them into a full jar, which Fabric Loader points at. Unlike Gradle though, IntelliJ uses folders for subprojects when running, and, again, only the resources folder gets included.

@modmuss50
Copy link
Member

Have you specifed the classpath groups? Loom has a DSL for this:

loom {
  mods {
    "modid" {
      sourceSet sourceSets.main
    }
  }
}

Mulit project builds should specify all of the mods here.

@mineLdiver
Copy link
Author

I don't think we did. Is there a way to automate this? The project has about as many modules as Fabric API, so I'd prefer to avoid having another list of modules explicitly written out like in settings.gradle.kts

@mineLdiver
Copy link
Author

For context, this is the build.gradle.kts: https://github.com/ModificationStation/StationAPI/blob/develop/build.gradle.kts

@mineLdiver
Copy link
Author

Realizing now that this is a huge case of an XY problem. Basically, I want to create a utility method which would return a modid based on the caller class. I thought it'd be as easy as iterating through all mods and doing .findPath() on each until the caller's path is found, but apparently not quite.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants