Annotation Interface WrapWithCondition
Allows you to wrap a
This chains when used by multiple people, unlike
void method call or
field write
with a conditional check.
Your handler method receives the targeted instruction's arguments (optionally followed by the enclosing method's parameters), and should return a boolean indicating whether the operation should go ahead:
| Targeted operation | Handler signature |
|---|---|
| Non-static method call | private (static) boolean handler(ReceiverType instance, <params of the original
call>) |
| Static method call | private (static) boolean handler(<params of the original call>) |
| Non-static field write | private (static) boolean handler(ReceiverType instance, FieldType newValue)
|
| Static field write | private (static) boolean handler(FieldType newValue) |
@Redirect.
If you always return false then you risk other people's code 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
-