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

Unable to compile mod against AccessTransfer after [re|de]compilation process #90

Closed
ApexModder opened this issue Jan 1, 2024 · 5 comments · Fixed by #91
Closed

Unable to compile mod against AccessTransfer after [re|de]compilation process #90

ApexModder opened this issue Jan 1, 2024 · 5 comments · Fixed by #91

Comments

@ApexModder
Copy link

I have applied a access transformer to my mod but after reimporting gradle the changes are not applied and im unable to compile my mod cause of this.

i have cleared idea & gradle caches and reimported gradle/project in every way i can think of, but my AT just seems to not be applied to the sources im compiling against.

The logs do show a decompile step for my AT file and if i update my AT in anyway decompilation occurs again, making it feel like NeoGradle does know of my AT and is attempting to apply it, but once decompile and recompile finishes the game sources are unchanged and im unable to compile my mod.

> Task :neoforge:neoFormApplyForgesAccessTransformer UP-TO-DATE
> Task :neoforge:neoFormUserAccessTransformerProvideraccesstransformer.cfg UP-TO-DATE
> Task :neoforge:neoFormApplyUserAccessTransformer UP-TO-DATE

if it helps here is my access transformer and how i am applying it.
it is saved under the following path src/main/resources/META-INF/accesstransformer.cfg

minecraft.accessTransformers.file file('src/main/resources/META-INF/accesstransformer.cfg')

public net.minecraft.world.level.GameRules$VisitorCaller
public net.minecraft.world.level.GameRules$Type <init>(Ljava/util/function/Supplier;Ljava/util/function/Function;Ljava/util/function/BiConsumer;Lnet/minecraft/world/level/GameRules$VisitorCaller;)V # Type

i am also working in a multi project workspace with 3 subprojects
2 fabric loom projects and 1 neogradle project
i have tried removing the 2 fabric projects but this issue still occurs

@shartte
Copy link
Contributor

shartte commented Jan 1, 2024

Please provide a link to a Gradle project that demonstrates this problem

@ApexModder
Copy link
Author

ApexModder commented Jan 1, 2024

https://github.com/ApexModder/NeoGradle-AT-Issue
basic multi-loader project with fabric & neoforge, using fabric-loom on the common/xplat side.

neoforge has a AT file to attempt to make the the following changes

  • GameRules.Type constructor public from package-private
  • GameRules.VisitorCaller functional interface public from package-private

if AT got applied should be able to launch neoforge and set the custom game rule to any int value 0-10
/gamerules ng_at_issue:test_bound_int <0-10> (default: 0)

fabric already has mixins and AWs applied making a gamerule like this simple.
just use their GameRulesFactory/Registry classes

@shartte
Copy link
Contributor

shartte commented Jan 2, 2024

Yeah it works for me, this is a caching issue related to Parchment.

@ApexModder
Copy link
Author

can confirm that pr-build #91 fixed the issue for me, my AT file now gets applied correctly and i can compile and launch the game with its changes applied 👍

@shartte
Copy link
Contributor

shartte commented Jan 2, 2024

Don't be misled by that though, every change to any of your gradle plugins will invalidate the build cache and thus fix your issue 😅 This fix is just for the future so it will not happen again.

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 a pull request may close this issue.

2 participants