Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Need help]Mixin throws fake errors when injecting to a method overwriting an obfuscated method. #39

Open
Blue-Beaker opened this issue Jan 24, 2025 · 8 comments

Comments

@Blue-Beaker
Copy link

When I try to build, runClient, or runObfClient every time, fake errors are thrown onto my IntelliJ IDEA, causing the file to be popped up, which is annoying:

/mnt/E/Minecraft/mods/mte_patches/src/main/java/io/bluebeaker/mtepatches/mixin/rftools/MixinGuiModularStorage.java:28: 警告: Cannot find target method "mouseClicked(III)V" for @Inject.method="mouseClicked(III)V" in mcjty.rftools.blocks.storage.GuiModularStorage
    @Inject(method = "mouseClicked(III)V",at = @At("RETURN"),remap = true)
    ^

In my mod: https://github.com/Blue-Beaker/mte_patches
This refers to this file, which I injected into a method that overwrites an obfuscated method from its parent class.
However this actually worked in both deobfuscated and obfuscated environments. So how could I get rid of these errors?

@Rongmario
Copy link
Member

What "fake error" do you get?

@Blue-Beaker
Copy link
Author

What "fake error" do you get?

The 'Can't find target method' ones.
Image

@MCTian-mi
Copy link

MCTian-mi commented Feb 3, 2025

mouseClicked(III) is a vanilla method
you should add remap=true to it

@Blue-Beaker
Copy link
Author

mouseClicked(III) is a vanilla method you should add remap=true to it

Yes I already have remap=true, and everything worked well except for the fake errors.

@Blue-Beaker
Copy link
Author

Blue-Beaker commented Feb 3, 2025

Oops mis-clicked on close with comment, can moderator reopen this?

@Rongmario Rongmario reopened this Feb 3, 2025
@MCTian-mi
Copy link

mouseClicked(III) is a vanilla method you should add remap=true to it

Yes I already have remap=true, and everything worked well except for the fake errors.

nvm I can't read
the same mixin target doesn't produce any error for my when using ceu buildscripts

@Blue-Beaker
Copy link
Author

mouseClicked(III) is a vanilla method you should add remap=true to it

Yes I already have remap=true, and everything worked well except for the fake errors.

nvm I can't read the same mixin target doesn't produce any error for my when using ceu buildscripts

Please note that I'm not injecting into the vanilla method itself. I actually injected into mcjty.rftools.blocks.storage.GuiModularStorage.mouseClicked(III)V which is in a mod, instead of its super method which is in vanilla.

@MCTian-mi
Copy link

Please note that I'm not injecting into the vanilla method itself. I actually injected into mcjty.rftools.blocks.storage.GuiModularStorage.mouseClicked(III)V which is in a mod, instead of its super method which is in vanilla.

yeah in this case one should use remap=true indeed

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants