[1.10] ForgeMappingsMerger.resolveConflicts throws UnsupportedOperationException for Forge 1.20.1
I have a stonecutter project with yarn mappings, you can find it here (note: I've removed forge 1.20.1 for now, see settings.gradle) Today I updated from Loom 1.7 to 1.10 and can no longer load the Forge 1.20.1 project. I get this error:
java.lang.UnsupportedOperationException
at net.fabricmc.loom.util.srg.ForgeMappingsMerger.resolveConflicts(ForgeMappingsMerger.java:321)
at net.fabricmc.loom.util.srg.ForgeMappingsMerger.merge(ForgeMappingsMerger.java:178)
at net.fabricmc.loom.util.srg.ForgeMappingsMerger.mergeSrg(ForgeMappingsMerger.java:391)
at net.fabricmc.loom.configuration.providers.forge.ForgeLibrariesProvider.remapObjectHolder(ForgeLibrariesProvider.java:220)
at net.fabricmc.loom.configuration.providers.forge.ForgeLibrariesProvider.remapFmlLoader(ForgeLibrariesProvider.java:185)
at net.fabricmc.loom.configuration.providers.forge.ForgeLibrariesProvider.provide(ForgeLibrariesProvider.java:135)
at net.fabricmc.loom.configuration.CompileConfiguration.setupMinecraft(CompileConfiguration.java:234)
at net.fabricmc.loom.configuration.CompileConfiguration.lambda$run$2(CompileConfiguration.java:130)
Full output: https://paste.ee/p/ZtB21Cun
Same problem here D:
Same situation on my Stonecutter project.
I wonder if this is related to the fix for Neoforge mapping conflicts...
Yup, Loom >1.7 just doesn't work with Forge. And that's quite problematic, since Loom 1.7 doesn't support NeoForge 1.21.5 🙃
I've used Loom 1.10 with forge 1.21.4 and below. It's only an issue with 1.21.5
What mappings? The issue reported here is focused on Yarn, and I can confirm 1.20.1 and 1.19.2 were crashing.
Yesss I don't recall that far back but there was probably a reason I had stuck with Loom 1.7 all the way through 1.21.4...
This is 1.9.424 for 1.20.2 and above: https://github.com/meza/ServerRedstoneBlock/blob/main/settings.gradle.kts
And I'm working with 1.10.430 right now in updating to 1.21.5. It's working perfectly aside from this issue with forge :D
And yes, I'm using Yarn
Strange, checking again and it's suddenly fixed itself for me. @Qendolin, is it still broken for your project?
Yes, it did. How is that possible😂? All shedaniel had to do was make this issue a high priority and it fixed itself?
Still occurring in Biolith. I've tried clearing caches and removing files pretty aggressively but it hasn't helped. :( I am jealous.
Are you testing in 1.21.5 specifically?
Not Forge 1.21.5, no. The issue Qendolin and I encountered was that Forge 1.20.1 was erroring, which caused issues with our multiversion mods that required Loom 1.10 for Fabric and Neo 1.21.5.
Maybe we have to pray or set the issue priority to super high to magically fix gniftygnome's issue as well.
It's basically the same error, but I think the exact cause may be different in 1.21.5. I suspect if you upgraded to 1.21.5 it'd come back.
One possibly interesting detail is this error occurs when configuring :common in my project, not when configuring :forge. Why is it trying to remap Forge while configuring the common project, you ask? I wonder that too.
Yeah, it's not an issue for me on 1.21.5 as I (alongside Architectury) dropped Forge in favour of NeoForge back on 1.20.4.
Please make an extra issue for 1.21.5 if the error is different, this is getting too confusing
I'm not sure it is actually different. The exception thrown is pretty much identical. They may well have the same fix, although I suspect the cause is perhaps slightly different. I can make another issue though no problem.
Opened as #276
Getting the same in 1.21.4/1.21.5 with 1.10 :(
Running .\gradlew --refresh-dependencies and the issue is back, 1.20.1 Forge broken once again. Very odd.
It seems that this problem is caused by mapping-io using Collections.unmodifiableCollection() instead of LinkedHashMap.values().
https://github.com/FabricMC/mapping-io/commit/983c4274a6b34ae1b396b1c6f98963ebce4000ab
https://github.com/architectury/architectury-loom/blob/dev/1.10/src/main/java/net/fabricmc/loom/util/srg/ForgeMappingsMerger.java#L318-L323
https://github.com/FabricMC/mapping-io/blob/dev/src/main/java/net/fabricmc/mappingio/tree/MemoryMappingTree.java#L1118-L1121
It seems that this problem is caused by
mapping-iousingCollections.unmodifiableCollection()instead ofLinkedHashMap.values().
https://github.com/architectury/architectury-loom/blob/dev/1.10/src/main/java/net/fabricmc/loom/util/srg/ForgeMappingsMerger.java#L318-L323
https://github.com/FabricMC/mapping-io/blob/dev/src/main/java/net/fabricmc/mappingio/tree/MemoryMappingTree.java#L1118-L1121
The same thing happened here df1cfb2, I think. We'll have to wait for mapping-io to add support for external data modification while a visitation pass
Hey, is there any hope this and #276 will get resolved any time soon?
In PR #278, I've submitted a change for Arch Loom 1.10 which seems to resolve the Minecraft 1.21.5 version of this issue (#276).
Can confirm PR #278 fixed this issue.