tutorial:mixin_examples
Differences
This shows you the differences between two versions of the page.
Both sides previous revisionPrevious revisionNext revision | Previous revision | ||
tutorial:mixin_examples [2023/12/18 02:24] – [Capturing locals from multiple locals of a type] solidblock | tutorial:mixin_examples [2025/10/12 09:21] (current) – Mark page as having a planned rewrite gauntrecluse | ||
---|---|---|---|
Line 1: | Line 1: | ||
+ | FIXME //The Fabric Wiki's Mixin segments is under heavy reviews, pages on the topic are subject to major edits or rewrites. This page in particular is noted as being unreliable to learn Mixin as a tool from. Learning by example should be used sparingly, as it may lead to a lack of understanding. Prioritize, if you are unable to learn through documentation, | ||
+ | |||
+ | |||
+ | :!: //A rewrite of this page is planned and will be drafted in the foreseeable future, whilst some quicker changes and improvements may be applied to this page in the process, more fundamental structural changes will happen as part of a broader rewrite and replacement by a new version of the page// | ||
+ | |||
====== Mixin Examples ====== | ====== Mixin Examples ====== | ||
This is a collection of frequently used mixins. | This is a collection of frequently used mixins. | ||
Line 272: | Line 277: | ||
==== Capture locals with MixinExtras ==== | ==== Capture locals with MixinExtras ==== | ||
+ | :!: See the oficial MixinExtra' | ||
+ | |||
:!: MixinExtras required Fabric Loader 0.15 or above, or you have to manually specify it in '' | :!: MixinExtras required Fabric Loader 0.15 or above, or you have to manually specify it in '' | ||
- | :!: If ther are multiple locals with that type, you have to specify '' | + | :!: If there are multiple locals with that type, you have to specify '' |
+ | |||
+ | :!: the use of '' | ||
Mixin: | Mixin: | ||
Line 280: | Line 289: | ||
@Inject(method = " | @Inject(method = " | ||
private void injected(CallbackInfo ci, @Local TypeArg2 arg2) { | private void injected(CallbackInfo ci, @Local TypeArg2 arg2) { | ||
- | | + | |
} | } | ||
</ | </ | ||
Line 301: | Line 310: | ||
@Inject(method = " | @Inject(method = " | ||
private void injected(CallbackInfo ci, @Local(ordinal = 2) TypeArg arg) { | private void injected(CallbackInfo ci, @Local(ordinal = 2) TypeArg arg) { | ||
- | | + | |
} | } | ||
</ | </ |
tutorial/mixin_examples.1702866271.txt.gz · Last modified: 2023/12/18 02:24 by solidblock