tutorial:mixin_injects
Differences
This shows you the differences between two versions of the page.
| Both sides previous revisionPrevious revisionNext revision | Previous revision | ||
| tutorial:mixin_injects [2025/12/08 00:59] – Add disclaimer on Local capture becoming significantly less brittle on unobfuscated targets such as 26.1+ MC code gauntrecluse | tutorial:mixin_injects [2025/12/15 16:52] (current) – Added an extra bracket to show that it has to be inside @At more clearly mcgambingpro | ||
|---|---|---|---|
| Line 34: | Line 34: | ||
| /*...*/ | /*...*/ | ||
| float force = complexCalculation(quantity); | float force = complexCalculation(quantity); | ||
| - | haykam.slap(quantity, | + | haykam.slap(quantity, |
| | | ||
| /*...*/ | /*...*/ | ||
| } | } | ||
| </ | </ | ||
| - | if we wished to inject right after the '' | + | if we wished to inject right after the '' |
| For the sake of showing how to appropriately add our new operations after the original method call outside of void returns, we'll say '' | For the sake of showing how to appropriately add our new operations after the original method call outside of void returns, we'll say '' | ||
| <code java> | <code java> | ||
| @WrapOperation(method = " | @WrapOperation(method = " | ||
| - | private boolean onHaykamSlapped(Person instance, int quantity, float force, Operation< | + | private boolean onHaykamSlapped(Person instance, int quantity, float forceOverResistance, Operation< |
| - | boolean originalValue = original.call(instance, | + | boolean originalValue = original.call(instance, |
| - | newOperations(force, instance); | + | newOperations(forceOverResistance, instance); |
| return originalValue; | return originalValue; | ||
| } | } | ||
| </ | </ | ||
| - | This allows us to get the '' | + | This allows us to get the returned value of the '' |
| - | :!: Note that local capture is particularly brittle | + | :!: Note that '' |
| In summary of this subsection, '' | In summary of this subsection, '' | ||
| Line 134: | Line 134: | ||
| The only common form of shifting comes in the form of using '' | The only common form of shifting comes in the form of using '' | ||
| <code java> | <code java> | ||
| - | @Inject(method = " | + | @Inject(method = " |
| </ | </ | ||
tutorial/mixin_injects.1765155561.txt.gz · Last modified: 2025/12/08 00:59 by gauntrecluse