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

Local variables captured with 0.10.0+ get carried over into mods requiring 0.9.2 compatibility #89

Open
TibiNonEst opened this issue May 2, 2022 · 0 comments

Comments

@TibiNonEst
Copy link

TibiNonEst commented May 2, 2022

A little while ago there was a change made to how local variables are captured with mixin. The minor version was bumped from 0.9.2 to 0.10.0 and a compatibility layer was created to emulate the 0.9.2 local capture behavior to maintain compatibility with mods that relied on it.

The tl;dr of this issue is that, as of the most recent version, while both 0.9.2 and 0.10.0 local variable capture compatibility work fine, when local variables are captured by a mod using 0.10.0 compatibility followed by a mod with 0.9.2 compatibility, the extra variables exposed in the newer version show up in the older version.

This is visible if you load a mod (mod a) depending on some loader version > 0.12.0 that captures local variables from a method, let's use net.minecraft.client.Mouse#updateMouse() as an example, followed by a mod (mod b) that depends on a loader version < 0.12.0 that also tries capture the local variables from updateMouse(). Both of these mods will capture the local variables as expected on their own; if we print the variables to be captured with LocalCapture.PRINT, mod a will report double d, double e, double k, double l, double f, double g, double h, int m while mod b will report double e, double k, double l, int m. This is all to be expected, mod b depends on a version of fabric that requires it to have compatibility with the 0.9.2 local capture behavior. However, if we make sure to load mod a before mod b, mod b will report that it needs to capture all of double d, double e, double k, double l, double f, double g, double h, int m, the same as if it were using 0.10.0 compatibility.

Unfortunately, I do not know how mixin works so I can't give much more technical details than what is written above, the best way I can describe this is to say that the local variables that 0.10.0 compatible mods are exposing get carried over to mods using 0.9.2 compatibility.

Temporarily this can be fixed on the loader side by sorting the load order by mixin compatibility version, however, it would be nice if this behavior could be rectified on mixin's side of things.

@TibiNonEst TibiNonEst changed the title Problems with local variable handling compatibility Mods using local variable capture compatible with 0.9.2 capture incorrect variables when loaded after mods using the 0.10.0 method May 2, 2022
@TibiNonEst TibiNonEst changed the title Mods using local variable capture compatible with 0.9.2 capture incorrect variables when loaded after mods using the 0.10.0 method Local variables captured with 0.10.0+ get carried over into mods requiring 0.9.2 compatibility May 3, 2022
TibiNonEst added a commit to TibiNonEst/quilt-loader that referenced this issue May 6, 2022
TheGlitch76 pushed a commit to QuiltMC/quilt-loader that referenced this issue May 8, 2022
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

1 participant