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

Allow access widener conversion in NeoForge #218

Closed
wants to merge 1 commit into from
Closed

Allow access widener conversion in NeoForge #218

wants to merge 1 commit into from

Conversation

ThexXTURBOXx
Copy link

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

@Juuxel
Copy link
Member

Juuxel commented Jun 6, 2024

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 code1 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:

/**
* Gets the jar paths to the access wideners that will be converted to ATs for Forge runtime.
* If you specify multiple files, they will be merged into one.
*
* <p>The specified files will be converted and removed from the final jar.
*
* @return the property containing access widener paths in the final jar
*/
@Input
public abstract SetProperty<String> getAtAccessWideners();

Footnotes

  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
Copy link
Author

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
Copy link
Member

Juuxel commented Jun 7, 2024

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants