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

Filter duplicate mod files in mod file scan data #6254

wants to merge 1 commit into
base: 1.14.x


Copy link

maxanier commented Oct 18, 2019

Forge allows having two (or more) mods in one mod file.

When ModList#getAllScanData is called to get annotations (for ObjectHolder etc.), it retrieves the defining mod file for each mod. Because the two mods can be in the same file, this can lead to duplicate scan data.

For ObjectHolder and Capability Injects this means, that all fields of defined in the mod file are injected twice.

Furthermore, other mods like JEI use this as well. For JEI this means that any @JeiPlugin is loaded twice (causing an error).

This PR simply adds a .distinct call in the stream to filter duplicate mod files.

@ichttt ichttt added 1.14 Bug labels Oct 19, 2019
@ichttt ichttt added the Assigned label Oct 19, 2019

This comment has been minimized.

Copy link
Contributor Author

maxanier commented Nov 4, 2019

@cpw @mezz Any concerns about this?
I cannot implement JEI integrations in my mod Vampirism without this.


This comment has been minimized.

Copy link

mezz commented Nov 6, 2019

Looks fine to me. My only concern would be that this fix might be masking some lower-level design bug, but I don't know enough about this scanning system to say for sure.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
None yet
5 participants
You can’t perform that action at this time.