User Tools

Site Tools


tutorial:mixin_injects

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
Next revisionBoth sides next revision
tutorial:mixin_injects [2020/06/10 23:05] – Clarify injection example pyrofabtutorial:mixin_injects [2020/08/26 04:55] – Add a note on constructor descriptor siglong
Line 47: Line 47:
  
 === Injecting into Constructors === === Injecting into Constructors ===
-To inject into a constructor, use ''<init>()V'' as the method target, with ''()'' containing the constructor argument descriptors. When injecting into constructors, ''@At'' must be set to either ''TAIL'' or ''RETURN''.+To inject into a constructor, use ''<init>()V'' as the method target, with ''()'' containing the constructor argument descriptors. When injecting into constructors, ''@At'' must be set to either ''TAIL'' or ''RETURN''Note that some classes have methods named ''init'' which are different from ''<init>''. Don't get confused!
  
 ===== Practical Example ===== ===== Practical Example =====
Line 62: Line 62:
 </code> </code>
  
-For more information on this particular example, view its usage in the [[Fabric Example Mod repo]].+For more information on this particular example, view its usage in the [[https://github.com/FabricMC/fabric-example-mod/blob/master/src/main/java/net/fabricmc/example/mixin/ExampleMixin.java|Fabric Example Mod repo]].
tutorial/mixin_injects.txt · Last modified: 2022/08/05 19:19 by clomclem