SpongePowered / Mixin

Mixin is a trait/mixin and bytecode weaving framework for Java using ASM
MIT License
1.41k stars 194 forks source link

Unable to Suppress @Shadow warning: Unable to locate obfuscation mapping for @Shadow field #588

Closed FxMorin closed 2 years ago

FxMorin commented 2 years ago

Using a simple mixin into Sodium's menu: SodiumOptionsGUI.class I get the warning warning: Unable to locate obfuscation mapping for @Shadow field

@Mixin(SodiumOptionsGUI.class)
public class SodiumOptionsGUIMixin {

    @Shadow
    @Final
    private List<OptionPage> pages;

    // ...

}

The method does exist, and it works perfectly fine. If I attempt to remap the mixin no longer works (obviously).

It would be nice if I could suppress the warning. Since that is not currently possible, the printMessage() used is not suppressable

AterAnimAvis commented 2 years ago

Why not just disable the remapping on the annotation https://github.com/SpongePowered/Mixin/blob/b1cd46c8c4960eae026bcd6dd9bafb59cafa4d52/src/main/java/org/spongepowered/asm/mixin/Shadow.java#L89-L104

FxMorin commented 2 years ago

Didn't know that was n option, thanks