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

Prioritize mods with higher provided versions if their main id differs #857

Merged
merged 3 commits into from
Nov 27, 2023

Conversation

sfPlayer1
Copy link
Contributor

This handles the case outlined in #780 where interactions between provided and regular mod ids lead to undesirable results.

Whenever there is an overlap between the id+provides sets of two mods, the sets will be compared as a whole. Each matching id pair is compared, the mod with the most higher versions gets overall higher priority. The solver may of course still select the lesser result if other constraints force it to.

return found ? 0 : -1; // only a has minParent if !found, so only a has the highest prio parent
}

private static int compareOverlappingIds(ModCandidate a, ModCandidate b, int noMatchResult) {
Copy link
Contributor

Choose a reason for hiding this comment

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

Returning a @Nullable Integer might be better here.

Copy link
Contributor

Choose a reason for hiding this comment

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

OptionalInt?

@sfPlayer1 sfPlayer1 marked this pull request as ready for review November 26, 2023 20:19
@modmuss50 modmuss50 merged commit 34975c3 into FabricMC:master Nov 27, 2023
5 checks passed
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

Successfully merging this pull request may close these issues.

ModResolver prefers older version of JiJed library when using provides
4 participants