tutorial:mixin_examples
Differences
This shows you the differences between two versions of the page.
Next revision | Previous revisionNext revisionBoth sides next revision | ||
tutorial:mixin_examples [2020/09/14 05:06] – created siglong | tutorial:mixin_examples [2020/09/14 05:28] – minor improvement siglong | ||
---|---|---|---|
Line 2: | Line 2: | ||
This is a collection of frequently used mixins. | This is a collection of frequently used mixins. | ||
- | ===== injecting | + | ===== Injecting |
Mixin: | Mixin: | ||
<code java> | <code java> | ||
Line 21: | Line 21: | ||
</ | </ | ||
- | ===== injecting | + | ===== Injecting |
Mixin: | Mixin: | ||
<code java> | <code java> | ||
Line 42: | Line 42: | ||
</ | </ | ||
- | ===== injecting | + | ===== Injecting |
Mixin: | Mixin: | ||
<code java> | <code java> | ||
Line 64: | Line 64: | ||
</ | </ | ||
- | ===== injecting | + | ===== Injecting |
Mixin: | Mixin: | ||
<code java> | <code java> | ||
Line 84: | Line 84: | ||
</ | </ | ||
- | ===== injecting | + | ===== Injecting |
Mixin: | Mixin: | ||
<code java> | <code java> | ||
Line 296: | Line 296: | ||
@ModifyArgs(method = " | @ModifyArgs(method = " | ||
private void injected(Args args) { | private void injected(Args args) { | ||
- | | + | int a0 = args.get(0); |
- | args.set(1, args.< | + | double a1 = args.get(1); |
- | args.set(2, !args.< | + | boolean a2 = args.get(2); |
+ | args.set(0, a0 + 3); | ||
+ | | ||
+ | args.set(2, !a2); | ||
} | } | ||
</ | </ |
tutorial/mixin_examples.txt · Last modified: 2024/01/13 15:02 by arkosammy12