Mixin icon indicating copy to clipboard operation
Mixin copied to clipboard

Refmap does not include wildcard MemberInfos where only the method descriptor is specified

Open Earthcomputer opened this issue 5 years ago • 1 comments

For example, if I try to target *()Lnet/minecraft/world/gen/GeneratorOptions; in the GeneratorOptions class in Fabric, it works in dev, but since the refmap does not contain this entry, it breaks in prod. This works fine on platforms where class names are the same in dev and prod, but this is not the case on some platforms (e.g. Fabric), so this needs to be in the refmap.

See also this question in the #mixin channel on the Sponge discord:

Earthcomputer: Isn't @Inject(method = "*()Lnet/minecraft/world/gen/GeneratorOptions;", at = @At("RETURN")) supposed to target all no-arg methods in a class returning GeneratorOptions? Earthcomputer: It's working in dev but not in prod Earthcomputer: It's not in the refmap

Earthcomputer avatar Feb 07 '21 18:02 Earthcomputer

As you correctly surmised I think this is the way it is because the target when designing the AP was Forge, where class names are the same between dev/prod. It shouldn't be too hard to implement some fallback behaviour where the individual parts of the descriptor are remapped in this case, since that's already done for <init> so the same behaviour could be extended to remap the descriptor manually in this case.

Mumfrey avatar Feb 08 '21 15:02 Mumfrey