FabricMC / fabric-loom

Gradle build system plugin used to automate the setup of a minecraft mod development environment.
MIT License
237 stars 201 forks source link

The migrate mappings task should remap mixin strings #1035

Open haykam821 opened 8 months ago

haykam821 commented 8 months ago

If a method named ExampleClass.doSomething was renamed to doNewSomething, then the mixin would be remapped as such:

 public class ExampleClassMixin {
    @Redirect(method = "doFullTask", at = @At(value = "INVOKE", target = "Lcom/developer/ExampleClass;doSomething(Z)V"))
    public static void modifySomething(boolean value) {
        if (GlobalCondition.condition()) {
            return;
        }

-       ExampleClass.doSomething(!value);
+       ExampleClass.doNewSomething(!value);
    }
 }

The method call will be migrated, but not the target of the mixin. Ideally, both would be migrated.

SNWCreations commented 8 months ago

I think this issue can be solved by using CadixDev/MercuryMixin.

modmuss50 commented 8 months ago

Yes, MM likely need updating to our mercury fork as well as looking into what https://github.com/CadixDev/MercuryMixin/issues/18 means. Its been so long I have forgotten what this issue was about.

SNWCreations commented 8 months ago

Yes, MM likely need updating to our mercury fork as well as looking into what CadixDev/MercuryMixin#18 means. Its been so long I have forgotten what this issue was about.

I've read that, I think it wanted a method which is similar to Mercury#setGracefulClasspathChecks method, it could prevent Mercury from being crashed even if the classpath is incomplete. But enabling this may produce some wrong result in code.