File tree Expand file tree Collapse file tree
src/main/java/org/mangorage/mangobotmixin/plugin Expand file tree Collapse file tree Original file line number Diff line number Diff line change 11package org .mangorage .mangobotmixin .plugin ;
22
33
4+ import org .mangorage .bootstrap .api .loader .IMangoLoader ;
45import org .mangorage .mangobotcore .api .plugin .v1 .MangoBotPlugin ;
56import org .mangorage .mangobotcore .api .plugin .v1 .Plugin ;
7+ import org .objectweb .asm .ClassReader ;
68
79@ MangoBotPlugin (id = MangoBotMixinPlugin .ID )
810public final class MangoBotMixinPlugin implements Plugin {
@@ -16,5 +18,17 @@ public String getId() {
1618 @ Override
1719 public void load () {
1820 System .out .println ("Loaded MangoBotMixinPlugin" );
21+ IMangoLoader mangoLoader = (IMangoLoader ) this .getClass ().getClassLoader ();
22+
23+ final var history = mangoLoader .getTransformerHistory ().getHistory ("org.mangorage.mangobotcore.internal.ExampleThing" );
24+ final var result = history .get (1 );
25+
26+ System .out .println ("Transformed class bytes:" );
27+ ClassReader cr = new ClassReader (result .transformerResult ());
28+ cr .accept (new org .objectweb .asm .util .TraceClassVisitor (new java .io .PrintWriter (System .out )), 0 );
29+
30+ System .out .println ("Original class bytes:" );
31+ ClassReader cr2 = new ClassReader (result .classData ());
32+ cr2 .accept (new org .objectweb .asm .util .TraceClassVisitor (new java .io .PrintWriter (System .out )), 0 );
1933 }
2034}
You can’t perform that action at this time.
0 commit comments