drafts:mixin_injectors
Differences
This shows you the differences between two versions of the page.
| Both sides previous revisionPrevious revisionNext revision | Previous revision | ||
| drafts:mixin_injectors [2026/01/24 01:26] – gauntrecluse | drafts:mixin_injectors [2026/02/20 20:39] (current) – [Injection Point, the value attribute] Add CTOR_HEAD injection point gauntrecluse | ||
|---|---|---|---|
| Line 66: | Line 66: | ||
| ^ String Form in Annotation | ^ String Form in Annotation | ||
| | '' | | '' | ||
| + | | '' | ||
| | '' | | '' | ||
| | '' | | '' | ||
| Line 130: | Line 131: | ||
| ==== Slice ==== | ==== Slice ==== | ||
| - | A slice uses one or two additional '' | + | A slice uses one or two additional '' |
| <code java> | <code java> | ||
| - | @At( | + | @InjectorAnnotation( |
| - | | + | |
| + | at = @At(...), | ||
| slice = @Slice( | slice = @Slice( | ||
| - | from = @At(...) | + | from = @At(...), |
| to = @At(...) | to = @At(...) | ||
| ) | ) | ||
| - | ) | + | ) |
| </ | </ | ||
| - | + | '' | |
| - | '' | + | |
| :!: When slicing, the default [[# | :!: When slicing, the default [[# | ||
| Line 212: | Line 213: | ||
| Mixins are able to merge new members into target classes and modify existing methods related to data management, which can theoretically be used to effectively add data to existing classes for your own use-cases. This, however, is not advised as it takes a great amount of work, and Fabric already provides a [[https:// | Mixins are able to merge new members into target classes and modify existing methods related to data management, which can theoretically be used to effectively add data to existing classes for your own use-cases. This, however, is not advised as it takes a great amount of work, and Fabric already provides a [[https:// | ||
| - | There are cases where Fabric may not provide a sufficient API for adding data for your goals. In those cases, using Mixin to merge methods and fields to store data for certain classes is a valid approach. In those cases, it is however wise to first ask for advice if you are not experienced with it yourself, as this requires to be very careful. | + | There are cases where Fabric may not provide a sufficient API for adding data for your goals. In those cases, using Mixin to merge methods and fields to store data for certain classes is a valid approach. In those cases, it is however wise to first ask for advice if you are not experienced with it yourself, as this requires |
| === Merging static blocks and Members === | === Merging static blocks and Members === | ||
drafts/mixin_injectors.1769218003.txt.gz · Last modified: 2026/01/24 01:26 by gauntrecluse