Signed-off-by: Graham <gpe@openrs2.dev>
@ -73,7 +73,7 @@ class ClassPath(
return@computeIfAbsent ReflectionClassMetadata(this, clazz)
}
fun getNode(name: String): ClassNode? {
fun getClassNode(name: String): ClassNode? {
for (library in libraries) {
val clazz = library[name]
if (clazz != null) {
@ -95,7 +95,7 @@ class ConstantArgTransformer : Transformer() {
private fun analyzeMethod(classPath: ClassPath, ref: MemberRef) {
// find ClassNode/MethodNode
val owner = classPath.getNode(ref.owner) ?: return
val owner = classPath.getClassNode(ref.owner) ?: return
val originalMethod = owner.methods.singleOrNull { it.name == ref.name && it.desc == ref.desc } ?: return
if (!originalMethod.hasCode()) {
return
@ -77,7 +77,7 @@ class CounterTransformer : Transformer() {
continue
val owner = classPath.getNode(counter.owner)!!
val owner = classPath.getClassNode(counter.owner)!!
owner.fields.removeIf { it.name == counter.name && it.desc == counter.desc }
counters.add(counter)
@ -33,7 +33,7 @@ class ResetTransformer : Transformer() {
val masterReset = findMasterReset(method) ?: continue
logger.info { "Identified master reset method $masterReset" }
val resetClass = classPath.getNode("client")!!
val resetClass = classPath.getClassNode("client")!!
val resetMethod = resetClass.methods.first {
it.name == masterReset.name && it.desc == masterReset.desc