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

Mixins that target methods which originate in interfaces fail to remap #85

Open Flytre opened 2 years ago

Flytre commented 2 years ago

Relevant Version(s): Architectury Loom 0.11.0-Snapshot.

Not an issue on: Architectury Loom 0.10.0-Snapshot Fabric Loom 0.12-Snapshot.

Bug: Mixins that target methods originating from interfaces in the target class (for example, injecting into render on screens) are not remapped in the build jar. This causes the jar to fail when run as a mod.

Example:

@Mixin(TitleScreen.class)
abstract class TitleScreenMixin extends Screen {

    protected TitleScreenMixin(Text title) {
        super(title);
    }

    @Inject(method = "render", at = @At("TAIL"))
    public void flytre_lib$renderTab(MatrixStack matrices, int mouseX, int mouseY, float delta, CallbackInfo ci) {
       //THIS WILL FAIL OUTSIDE OF THE DEV ENVIRONMENT
    }
Juuxel commented 2 years ago

This could be related to the mixin mapping service issues I investigated today where the mixin mapping service is incorrectly shared across Fabric and Forge projects in the same Gradle build.

Siuolplex commented 2 years ago

Confirmed bug on Arch Loom 0.12, issue ended up affecting my Forge builds

Juuxel commented 2 years ago

Cannot replicate on Arch Loom 0.12.0 after 4d042cd4a570db450ac43cc2152b67bdc73bb4cf 🎉