FabricMC / tiny-remapper

Tiny JAR remapping tool.
GNU Lesser General Public License v3.0
116 stars 65 forks source link

Mixin remapping breaks wildcard targets #137

Open jpenilla opened 1 month ago

jpenilla commented 1 month ago

The following Mixin to PalettedContainer works fine in-dev but doesn't work in production due to broken remapping:

    @Inject(
            method = "<init>*",
            at = @At(
                    value = "RETURN"
            ),
            require = 3 // Require matching all 3 constructors
    )
    private void constructorHook(final CallbackInfo ci) {
        this.updateData(this.data);
    }

It gets remapped to

    @Inject(
        method = {"<init>(Lnet/minecraft/class_2359;Lnet/minecraft/class_2841$class_6563;Lnet/minecraft/class_2841$class_6560;Lnet/minecraft/class_6490;Ljava/util/List;)V"},
        at = {@At("RETURN")},
        require = 3
    )
    private void constructorHook(CallbackInfo ci) {
        this.updateData(this.field_34560);
    }

which causes it to only match a single target.

For this case I could probably work around it with remap=false, but that wouldn't help with another Mixin I have targeting all three constructors with @Redirect that uses an MC type in its @At target.