// Path: src/main/java/tppitweaks/TPPITweaks.java
// @Mod(modid = "TPPITweaks", name = "TPPI Tweaks", version = TPPITweaks.VERSION, dependencies = Reference.DEPENDENCIES)
// public class TPPITweaks
// {
// 	public static final String VERSION = "@VERSION@";
// 
// 	@Instance("TPPITweaks")
// 	public static TPPITweaks instance;
// 
// 	@SidedProxy(clientSide = "tppitweaks.proxy.ClientProxy", serverSide = "tppitweaks.proxy.CommonProxy")
// 	public static CommonProxy proxy;
// 
// 	public static TPPIEventHandler eventHandler;
// 
// 	public static final Logger logger = LogManager.getLogger("TPPITweaks");
// 
// 	public static CreativeTabTPPI creativeTab = new CreativeTabTPPI(CreativeTabs.getNextID());
// 
// 	@EventHandler
// 	public void preInit(FMLPreInitializationEvent event)
// 	{		
// 		RecipeTweakingCore.registerPackageName("tppitweaks.tweak.recipe");
// 
// 		ConfigurationHandler.init(new File(event.getModConfigurationDirectory().getAbsolutePath() + "/TPPI/TPPITweaks.cfg"));
// 	}
// 
// 	@EventHandler
// 	public void init(FMLInitializationEvent event)
// 	{
// 		// AM2SpawnControls.doAM2SpawnControls();
// 
// 		ModItems.initItems();
// 		ModBlocks.initBlocks();
// 		
// 		eventHandler = new TPPIEventHandler();
// 		MinecraftForge.EVENT_BUS.register(eventHandler);
// 		ModItems.registerRecipes();
// 		ModBlocks.registerRecipes();
// 
// 		if (event.getSide().isClient())
// 			proxy.initTickHandler();
// 		
// 		if (Loader.isModLoaded("Thaumcraft"))
// 			TweakVanilla.init();
// 	}
// 
// 	@EventHandler
// 	public void postInit(FMLPostInitializationEvent event)
// 	{
// 		AdditionalTweaks.doOreDictTweaks();
// 		AdditionalTweaks.addMiscRecipes();
// 	}
// 
// 	@EventHandler
// 	public void onFMLServerStart(FMLServerStartingEvent event)
// 	{
// 		event.registerServerCommand(new CommandOres());
// 		event.registerServerCommand(new CommandGetInvolved());
// 	}
// }


import static org.objectweb.asm.Opcodes.*;
import java.util.Iterator;
import net.minecraft.launchwrapper.IClassTransformer;
import org.objectweb.asm.ClassReader;
import org.objectweb.asm.ClassWriter;
import org.objectweb.asm.Label;
import org.objectweb.asm.tree.AbstractInsnNode;
import org.objectweb.asm.tree.ClassNode;
import org.objectweb.asm.tree.InsnList;
import org.objectweb.asm.tree.InsnNode;
import org.objectweb.asm.tree.LabelNode;
import org.objectweb.asm.tree.MethodInsnNode;
import org.objectweb.asm.tree.MethodNode;
import org.objectweb.asm.tree.VarInsnNode;
import tppitweaks.TPPITweaks;
package tppitweaks.core;






public class CoreTransformer implements IClassTransformer
{
	private final String FURNACE_GEN_CLASS = "extrautils.tileentity.generator.TileEntityGeneratorFurnace";
	private final String SURVIVALIST_GEN_CLASS = "extrautils.tileentity.generator.TileEntityGeneratorFurnaceSurvival";
	private final String KEYSTONE_CONTAINER_CLASS = "am2.containers.ContainerKeystoneLockable";

	private final String FURNACE_GEN_METHOD = "getFuelBurn";
	private final String FURNACE_GEN_METHOD_DESC = "(Lnet/minecraft/item/ItemStack;)I";

	private final String NEW_FURNACE_GEN_METHOD = "getFuelBurnFurnace";
	private final String NEW_SURVIVALIST_GEN_METHOD = "getFuelBurnSurvivalist";

	@Override
	public byte[] transform(String name, String transformedName, byte[] basicClass)
	{
		if (name.compareTo(FURNACE_GEN_CLASS) == 0)
			return transformFurnaceClass(basicClass, NEW_FURNACE_GEN_METHOD);
		else if (name.compareTo(SURVIVALIST_GEN_CLASS) == 0)
			return transformFurnaceClass(basicClass, NEW_SURVIVALIST_GEN_METHOD);
		else if (name.compareTo(KEYSTONE_CONTAINER_CLASS) == 0)
			return transformKeystoneContainer(basicClass);
		return basicClass;
	}

	private byte[] transformFurnaceClass(byte[] basicClass, String newMethod)
	{
// Path: src/main/java/tppitweaks/TPPITweaks.java
// @Mod(modid = "TPPITweaks", name = "TPPI Tweaks", version = TPPITweaks.VERSION, dependencies = Reference.DEPENDENCIES)
// public class TPPITweaks
// {
// 	public static final String VERSION = "@VERSION@";
// 
// 	@Instance("TPPITweaks")
// 	public static TPPITweaks instance;
// 
// 	@SidedProxy(clientSide = "tppitweaks.proxy.ClientProxy", serverSide = "tppitweaks.proxy.CommonProxy")
// 	public static CommonProxy proxy;
// 
// 	public static TPPIEventHandler eventHandler;
// 
// 	public static final Logger logger = LogManager.getLogger("TPPITweaks");
// 
// 	public static CreativeTabTPPI creativeTab = new CreativeTabTPPI(CreativeTabs.getNextID());
// 
// 	@EventHandler
// 	public void preInit(FMLPreInitializationEvent event)
// 	{		
// 		RecipeTweakingCore.registerPackageName("tppitweaks.tweak.recipe");
// 
// 		ConfigurationHandler.init(new File(event.getModConfigurationDirectory().getAbsolutePath() + "/TPPI/TPPITweaks.cfg"));
// 	}
// 
// 	@EventHandler
// 	public void init(FMLInitializationEvent event)
// 	{
// 		// AM2SpawnControls.doAM2SpawnControls();
// 
// 		ModItems.initItems();
// 		ModBlocks.initBlocks();
// 		
// 		eventHandler = new TPPIEventHandler();
// 		MinecraftForge.EVENT_BUS.register(eventHandler);
// 		ModItems.registerRecipes();
// 		ModBlocks.registerRecipes();
// 
// 		if (event.getSide().isClient())
// 			proxy.initTickHandler();
// 		
// 		if (Loader.isModLoaded("Thaumcraft"))
// 			TweakVanilla.init();
// 	}
// 
// 	@EventHandler
// 	public void postInit(FMLPostInitializationEvent event)
// 	{
// 		AdditionalTweaks.doOreDictTweaks();
// 		AdditionalTweaks.addMiscRecipes();
// 	}
// 
// 	@EventHandler
// 	public void onFMLServerStart(FMLServerStartingEvent event)
// 	{
// 		event.registerServerCommand(new CommandOres());
// 		event.registerServerCommand(new CommandGetInvolved());
// 	}
// }


// Path: src/main/java/tppitweaks/core/CoreTransformer.java
import static org.objectweb.asm.Opcodes.*;
import java.util.Iterator;
import net.minecraft.launchwrapper.IClassTransformer;
import org.objectweb.asm.ClassReader;
import org.objectweb.asm.ClassWriter;
import org.objectweb.asm.Label;
import org.objectweb.asm.tree.AbstractInsnNode;
import org.objectweb.asm.tree.ClassNode;
import org.objectweb.asm.tree.InsnList;
import org.objectweb.asm.tree.InsnNode;
import org.objectweb.asm.tree.LabelNode;
import org.objectweb.asm.tree.MethodInsnNode;
import org.objectweb.asm.tree.MethodNode;
import org.objectweb.asm.tree.VarInsnNode;
import tppitweaks.TPPITweaks;

package tppitweaks.core;






public class CoreTransformer implements IClassTransformer
{
	private final String FURNACE_GEN_CLASS = "extrautils.tileentity.generator.TileEntityGeneratorFurnace";
	private final String SURVIVALIST_GEN_CLASS = "extrautils.tileentity.generator.TileEntityGeneratorFurnaceSurvival";
	private final String KEYSTONE_CONTAINER_CLASS = "am2.containers.ContainerKeystoneLockable";

	private final String FURNACE_GEN_METHOD = "getFuelBurn";
	private final String FURNACE_GEN_METHOD_DESC = "(Lnet/minecraft/item/ItemStack;)I";

	private final String NEW_FURNACE_GEN_METHOD = "getFuelBurnFurnace";
	private final String NEW_SURVIVALIST_GEN_METHOD = "getFuelBurnSurvivalist";

	@Override
	public byte[] transform(String name, String transformedName, byte[] basicClass)
	{
		if (name.compareTo(FURNACE_GEN_CLASS) == 0)
			return transformFurnaceClass(basicClass, NEW_FURNACE_GEN_METHOD);
		else if (name.compareTo(SURVIVALIST_GEN_CLASS) == 0)
			return transformFurnaceClass(basicClass, NEW_SURVIVALIST_GEN_METHOD);
		else if (name.compareTo(KEYSTONE_CONTAINER_CLASS) == 0)
			return transformKeystoneContainer(basicClass);
		return basicClass;
	}

	private byte[] transformFurnaceClass(byte[] basicClass, String newMethod)
	{
		TPPITweaks.logger.info("Transforming ExU Generator to method " + newMethod);