ForgeMultipart icon indicating copy to clipboard operation
ForgeMultipart copied to clipboard

Repated class transformer invocation

Open sfPlayer1 opened this issue 9 years ago • 4 comments

FMP runs transformers once more from there: https://github.com/Chicken-Bones/ForgeMultipart/blob/master/src/codechicken/multipart/asm/ASMMixinCompiler.scala#L90

The class loader prevents multiple invocations, thus FMP imposes stricter requirements on IClassTransformer implementations, which are of course not always met.

sfPlayer1 avatar Mar 16 '15 17:03 sfPlayer1

Any suggestions?

Chicken-Bones avatar Mar 17 '15 04:03 Chicken-Bones

Why are you invoking them in the first place? For me the obvious thing to do would be running yours as the very first.

sfPlayer1 avatar Mar 17 '15 07:03 sfPlayer1

And hand them my class to transform?

Chicken-Bones avatar Mar 17 '15 08:03 Chicken-Bones

When your transformer is being called for class x merge the required changes/additions into x, return the modified x to let the class loader the next transformer continue. As I said I don't know why you are manually running transformers, but I'm also not familiar with the architecture. If you only do it on the mixin classes bypassing the class loader, you probably just want a "cache" for the multi-use ones.

sfPlayer1 avatar Mar 17 '15 08:03 sfPlayer1