diff --git a/asm/src/main/java/dev/openrs2/asm/classpath/ExtendedRemapper.kt b/asm/src/main/java/dev/openrs2/asm/classpath/ExtendedRemapper.kt index beb3253b..b9e17ce0 100644 --- a/asm/src/main/java/dev/openrs2/asm/classpath/ExtendedRemapper.kt +++ b/asm/src/main/java/dev/openrs2/asm/classpath/ExtendedRemapper.kt @@ -3,6 +3,10 @@ package dev.openrs2.asm.classpath import org.objectweb.asm.commons.Remapper abstract class ExtendedRemapper : Remapper() { + open fun getFieldInitializer(owner: String, name: String, descriptor: String): FieldInitializer? { + return null + } + open fun mapFieldOwner(owner: String, name: String, descriptor: String): String { return mapType(owner) } diff --git a/asm/src/main/java/dev/openrs2/asm/classpath/FieldInitializer.kt b/asm/src/main/java/dev/openrs2/asm/classpath/FieldInitializer.kt new file mode 100644 index 00000000..3b64da40 --- /dev/null +++ b/asm/src/main/java/dev/openrs2/asm/classpath/FieldInitializer.kt @@ -0,0 +1,14 @@ +package dev.openrs2.asm.classpath + +import dev.openrs2.asm.MemberRef +import org.objectweb.asm.Opcodes +import org.objectweb.asm.tree.AbstractInsnNode +import org.objectweb.asm.tree.FieldInsnNode + +class FieldInitializer(val instructions: List, val version: Int, val maxStack: Int) { + val dependencies = instructions.asSequence() + .filterIsInstance() + .filter { it.opcode == Opcodes.GETSTATIC } + .map(::MemberRef) + .toSet() +}