public class BeforeInvoke extends InjectionPoint
This injection point searches for INVOKEVIRTUAL, INVOKESTATIC and
INVOKESPECIAL opcodes matching its arguments and returns a list of insns
immediately prior to matching instructions. It accepts the following
parameters from At:
MemberInfo which identifies the target methodExample:
@At(value = "INVOKE", target="func_1234_a(III)V")
Note that like all standard injection points, this class matches the insn
itself, putting the injection point immediately before the access in
question. Use At.shift() specifier to adjust the matched opcode as
necessary.
| Modifier and Type | Class and Description |
|---|---|
static class |
BeforeInvoke.SearchType
Member search type, the PERMISSIVE search is only used when
refmap remapping is enabled.
|
InjectionPoint.AtCode, InjectionPoint.Selector| Modifier and Type | Field and Description |
|---|---|
protected boolean |
allowPermissive
This option enables a fallback "permissive" search to occur if initial
search fails if and only if the
MixinEnvironment.Option.REFMAP_REMAP option is
enabled and the context mixin's parent config has a valid refmap. |
protected java.lang.String |
className
Class name (description) for debug logging
|
protected IMixinContext |
context |
protected org.apache.logging.log4j.Logger |
logger
Logger reference
|
protected int |
ordinal
This strategy can be used to identify a particular invocation if the same
method is invoked at multiple points, if this value is -1 then the
strategy returns all invocations of the method.
|
protected MemberInfo |
target |
DEFAULT_ALLOWED_SHIFT_BY, MAX_ALLOWED_SHIFT_BY| Constructor and Description |
|---|
BeforeInvoke(InjectionPointData data) |
| Modifier and Type | Method and Description |
|---|---|
protected boolean |
addInsn(org.spongepowered.asm.lib.tree.InsnList insns,
java.util.Collection<org.spongepowered.asm.lib.tree.AbstractInsnNode> nodes,
org.spongepowered.asm.lib.tree.AbstractInsnNode insn) |
boolean |
find(java.lang.String desc,
org.spongepowered.asm.lib.tree.InsnList insns,
java.util.Collection<org.spongepowered.asm.lib.tree.AbstractInsnNode> nodes)
Find injection points in the supplied insn list
|
protected boolean |
find(java.lang.String desc,
org.spongepowered.asm.lib.tree.InsnList insns,
java.util.Collection<org.spongepowered.asm.lib.tree.AbstractInsnNode> nodes,
MemberInfo member,
BeforeInvoke.SearchType searchType) |
protected void |
inspectInsn(java.lang.String desc,
org.spongepowered.asm.lib.tree.InsnList insns,
org.spongepowered.asm.lib.tree.AbstractInsnNode insn) |
protected void |
log(java.lang.String message,
java.lang.Object... params) |
protected boolean |
matchesInsn(org.spongepowered.asm.lib.tree.AbstractInsnNode insn) |
protected boolean |
matchesInsn(MemberInfo nodeInfo,
int ordinal) |
BeforeInvoke |
setLogging(boolean logging)
Set the logging state for this injector
|
protected final MemberInfo target
protected final boolean allowPermissive
MixinEnvironment.Option.REFMAP_REMAP option is
enabled and the context mixin's parent config has a valid refmap.protected final int ordinal
protected final java.lang.String className
protected final IMixinContext context
protected final org.apache.logging.log4j.Logger logger
public BeforeInvoke(InjectionPointData data)
public BeforeInvoke setLogging(boolean logging)
logging - logging statepublic boolean find(java.lang.String desc,
org.spongepowered.asm.lib.tree.InsnList insns,
java.util.Collection<org.spongepowered.asm.lib.tree.AbstractInsnNode> nodes)
InjectionPointfind in class InjectionPointdesc - Method descriptor, supplied to allow return types and
arguments etc. to be determinedinsns - Insn list to search in, the strategy MUST ONLY add nodes
from this list to the nodes collectionnodes - Collection of nodes to populate. Injectors should NOT make
any assumptions about the state of this collection and should only
call the add() methodprotected boolean find(java.lang.String desc,
org.spongepowered.asm.lib.tree.InsnList insns,
java.util.Collection<org.spongepowered.asm.lib.tree.AbstractInsnNode> nodes,
MemberInfo member,
BeforeInvoke.SearchType searchType)
protected boolean addInsn(org.spongepowered.asm.lib.tree.InsnList insns,
java.util.Collection<org.spongepowered.asm.lib.tree.AbstractInsnNode> nodes,
org.spongepowered.asm.lib.tree.AbstractInsnNode insn)
protected boolean matchesInsn(org.spongepowered.asm.lib.tree.AbstractInsnNode insn)
protected void inspectInsn(java.lang.String desc,
org.spongepowered.asm.lib.tree.InsnList insns,
org.spongepowered.asm.lib.tree.AbstractInsnNode insn)
protected boolean matchesInsn(MemberInfo nodeInfo, int ordinal)
protected void log(java.lang.String message,
java.lang.Object... params)