Skip to content

Conversation

@shartte
Copy link
Contributor

@shartte shartte commented Oct 5, 2025

Example error:

ERROR: Mod file .* is trying to provide a ClassProcessor service. Mods and game libraries cannot provide such services, only libraries can.

This moves the parallel computation of module descriptors as an explicit step before we build the game layer, since we now access these descriptors to check for services. (This is also done in parallel in the jar finder, which is later).

@neoforged-pr-publishing
Copy link

  • Publish PR to GitHub Packages

for (var provides : descriptor.provides()) {
if (provides.service().equals(ClassProcessorProvider.class.getName())
|| provides.service().equals(ClassProcessor.class.getName())) {
issues.add(ModLoadingIssue.error("fml.modloadingissue.classprocessor_in_game_content").withAffectedModFile(modFile));
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Don't we need to do this for all the other FML services too? Anything that requires LIBRARY or higher should cause an error here if it's coming from a mod jar.

Copy link
Contributor Author

@shartte shartte Oct 5, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Early services should mark the discovered jar forcefully as a discovered meaning it should not participate in normal discovery anymore. (Due to being that hacky pre-discovery that is built outside of the locator system).

p.s.: If there isn't a test for this, we should add one.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That's not true for IModLanguageLoader, only for the ones in EarlyDiscoveryServices.SERVICES.

@neoforged-automation neoforged-automation bot added the needs rebase This Pull Request needs to be rebased before being merged label Oct 10, 2025
@neoforged-automation
Copy link

@shartte, this pull request has conflicts, please resolve them for this PR to move forward.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

needs rebase This Pull Request needs to be rebased before being merged

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants