Skip to content

Commit

Permalink
pain^2
Browse files Browse the repository at this point in the history
  • Loading branch information
IThundxr committed Jun 8, 2024
1 parent a1a1975 commit 0ea065c
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -31,11 +31,11 @@ class NumismaticsGradleASM {
// Get project type
val projectType = SubprojectType.getProjectType(project)

var node = ClassNode()
val node = ClassNode()
ClassReader(bytes).accept(node, 0)

// Transformers
node = CCCapabilitiesTransformer().transform(projectType, node)
CCCapabilitiesTransformer().transform(projectType, node)

// Verify the bytecode is valid
val byteArray = ClassWriter(0).also { node.accept(it) }.toByteArray()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ import org.objectweb.asm.tree.ClassNode

class CCCapabilitiesTransformer {
@Suppress("LocalVariableName")
fun transform(project: SubprojectType, node: ClassNode): ClassNode {
fun transform(project: SubprojectType, node: ClassNode) {
if (node.invisibleAnnotations != null && project == SubprojectType.FORGE) {
// Cache the field, so we don't CME the list during the remove
val annotationNodes = node.invisibleAnnotations.toList()
Expand Down Expand Up @@ -142,7 +142,5 @@ class CCCapabilitiesTransformer {
}
}
}

return node
}
}

0 comments on commit 0ea065c

Please sign in to comment.