Annotation Interface ModifyReceiver
Allows you to modify the receiver of a non-static
This chains when used by multiple people, unlike
method call or
field get/set.
Your handler method receives the targeted instruction's arguments (optionally followed by the enclosing method's parameters), and should return the adjusted receiver for the operation.
| Targeted operation | Handler signature |
|---|---|
| Non-static method call | private (static) ReceiverType handler(ReceiverType original, <params of the
original call>) |
super. method call |
private (static) ThisClass handler(ThisClass original, <params of the original
call>) |
| Non-static field get | private (static) ReceiverType handler(ReceiverType original) |
| Non-static field write | private (static) ReceiverType handler(ReceiverType original, FieldType newValue)
|
@Redirect.
If you never use the original then you risk other people's changes being silently ignored.
See the wiki article for more info.
-
Required Element Summary
Required Elements -
Optional Element Summary
Optional Elements
-
Element Details
-
method
String[] method -
at
org.spongepowered.asm.mixin.injection.At[] at
-
-
-
slice
org.spongepowered.asm.mixin.injection.Slice[] slice- Default:
- {}
-
remap
boolean remap- Default:
- true
-
require
int require- Default:
- -1
-
expect
int expect- Default:
- 1
-
allow
int allow- Default:
- -1
-