// 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 net.minecraftforge.common.config.Configuration;
import tppitweaks.TPPITweaks;
import java.io.*;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.Scanner;
	 * @return whether anything changed
	 */
	public static boolean manuallyChangeConfigValue(String filePathFromConfigFolder, String prefix, String from, String to)
	{
		File config = filePathFromConfigFolder == null ? cfg : new File(cfg.getParentFile().getParent() + "/" + filePathFromConfigFolder);
		boolean found = false;

		try
		{
			FileReader fr1 = new FileReader(config);
			BufferedReader read = new BufferedReader(fr1);
			
			ArrayList<String> strings = new ArrayList<String>();
			
			while (read.ready())
			{
				strings.add(read.readLine());
			}
			
			fr1.close();
			read.close();
			
			FileWriter fw = new FileWriter(config);
			BufferedWriter bw = new BufferedWriter(fw);
			
			for (String s : strings)
			{
				if (!found && s.contains(prefix + "=" + from) && !s.contains("=" + to))
				{
					s = s.replace(prefix + "=" + from, prefix + "=" + to);
// 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/config/ConfigurationHandler.java
import net.minecraftforge.common.config.Configuration;
import tppitweaks.TPPITweaks;
import java.io.*;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.Scanner;

	 * @return whether anything changed
	 */
	public static boolean manuallyChangeConfigValue(String filePathFromConfigFolder, String prefix, String from, String to)
	{
		File config = filePathFromConfigFolder == null ? cfg : new File(cfg.getParentFile().getParent() + "/" + filePathFromConfigFolder);
		boolean found = false;

		try
		{
			FileReader fr1 = new FileReader(config);
			BufferedReader read = new BufferedReader(fr1);
			
			ArrayList<String> strings = new ArrayList<String>();
			
			while (read.ready())
			{
				strings.add(read.readLine());
			}
			
			fr1.close();
			read.close();
			
			FileWriter fw = new FileWriter(config);
			BufferedWriter bw = new BufferedWriter(fw);
			
			for (String s : strings)
			{
				if (!found && s.contains(prefix + "=" + from) && !s.contains("=" + to))
				{
					s = s.replace(prefix + "=" + from, prefix + "=" + to);
					TPPITweaks.logger.info("Successfully changed config value " + prefix + " from " + from + " to " + to); 