architectury-loom icon indicating copy to clipboard operation
architectury-loom copied to clipboard

[1.10] ForgeMappingsMerger.resolveConflicts throws UnsupportedOperationException for Forge 1.20.1

Open Qendolin opened this issue 1 year ago • 26 comments

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

Qendolin avatar Mar 26 '25 21:03 Qendolin

Same problem here D:

Riflusso avatar Mar 28 '25 13:03 Riflusso

Same situation on my Stonecutter project.

cassiancc avatar Mar 29 '25 15:03 cassiancc

I wonder if this is related to the fix for Neoforge mapping conflicts...

gniftygnome avatar Mar 29 '25 19:03 gniftygnome

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 🙃

Kira-NT avatar Apr 02 '25 17:04 Kira-NT

I've used Loom 1.10 with forge 1.21.4 and below. It's only an issue with 1.21.5

meza avatar Apr 07 '25 21:04 meza

What mappings? The issue reported here is focused on Yarn, and I can confirm 1.20.1 and 1.19.2 were crashing.

cassiancc avatar Apr 07 '25 22:04 cassiancc

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...

gniftygnome avatar Apr 08 '25 00:04 gniftygnome

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

meza avatar Apr 08 '25 00:04 meza

Strange, checking again and it's suddenly fixed itself for me. @Qendolin, is it still broken for your project?

cassiancc avatar Apr 09 '25 00:04 cassiancc

Yes, it did. How is that possible😂? All shedaniel had to do was make this issue a high priority and it fixed itself?

Qendolin avatar Apr 09 '25 01:04 Qendolin

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?

gniftygnome avatar Apr 09 '25 01:04 gniftygnome

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.

cassiancc avatar Apr 09 '25 02:04 cassiancc

Maybe we have to pray or set the issue priority to super high to magically fix gniftygnome's issue as well.

Qendolin avatar Apr 09 '25 02:04 Qendolin

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.

gniftygnome avatar Apr 09 '25 02:04 gniftygnome

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.

gniftygnome avatar Apr 09 '25 02:04 gniftygnome

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.

cassiancc avatar Apr 09 '25 02:04 cassiancc

Please make an extra issue for 1.21.5 if the error is different, this is getting too confusing

shedaniel avatar Apr 09 '25 07:04 shedaniel

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.

gniftygnome avatar Apr 09 '25 07:04 gniftygnome

Opened as #276

gniftygnome avatar Apr 09 '25 07:04 gniftygnome

Getting the same in 1.21.4/1.21.5 with 1.10 :(

meza avatar Apr 09 '25 12:04 meza

Running .\gradlew --refresh-dependencies and the issue is back, 1.20.1 Forge broken once again. Very odd.

Qendolin avatar Apr 12 '25 13:04 Qendolin

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

MemoryMappingTree.addMethod

MemoryMappingTree.getMethods

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

Myitian avatar Apr 16 '25 07:04 Myitian

It seems that this problem is caused by mapping-io using Collections.unmodifiableCollection() instead of LinkedHashMap.values().

FabricMC/mapping-io@983c427

MemoryMappingTree.addMethod

MemoryMappingTree.getMethods

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

Riflusso avatar Apr 16 '25 13:04 Riflusso

Hey, is there any hope this and #276 will get resolved any time soon?

meza avatar Apr 22 '25 14:04 meza

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).

gniftygnome avatar Apr 30 '25 22:04 gniftygnome

Can confirm PR #278 fixed this issue.

cassiancc avatar May 06 '25 18:05 cassiancc