-
-
Notifications
You must be signed in to change notification settings - Fork 193
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
Cannot Inject into Lambda's #571
Comments
You can't inject in interfaces on stock mixin. This should probably be an issue on Fabric's fork. |
This issue was ran into on a forge environment but thanks, Ill move the issue there. |
Forge doesnt seem to have a mixin fork. Are you sure vanilla mixin cant inject interfaces?
|
Are you in an architectury environment? You seem to be using yarn |
Yep |
Yes |
IIRC Architectury uses Fabric Mixin in dev even on Forge. Should be clear from the console output. |
Oh alright my bad. |
This is actually an issue with Sponge Mixin. See #497 |
Mixin expects only public methods but it also wants all static methods to be private in a Mixin. Below is an example of how you can run into this issue.
Example Mixin:
This Mixin tries to inject into a lambda inside of the interface RegistryAccess. The bytecode of the class states that the method is
public static synthetic method_30531()Lcom/google/common/collect/ImmutableMap;
meaning that it requires the @Inject method to be static and private. The issue with this is that mixin will giveInterface mixin contains a non-public method!
. Setting the method to public will then make Mixin sayMixin dynamicRegistries.mixins.json:RegistryAccessMixin contains non-private static method
The text was updated successfully, but these errors were encountered: