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

Remove hard casts to ModFile and co #67

Closed
wants to merge 2 commits into from

Conversation

Matyrobbrt
Copy link
Member

Removes the hard casts to ModFile, to make IModFile extendable. In order to achieve this, a few more methods were added to SPI.

@Matyrobbrt Matyrobbrt added bug Something isn't working enhancement New feature or request breaking-change labels Jan 13, 2024
Copy link
Contributor

@Su5eD Su5eD left a comment

Choose a reason for hiding this comment

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

This looks great, we can finally get rid of all the needless hardcoding

Copy link
Contributor

@marchermans marchermans left a comment

Choose a reason for hiding this comment

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

One question. Rest looks good

Comment on lines -108 to -112
FMLLoader.getLoadingModList().getModFiles().stream()
.filter(ModFileInfo::missingLicense)
.filter(modFileInfo -> modFileInfo.getMods().stream().noneMatch(thisModInfo -> this.loadingExceptions.stream().map(ModLoadingException::getModInfo).anyMatch(otherInfo -> otherInfo == thisModInfo))) //Ignore files where any other mod already encountered an error
.map(modFileInfo -> new ModLoadingException(null, ModLoadingStage.VALIDATE, "fml.modloading.missinglicense", null, modFileInfo.getFile()))
.forEach(this.loadingExceptions::add);
Copy link
Contributor

Choose a reason for hiding this comment

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

This change is not part of the proposed changes why did you add it?

@Technici4n
Copy link
Member

My personal opinion is that making IModFile extendable is a bad idea. I don't like leaking details like the list of mixins for example.

@shartte
Copy link
Contributor

shartte commented Apr 21, 2024

@Matyrobbrt Do we wanna kill this?

@shartte
Copy link
Contributor

shartte commented May 6, 2024

We ended up marking IModFile as NonExtendable instead.

@shartte shartte closed this May 6, 2024
shartte added a commit that referenced this pull request Dec 22, 2024
* Removed deprecated methods
shartte pushed a commit that referenced this pull request Dec 22, 2024
shartte added a commit that referenced this pull request Dec 22, 2024
* Removed deprecated methods

(cherry picked from commit 72f8d15)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
breaking-change bug Something isn't working enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants