tutorial:mixin_injects
Differences
This shows you the differences between two versions of the page.
Both sides previous revisionPrevious revisionNext revision | Previous revisionNext revisionBoth sides next revision | ||
tutorial:mixin_injects [2020/02/07 01:39] – remove formatting in code block draylar | tutorial:mixin_injects [2020/02/07 01:46] – final cleanup draylar | ||
---|---|---|---|
Line 23: | Line 23: | ||
//@Inject// methods always have a void return type. The method name does not matter; using something that describes what the inject does is best. The target method' | //@Inject// methods always have a void return type. The method name does not matter; using something that describes what the inject does is best. The target method' | ||
- | ===== Annotation ===== | + | === Returning & Cancelling from Inject |
- | ===== Method Header ===== | + | To cancel or return early inside a method, use '' |
- | ===== Method Body ===== | + | <code java> |
+ | @Inject(method | ||
+ | </ | ||
+ | |||
+ | |||
===== Practical Example ===== | ===== Practical Example ===== | ||
- | An example | + | The following |
<code java [enable_line_numbers=" | <code java [enable_line_numbers=" | ||
@Mixin(TitleScreen.class) | @Mixin(TitleScreen.class) | ||
Line 37: | Line 43: | ||
} | } | ||
</ | </ | ||
+ | |||
+ | For more information on this particular example, view its usage in the [[Fabric Example Mod repo]]. |
tutorial/mixin_injects.txt · Last modified: 2022/08/05 19:19 by clomclem