User Tools

Site Tools


tutorial:mixin_glossary

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
tutorial:mixin_glossary [2025/11/29 03:26] gauntreclusetutorial:mixin_glossary [2025/11/29 03:49] (current) gauntrecluse
Line 74: Line 74:
 == Merging, to merge == == Merging, to merge ==
   - In the context of Mixin, merging most of members and new interface implementations from the Mixin class into the target class's bytecode.   - In the context of Mixin, merging most of members and new interface implementations from the Mixin class into the target class's bytecode.
 +
 +
 +== Shadowing ==
 +  - Reference to usages of ''@Shadow'', an annotation used to simulate the presence of fields and methods from the target class to reference them. Shadowing avoids needing to cast a ''this'' to the target class for any and all fields.
 +
 +== Double-Casting ==
 +  - For Mixins, references the practice of casting a ''this'' instance of the Mixin class to ''Object'' and then to the target class. This is used mainly to pass the ''this'' instance of the target class as an argument. It is advised to use [[#shadowing|Shadows]] to reference the target's fields, and to extend the target's parents to access the parents' fields.
 +
 +
 +== Accessor ==
 +  - Reference to an [[tutorial:mixin_accessors|Accessor Mixin]], or in other words an interface Mixin composed purely of ''@Accessor'' and ''@Invoker'' Mixins.
 +  - Reference to the ''@Accessor'' annotation and its usages. An accessor is used to create public getter/setter fields for fields that would otherwise be immutable or inaccessible.
 +
 +== Invoker ==
 +  - Reference to the ''@Invoker'' annotation and its usages. An Invoker is used to call methods that would otherwise be inaccessible. It is mainly used in the context of [[tutorial:mixin_accessors|Accessor Mixins]].
 +
  
  
Line 204: Line 220:
  
 ==== Targeting Tools ==== ==== Targeting Tools ====
-Outside of [[#injection_point|Injection Points]], the Mixin toolchain provides different features that may be used to more precisely target a specific element of a target method matching the injection point. This is useful for making an injector less "[[#brittle|brittle]]", and making it +Outside of [[#injection_point|Injection Points]], the Mixin toolchain provides different features that may be used to more precisely target a specific element of a target method matching the injection point. This is essential for making an injector less "[[#brittle|brittle]]", and making more precise changes which are more compatible. Note that different discriminators may be combined, such as using both an [[#expressions|expression]] and a [[#slice,_slicing|slice]] for the same injector if needed.
  
  
Line 218: Line 234:
   - Added in MixinExtras ''0.5.0'', a feature consisting of injection point ''"MIXINEXTRAS:EXPRESSION"'' and associated tools, such as ''@Expression'' and ''@Definition''. Used to allow injectors to target a very wide range of instructions in a target method by using java-like expressions closer to a source code representation. MixinExtras ''0.5.0'' is bundled with Fabric Loader 0.17.0 and later.   - Added in MixinExtras ''0.5.0'', a feature consisting of injection point ''"MIXINEXTRAS:EXPRESSION"'' and associated tools, such as ''@Expression'' and ''@Definition''. Used to allow injectors to target a very wide range of instructions in a target method by using java-like expressions closer to a source code representation. MixinExtras ''0.5.0'' is bundled with Fabric Loader 0.17.0 and later.
     - To "use an expression" may refer to using MixinExtras Expressions to target a certain piece of target code.     - To "use an expression" may refer to using MixinExtras Expressions to target a certain piece of target code.
-    * See [[https://github.com/LlamaLad7/MixinExtras/wiki/Expressions|the official wiki articles]]+    * See [[https://github.com/LlamaLad7/MixinExtras/wiki/Expressions|the official wiki articles and tutorial.]]
  
 == MixinExtras Flowchart == == MixinExtras Flowchart ==
Line 224: Line 240:
  
 == @Definition == == @Definition ==
-  - In the context of Expressions a "definition" is used to refer to ''@Definition'' annotation usages. Definitions are used to declare what individual identifiers within an expression correspond to in code, such as types, methods, or variables.+  - In the context of [[#expressions|expressions]], a "definition" is used to refer to ''@Definition'' annotation usages. Definitions are used to declare what individual identifiers within an expression correspond to in code, such as types, methods, or variables.
  
 == Wildcard == == Wildcard ==
Line 231: Line 247:
  
 == Ordinal == == Ordinal ==
-  - Zero-indexed integer value used to select a single target within the list of potential targets based on other discriminators and targeting tools. An ordinal of 0 would target the first of the potential targets by order of appearance in bytecode, for instance+  - A discriminator which, between all valid targets once other filters and discriminators are applied, uses a zero-indexed value to select one of the remaining targets for the injector to target
-    * Ordinals are generally a more brittle and less recommended discriminator for targeting using injectors.+    * Ordinals are generally a more [[#brittle|brittle]] and less recommended discriminator for targeting using injectors. Using [[#slice,_slicing|slices]] or [[#expressions|expressions]] is recommended instead in cases where an ordinal would be only used as a disambiguation tool between different targets for an injection point.
tutorial/mixin_glossary.1764386811.txt.gz · Last modified: 2025/11/29 03:26 by gauntrecluse