Mixin
Mixin copied to clipboard
Constructor invokers not added to refmap
I have an invoker that uses the naming pattern to determine the invoker type newX and fails in production as the constructor signature is not added to the refmap, resulting in Mixin looking for a method named x (from newX)
@Mixin(MobEffect.class)
public interface MobEffectAccessor {
@Invoker
static MobEffect newMobEffect(final MobEffectCategory category, final int color) {
throw new AssertionError();
}
}
No candidates were found matching mobEffect(Lnet/minecraft/class_4081;I)Lnet/minecraft/class_1291;
Adding "<init>" as a value for the invoker annotation resolves this issue, but it seems counter-intuitive to require this in production given the full inference for call and invoke invokers.
I had the same thing happen to me a couple of days ago. Do we know if this issue is in Mixin itself, the Mixin AP, or in Fabric loom?
Appears to be caused by this check in the AP, where it is checking the UpperCamelCase target class name against the lowerCamelCase accessor name. Probably best to remove the name check entirely imo, the new or create prefix already implies a factory accessor.