diff options
author | Jonas Herzig <jonas@spark-squared.com> | 2021-11-13 09:49:17 +0100 |
---|---|---|
committer | Jonas Herzig <jonas@spark-squared.com> | 2021-11-13 10:28:09 +0100 |
commit | 26107cde7a9c47e444878736a9c34b64744c5f00 (patch) | |
tree | bc11fa2540daf0a82e713b2f749daededce38dba /src/main/kotlin/com/replaymod/gradle/remap/PsiMapper.kt | |
parent | b00673f859058ff180dc16c22e12ac5698ffbab2 (diff) | |
download | Remap-26107cde7a9c47e444878736a9c34b64744c5f00.tar.gz Remap-26107cde7a9c47e444878736a9c34b64744c5f00.tar.bz2 Remap-26107cde7a9c47e444878736a9c34b64744c5f00.zip |
Support multi-target mixin injectors
Diffstat (limited to 'src/main/kotlin/com/replaymod/gradle/remap/PsiMapper.kt')
-rw-r--r-- | src/main/kotlin/com/replaymod/gradle/remap/PsiMapper.kt | 8 |
1 files changed, 3 insertions, 5 deletions
diff --git a/src/main/kotlin/com/replaymod/gradle/remap/PsiMapper.kt b/src/main/kotlin/com/replaymod/gradle/remap/PsiMapper.kt index 412b6bf..a71c4d1 100644 --- a/src/main/kotlin/com/replaymod/gradle/remap/PsiMapper.kt +++ b/src/main/kotlin/com/replaymod/gradle/remap/PsiMapper.kt @@ -481,10 +481,8 @@ internal class PsiMapper( ?: method.getAnnotation(CLASS_REDIRECT) ?: return - for (attribute in annotation.parameterList.attributes) { - if ("method" != attribute.name) continue - // Note: mixin supports multiple targets, we do not (yet) - val (literalExpr, literalValue) = attribute.resolvedLiteralValue ?: continue + val methodAttrib = annotation.findDeclaredAttributeValue("method") + for ((literalExpr, literalValue) in methodAttrib?.resolvedLiteralValues ?: emptyList()) { val (targetName, targetDesc) = if ('(' in literalValue) { MethodSignature.of(literalValue).let { it.name to it.descriptor.toString() } } else { @@ -497,7 +495,7 @@ internal class PsiMapper( } } else { if (targetMethods.size > 1) { - error(attribute, "Ambiguous mixin method \"$targetName\" may refer to any of: ${targetMethods.joinToString { + error(literalExpr, "Ambiguous mixin method \"$targetName\" may refer to any of: ${targetMethods.joinToString { "\"${it.name}${ClassUtil.getAsmMethodSignature(it)}\"" }}") } |