Skip to content

Conversation

@MagicSweepy
Copy link
Contributor

@MagicSweepy MagicSweepy commented Sep 26, 2025

What

This PR fixes the problem about discoverContainers method in ModuleContainer class.

Implementation Details

In the original implementation, the discoverContainers method checked IGregTechModule interface:

if (IGregTechModule.class.isAssignableFrom(clazz)) {
    registerContainer((IModuleContainer) clazz.getConstructor().newInstance());
} else {
    // ...
}

But this method is used to scan all ModuleContainer annotation (with IModuleContainer interface), so it should be:

if (IModuleContainer.class.isAssignableFrom(clazz)) {
    registerContainer((IModuleContainer) clazz.getConstructor().newInstance());
} else {
    // ...
}

Then the method registerContainer can register the ModuleContainer well.

Outcome

When other mod used GregTechModule and ModuleContainer annotation, the ModuleManager class will scan and register it automatically, this is useful for addon mod which used modularization system.

@MagicSweepy MagicSweepy requested a review from a team as a code owner September 26, 2025 14:13
@kumquat-ir kumquat-ir added the ignore changelog PR should not be added to the changelog. label Sep 26, 2025
Copy link
Contributor

@kumquat-ir kumquat-ir left a comment

Choose a reason for hiding this comment

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

Looks like this was a copy-paste error, good catch

@kumquat-ir kumquat-ir merged commit cdbc584 into GregTechCEu:master Sep 26, 2025
4 of 5 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

ignore changelog PR should not be added to the changelog.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants