package ljfa.tntutils.coremod;

import java.util.Iterator;

import net.minecraft.launchwrapper.IClassTransformer;

import org.apache.logging.log4j.Level;
import org.objectweb.asm.ClassReader;
import org.objectweb.asm.ClassWriter;
import org.objectweb.asm.Opcodes;
import org.objectweb.asm.tree.AbstractInsnNode;
import org.objectweb.asm.tree.ClassNode;
import org.objectweb.asm.tree.MethodNode;
import org.objectweb.asm.tree.TypeInsnNode;

import cpw.mods.fml.relauncher.FMLRelaunchLog;

public class ExplosionTransformer implements IClassTransformer {
    @Override
    public byte[] transform(String name, String transformedName, byte[] basicClass) {
        //ASM manipulation stuff
        ClassNode classNode = new ClassNode();
        ClassReader classReader = new ClassReader(basicClass);
        classReader.accept(classNode, 0);
        
        for(MethodNode mn: classNode.methods) {
            patchMethod(mn);
        }
        
        //Write class
        ClassWriter writer = new ClassWriter(ClassWriter.COMPUTE_MAXS | ClassWriter.COMPUTE_FRAMES);
        classNode.accept(writer);
        return writer.toByteArray();
    }

    private void patchMethod(MethodNode mn) {
        //Loop through the instructions of the method
        Iterator<AbstractInsnNode> it = mn.instructions.iterator();
        while(it.hasNext()) {
            AbstractInsnNode currentNode = it.next();
            
            if(currentNode.getOpcode() == Opcodes.NEW) {
                FMLRelaunchLog.log("TNTUtils Core", Level.INFO, "%s", ((TypeInsnNode)currentNode).desc);
            }
        }
    }
}

@@ -644,24 +644,236 @@
 cClass) %7B%0A  
+      FMLRelaunchLog.log(%22TNTUtils Core%22, Level.INFO, %22Name: %25s, Transformed: %25s%22, name, transformedName);%0A        return basicClass;%0A    %7D%0A    %0A    private byte%5B%5D patchClassASM(String name, byte%5B%5D basicClass) %7B%0A
       //ASM 

Make a separate method and test stuff