From 9a355f33af77ea22776a943c6d12058cc61cce2a Mon Sep 17 00:00:00 2001 From: zaaarf Date: Wed, 1 Mar 2023 22:02:29 +0100 Subject: feat: replaced put(), get() and call() with InsnNode extensions --- .../ftbsc/lll/tools/nodes/FieldProxyInsnNode.java | 26 ++++++++++++++++++++++ 1 file changed, 26 insertions(+) create mode 100644 src/main/java/ftbsc/lll/tools/nodes/FieldProxyInsnNode.java (limited to 'src/main/java/ftbsc/lll/tools/nodes/FieldProxyInsnNode.java') diff --git a/src/main/java/ftbsc/lll/tools/nodes/FieldProxyInsnNode.java b/src/main/java/ftbsc/lll/tools/nodes/FieldProxyInsnNode.java new file mode 100644 index 0000000..34a0d67 --- /dev/null +++ b/src/main/java/ftbsc/lll/tools/nodes/FieldProxyInsnNode.java @@ -0,0 +1,26 @@ +package ftbsc.lll.tools.nodes; + +import ftbsc.lll.proxies.FieldProxy; +import org.objectweb.asm.tree.FieldInsnNode; + +/** + * Overrides the {@link FieldInsnNode} to add a constructor + * taking in a {@link FieldProxy}. + * @since 0.3.0 + */ +public class FieldProxyInsnNode extends FieldInsnNode { + /** + * Constructs a new {@link FieldInsnNode} starting + * from a {@link FieldProxy}. + * @param opcode the opcode, must be one of GETSTATIC, PUTSTATIC, + * GETFIELD or PUTFIELD + */ + public FieldProxyInsnNode(int opcode, FieldProxy proxy) { + super( + opcode, + proxy.getParent().replace('.', '/'), + proxy.getSrgName(), + proxy.getDescriptor() + ); + } +} \ No newline at end of file -- cgit v1.2.3-56-ga3b1