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/12 23:26] arkosammy12tutorial:mixin_examples [2024/11/18 15:52] (current) – fixed some of the argument names in mixinextra section bemoty
Line 272: Line 272:
  
 ==== Capture locals with MixinExtras ==== ==== Capture locals with MixinExtras ====
 +:!: See the oficial MixinExtra's [[https://github.com/LlamaLad7/MixinExtras/wiki/Local|Wiki]].
 +
 :!: MixinExtras required Fabric Loader 0.15 or above, or you have to manually specify it in ''build.gradle''. :!: MixinExtras required Fabric Loader 0.15 or above, or you have to manually specify it in ''build.gradle''.
  
 :!: 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.
- 
-:!: More information about MixinExtra's ''@Local'' annotation can be found in its [[https://github.com/LlamaLad7/MixinExtras/wiki/Local|Wiki]]. 
  
 Mixin: Mixin:
Line 282: Line 282:
 @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 303:
 @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.1705101994.txt.gz · Last modified: 2024/01/12 23:26 by arkosammy12