User Tools

Site Tools


tutorial:mixin_examples

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revisionPrevious revision
Next revision
Previous revision
tutorial:mixin_examples [2024/01/13 15:02] arkosammy12tutorial:mixin_examples [2025/06/17 16:49] (current) – recommend @Local the...why...even...how
Line 277: Line 277:
  
 :!: If there are multiple locals with that type, you have to specify ''ordinal'' or it will throw an error. :!: If there are multiple locals with that type, you have to specify ''ordinal'' or it will throw an error.
 +
 +:!: the use of ''@Local'' is recommended over ''LocalCapture''
  
 Mixin: Mixin:
Line 282: Line 284:
 @Inject(method = "foo()V", at = @At(value = "TAIL")) @Inject(method = "foo()V", at = @At(value = "TAIL"))
 private void injected(CallbackInfo ci, @Local TypeArg2 arg2) { private void injected(CallbackInfo ci, @Local TypeArg2 arg2) {
-  arg1.doSomething4();+  arg2.doSomething4();
 } }
 </code> </code>
Line 303: Line 305:
 @Inject(method = "foo()V", at = @At(value = "TAIL")) @Inject(method = "foo()V", at = @At(value = "TAIL"))
 private void injected(CallbackInfo ci, @Local(ordinal = 2) TypeArg arg) { private void injected(CallbackInfo ci, @Local(ordinal = 2) TypeArg arg) {
-  arg1.doSomething4();+  arg.doSomething4();
 } }
 </code> </code>
tutorial/mixin_examples.1705158166.txt.gz · Last modified: 2024/01/13 15:02 by arkosammy12