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
Next revisionBoth sides next revision
tutorial:mixin_examples [2020/09/14 05:07] – minor improvement siglongtutorial:mixin_examples [2020/09/26 16:02] – minor improvement siglong
Line 64: Line 64:
 </code> </code>
  
-===== Injecting into before method call =====+===== Injecting into the point before method call =====
 Mixin: Mixin:
 <code java> <code java>
Line 84: Line 84:
 </code> </code>
  
-===== Injecting into after method call =====+===== Injecting into the point after method call =====
 Mixin: Mixin:
 <code java> <code java>
Line 296: Line 296:
 @ModifyArgs(method = "foo()V", at = @At(value = "INVOKE", target = "La/b/c/Something;doSomething(IDZ)V")) @ModifyArgs(method = "foo()V", at = @At(value = "INVOKE", target = "La/b/c/Something;doSomething(IDZ)V"))
 private void injected(Args args) { private void injected(Args args) {
-  args.set(0args.<Integer>get(0+ 3); +    int a0 = args.get(0); 
-  args.set(1, args.<Double>get(1* 2.0D); +    double a1 = args.get(1)
-  args.set(2, !args.<Boolean>get(2));+    boolean a2 = args.get(2); 
 +    args.set(0a0 + 3); 
 +    args.set(1, a1 * 2.0D); 
 +    args.set(2, !a2);
 } }
 </code> </code>
tutorial/mixin_examples.txt · Last modified: 2024/01/13 15:02 by arkosammy12