-
Notifications
You must be signed in to change notification settings - Fork 33
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
Prevent mods from modifying the mod list #235
base: main
Are you sure you want to change the base?
Conversation
Last commit published: 0ac9cedc81ff70fc9f0190cab8853212da16752d. PR PublishingThe artifacts published by this PR:
Repository DeclarationIn order to use the artifacts published by the PR, add the following repository to your buildscript: repositories {
maven {
name 'Maven for PR #235' // https://github.com/neoforged/FancyModLoader/pull/235
url 'https://prmaven.neoforged.net/FancyModLoader/pr235'
content {
includeModule('net.neoforged.fancymodloader', 'earlydisplay')
includeModule('net.neoforged.fancymodloader', 'junit-fml')
includeModule('net.neoforged.fancymodloader', 'loader')
includeModule('net.neoforged.fancymodloader', 'tests')
}
}
} |
@embeddedt, this PR introduces breaking changes. Compatibility checks
|
this.fileById = this.modFiles.stream().map(IModFileInfo::getMods).flatMap(Collection::stream).map(ModInfo.class::cast).collect(Collectors.toMap(ModInfo::getModId, ModInfo::getOwningFile)); | ||
this.modFiles = modFiles.stream().map(ModFile::getModFileInfo).toList(); | ||
this.sortedList = sortedList.stream().map(IModInfo.class::cast).toList(); | ||
this.fileById = Collections.unmodifiableMap(this.modFiles.stream().map(IModFileInfo::getMods).flatMap(Collection::stream).map(ModInfo.class::cast).collect(Collectors.toMap(ModInfo::getModId, ModInfo::getOwningFile))); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You could also use Collectors#toUnmodifiableMap
@embeddedt Are you intending this to go into any current version? Otherwise, I'd rather just handle this in startup experiments (and I agree with the change). |
It would be ideal to get it in 1.21.1 at least (which implies it needs to be in 1.21.4, due to the backporting policy). |
This is basically guaranteed to cause unexpected/difficult to debug behavior if someone tries it (accidentally or otherwise).