User Tools

Site Tools


minecraft:mod:mixin:injection-point

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
minecraft:mod:mixin:injection-point [2024/02/18 01:14] – Add info about @Slice raccoonminecraft:mod:mixin:injection-point [2024/02/18 05:59] (current) raccoon
Line 5: Line 5:
 Injection points are created with the ''@At'' annotation, which takes a ''String value'' consisting of one of the following: Injection points are created with the ''@At'' annotation, which takes a ''String value'' consisting of one of the following:
  
-^ name              ^ position                                                    ^ ''target''? ^ ''ordinal''? ^ ''opcode''? ^ ''args''?+^ name              ^ position                                                                   ^ ''target''? ^ ''ordinal''? ^ ''opcode''? ^ ''args''?
-| ''HEAD''          | top of the method                                           |                          |                       | +| ''HEAD''          | top of method                                                                                     |                       | 
-| ''RETURN''        | before a ''return''                                         |             | yes          |                       | +| ''CTOR_HEAD''     | top of a constructor, after initializers and ''super''/''this'' delegation |                          |                       | 
-| ''TAIL''          | before the //final// ''return''                             |                          |                       | +| ''RETURN''        | before a ''return''                                                        |             | yes          |                       | 
-| ''INVOKE''        | before a method invocation                                  | yes         | yes          |                       | +| ''TAIL''          | before the //final// ''return''                                            |                          |                       | 
-| ''INVOKE_ASSIGN'' | //after// a method is assigned to a local                   | yes         | yes          |                       | +| ''LOAD''          | before reading a local variable or argument                                |             | yes          |                       | 
-| ''FIELD''         | before getting or setting a field                           | yes         | yes          | yes                   | +| ''STORE''         | after writing a local variable or argument                                             | yes          |                       | 
-| ''NEW''           | before an object creation                                   yes         | yes          |                       +| ''NEW''           | before an object creation                                                  | yes         | yes          |                       | 
-| ''INVOKE_STRING'' | before a method invocation with a single string literal arg | yes         | yes          |             | yes       | +| ''INVOKE''        | before a method invocation                                                 | yes         | yes          |                       | 
-| ''JUMP''          | before a jump                                               |             | yes          | yes                   +| ''INVOKE_ASSIGN'' | //after// a method invocation, and after it'assigned to a local          | yes         | yes          |                       | 
-| ''CONSTANT''      | before a literal                                            |             | yes          |             | yes       |+| ''FIELD''         | before getting or setting a field                                          | yes         | yes          | yes                   | 
 +| ''CONSTANT''      | before a literal                                                                       | yes          |             yes       
 +| ''INVOKE_STRING'' | before a method invocation with a single string literal arg                | yes         | yes          |             | yes       | 
 +| ''JUMP''          | before a jump                                                              |             | yes          | yes                   |
  
 Each of these injection points refers to //every// point that matches its description. So, it's often necessary to narrow down the results with the additional specifiers I've noted at the end of the table. Each of these injection points refers to //every// point that matches its description. So, it's often necessary to narrow down the results with the additional specifiers I've noted at the end of the table.
Line 33: Line 36:
 ====== @Slice ====== ====== @Slice ======
  
-Injection points are also used to limit the //region of the body// to search. The annotations that accept ''at = @At(...)'' also accept ''slice = @Slice(from = @At(...), to = @At(...))''. If present, a slice will prevent injection points outside it from being matched.+Injection points are also used to limit the //region of the body// to search. The annotations that accept ''at = @At(...)'' also optionally accept ''slice = @Slice(from = @At(...), to = @At(...))''. If present, a slice will prevent injection points outside it from being matched.
minecraft/mod/mixin/injection-point.1708218895.txt.gz · Last modified: 2024/02/18 01:14 by raccoon

Donate Powered by PHP Valid HTML5 Valid CSS Driven by DokuWiki