architectury / architectury-loom

A Gradle plugin to setup environments for Fabric, Forge, NeoForge and Quilt modding.
https://docs.architectury.dev/loom/introduction
MIT License
115 stars 41 forks source link

Allow access widener conversion in NeoForge #218

Closed ThexXTURBOXx closed 5 months ago

ThexXTURBOXx commented 5 months ago

Just a simple, but very effective change - works fine in my tests

Juuxel commented 5 months ago

Thanks for the PR, but this functionality is already available for Neo, just without this API. I intentionally excluded it from #166. (See the #loom-dev discussion on this)

The design is problematic since it uses unreliable code[^1] for determining the relative AW file paths. It also should not be a Property<Boolean> IMO, just a toggle method like java.withSourcesJar() etc.

You can just add the AW names directly to remapJar.atAccessWideners: https://github.com/architectury/architectury-loom/blob/8da7cc0f877ff572e7701ad6d63f5d171b328173/src/main/java/net/fabricmc/loom/task/RemapJarTask.java#L113-L122

[^1]: This breaks if the AW is inside a subdirectory of something that's not directly in this project's resources, such as a common AW. I also can't change/remove this behaviour without making a breaking change.

ThexXTURBOXx commented 5 months ago

Oh, I am terribly sorry - I didn't know that it "moved" for NeoForge! That one works without further tinkering just fine, so I will use this for the future :) Again, I am very sorry - I will close this PR then!

Juuxel commented 5 months ago

No problem. FYI the more direct API on RemapJarTask also works on Forge – people can use the same API on both platforms for consistency if they want to.