Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Conversation

@JTK222
Copy link
Contributor

@JTK222 JTK222 commented Oct 5, 2025

Replaced Injection mixins with WrapOperation mixins.
Not really sure why the previous ones broke, they seemed correct.

JTK222 added 2 commits October 5, 2025 16:29
Replaced Injection mixins with WrapOperation mixins.
Not really sure why the previous ones broke, they seemed correct.
Removes accidental imports from the MouseHandler mixins
for both the Fabric and Norge modules.
Copy link
Collaborator

@EnnuiL EnnuiL left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There are only a few small fixes needed;

I do have to say though: I recall not going with @ModifyArgs here because I wanted to modify the locals themselves for better compatibility; I will be merging this though, I'm too exhausted to cook something up myself

Comment on lines 48 to 49
}else{
original.call(instance, x, y);
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
}else{
original.call(instance, x, y);
} else {
original.call(instance, x, y);

Comment on lines 30 to 31
}e lse{
original.call(instance, x, y);
Copy link
Collaborator

@EnnuiL EnnuiL Oct 5, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I would be shocked if Java considered this valid (it doesn't)

Suggested change
}e lse{
original.call(instance, x, y);
} else {
original.call(instance, x, y);

@JTK222
Copy link
Contributor Author

JTK222 commented Oct 5, 2025

There are only a few small fixes needed;

I do have to say though: I recall not going with @ModifyArgs here because I wanted to modify the locals themselves for better compatibility; I will be merging this though, I'm too exhausted to cook something up myself

That's why I used WrapOperation, it's a MixinExtras addition
(which is shipped by both Fabric and NeoForge and adds the @Local annotation)
And it does exactly what your mixins achieved, they are stackable and specifically designed for compatibility.
(ModifyArgs should also have relative high compatabilty, but also creates a lot of overhead and has some limtations on local captures)

@EnnuiL
Copy link
Collaborator

EnnuiL commented Oct 5, 2025

That's why I used WrapOperation, it's a MixinExtras addition (which is shipped by both Fabric and NeoForge and adds the @Local annotation) And it does exactly what your mixins achieved, they are stackable and specifically designed for compatibility. (ModifyArgs should also have relative high compatabilty, but also creates a lot of overhead and has some limtations on local captures)

Oh no, that's not the issue, the issue is that I was intentionally modifying the local variables in a way where after the modification, all code that uses it would have used it. @WrapOperation meanwhile acts as an easier version of @ModifyArgs and only modifies the parameters of a method call, not the variables themselves

Anyway, I'll be merging this after testing this

@EnnuiL
Copy link
Collaborator

EnnuiL commented Oct 5, 2025

Everything's working out! Thanks for the PR

@EnnuiL EnnuiL merged commit d9c6f1c into Up-Mods:1.21.9 Oct 5, 2025
1 check passed
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

Successfully merging this pull request may close these issues.

2 participants