package ljfa.tntutils.coremod;

import org.apache.logging.log4j.Level;

import cpw.mods.fml.relauncher.FMLRelaunchLog;
import ljfa.tntutils.util.LogHelper;
import net.minecraft.launchwrapper.IClassTransformer;

public class ExplosionTransformer implements IClassTransformer {

    @Override
    public byte[] transform(String name, String transformedName, byte[] basicClass) {
        FMLRelaunchLog.log("TntUtils-Core", Level.INFO, "About to transform class %s", name);
        return basicClass;
    }

}

@@ -25,16 +25,99 @@
 remod;%0A%0A
+import java.util.Iterator;%0A%0Aimport net.minecraft.launchwrapper.IClassTransformer;%0A%0A
 import o
@@ -151,145 +151,339 @@
 el;%0A
-%0A
 import 
-cpw.mods.fml.relauncher.FMLRelaunchLog;%0Aimport ljfa.tntutils.util.LogHelper;%0Aimport net.minecraft.launchwrapper.IClassTransformer
+org.objectweb.asm.ClassReader;%0Aimport org.objectweb.asm.ClassWriter;%0Aimport org.objectweb.asm.Opcodes;%0Aimport org.objectweb.asm.tree.AbstractInsnNode;%0Aimport org.objectweb.asm.tree.ClassNode;%0Aimport org.objectweb.asm.tree.MethodNode;%0Aimport org.objectweb.asm.tree.TypeInsnNode;%0A%0Aimport cpw.mods.fml.relauncher.FMLRelaunchLog
 ;%0A%0Ap
@@ -546,17 +546,16 @@
 ormer %7B%0A
-%0A
     @Ove
@@ -658,126 +658,946 @@
     
-FMLRelaunchLog.log(%22TntUtils-Core%22, Level.INFO, %22About to transform class %25s%22, name);%0A        return basicClass;%0A    %7D%0A
+//ASM manipulation stuff%0A        ClassNode classNode = new ClassNode();%0A        ClassReader classReader = new ClassReader(basicClass);%0A        classReader.accept(classNode, 0);%0A        %0A        for(MethodNode mn: classNode.methods) %7B%0A            patchMethod(mn);%0A        %7D%0A        %0A        //Write class%0A        ClassWriter writer = new ClassWriter(ClassWriter.COMPUTE_MAXS %7C ClassWriter.COMPUTE_FRAMES);%0A        classNode.accept(writer);%0A        return writer.toByteArray();%0A    %7D%0A%0A    private void patchMethod(MethodNode mn) %7B%0A        //Loop through the instructions of the method%0A        Iterator%3CAbstractInsnNode%3E it = mn.instructions.iterator();%0A        while(it.hasNext()) %7B%0A            AbstractInsnNode currentNode = it.next();%0A            %0A            if(currentNode.getOpcode() == Opcodes.NEW) %7B%0A                FMLRelaunchLog.log(%22TNTUtils Core%22, Level.INFO, %22%25s%22, ((TypeInsnNode)currentNode).desc);%0A            %7D%0A        %7D%0A    %7D
 %0A%7D%0A

Add basics for transformations