// Path: java/com/asaskevich/smartcursor/api/IModule.java
// public interface IModule {
// 	public String getModuleName();
// 	public String getAuthor();
// }
// 
// Path: java/com/asaskevich/smartcursor/api/ModuleConnector.java
// public class ModuleConnector
// 		extends Event {
// 	public static final int	ENTITY_PROCESSOR	= 0, PLAYER_PROCESSOR = 1, DROP_PROCESSOR = 2, BLOCK_PROCESSOR = 3;
// 	private IModule			module;
// 	private int				type;
// 
// 	public ModuleConnector(IEntityProcessor module) {
// 		this.module = module;
// 		this.type = ENTITY_PROCESSOR;
// 	}
// 
// 	public ModuleConnector(IPlayerProcessor module) {
// 		this.module = module;
// 		this.type = PLAYER_PROCESSOR;
// 	}
// 
// 	public ModuleConnector(IDropProcessor module) {
// 		this.module = module;
// 		this.type = DROP_PROCESSOR;
// 	}
// 
// 	public ModuleConnector(IBlockProcessor module) {
// 		this.module = module;
// 		this.type = BLOCK_PROCESSOR;
// 	}
// 
// 	public IModule getModule() {
// 		return this.module;
// 	}
// 
// 	public int getType() {
// 		return this.type;
// 	}
// 
// 	public static void connectModule(IEntityProcessor module) {
// 		MinecraftForge.EVENT_BUS.post(new ModuleConnector(module));
// 	}
// 
// 	public static void connectModule(IPlayerProcessor module) {
// 		MinecraftForge.EVENT_BUS.post(new ModuleConnector(module));
// 	}
// 
// 	public static void connectModule(IDropProcessor module) {
// 		MinecraftForge.EVENT_BUS.post(new ModuleConnector(module));
// 	}
// 
// 	public static void connectModule(IBlockProcessor module) {
// 		MinecraftForge.EVENT_BUS.post(new ModuleConnector(module));
// 	}
// }


import java.util.ArrayList;
import java.util.HashMap;
import net.minecraftforge.common.config.Configuration;
import com.asaskevich.smartcursor.api.IBlockProcessor;
import com.asaskevich.smartcursor.api.IDropProcessor;
import com.asaskevich.smartcursor.api.IEntityProcessor;
import com.asaskevich.smartcursor.api.IModule;
import com.asaskevich.smartcursor.api.IPlayerProcessor;
import com.asaskevich.smartcursor.api.ModuleConnector;
import cpw.mods.fml.common.eventhandler.SubscribeEvent;

	public static void switchModule(String canonicalName) {
		if (!moduleStatus.containsKey(canonicalName)) moduleStatus.put(canonicalName, true);
		boolean status = moduleStatus.get(canonicalName);
		moduleStatus.put(canonicalName, !status);
		syncConfig(SmartCursor.config);
	}

	public static boolean isActiveModule(String canonicalName) {
		if (!moduleStatus.containsKey(canonicalName)) moduleStatus.put(canonicalName, true);
		return moduleStatus.containsKey(canonicalName) && moduleStatus.get(canonicalName);
	}

	public static void syncConfig(Configuration config) {
		config.load();
		for (String key : moduleStatus.keySet()) {
			boolean status = isActiveModule(key);
			config.get("modules", key, status).set(status);
		}
		config.save();
	}

	public static void loadConfig(Configuration config) {
		for (String key : moduleStatus.keySet()) {
			boolean status = config.getBoolean(key, "modules", true, key);
			moduleStatus.put(key, status);
		}
	}

	@SubscribeEvent
// Path: java/com/asaskevich/smartcursor/api/IModule.java
// public interface IModule {
// 	public String getModuleName();
// 	public String getAuthor();
// }
// 
// Path: java/com/asaskevich/smartcursor/api/ModuleConnector.java
// public class ModuleConnector
// 		extends Event {
// 	public static final int	ENTITY_PROCESSOR	= 0, PLAYER_PROCESSOR = 1, DROP_PROCESSOR = 2, BLOCK_PROCESSOR = 3;
// 	private IModule			module;
// 	private int				type;
// 
// 	public ModuleConnector(IEntityProcessor module) {
// 		this.module = module;
// 		this.type = ENTITY_PROCESSOR;
// 	}
// 
// 	public ModuleConnector(IPlayerProcessor module) {
// 		this.module = module;
// 		this.type = PLAYER_PROCESSOR;
// 	}
// 
// 	public ModuleConnector(IDropProcessor module) {
// 		this.module = module;
// 		this.type = DROP_PROCESSOR;
// 	}
// 
// 	public ModuleConnector(IBlockProcessor module) {
// 		this.module = module;
// 		this.type = BLOCK_PROCESSOR;
// 	}
// 
// 	public IModule getModule() {
// 		return this.module;
// 	}
// 
// 	public int getType() {
// 		return this.type;
// 	}
// 
// 	public static void connectModule(IEntityProcessor module) {
// 		MinecraftForge.EVENT_BUS.post(new ModuleConnector(module));
// 	}
// 
// 	public static void connectModule(IPlayerProcessor module) {
// 		MinecraftForge.EVENT_BUS.post(new ModuleConnector(module));
// 	}
// 
// 	public static void connectModule(IDropProcessor module) {
// 		MinecraftForge.EVENT_BUS.post(new ModuleConnector(module));
// 	}
// 
// 	public static void connectModule(IBlockProcessor module) {
// 		MinecraftForge.EVENT_BUS.post(new ModuleConnector(module));
// 	}
// }


// Path: java/com/asaskevich/smartcursor/Modules.java
import java.util.ArrayList;
import java.util.HashMap;
import net.minecraftforge.common.config.Configuration;
import com.asaskevich.smartcursor.api.IBlockProcessor;
import com.asaskevich.smartcursor.api.IDropProcessor;
import com.asaskevich.smartcursor.api.IEntityProcessor;
import com.asaskevich.smartcursor.api.IModule;
import com.asaskevich.smartcursor.api.IPlayerProcessor;
import com.asaskevich.smartcursor.api.ModuleConnector;
import cpw.mods.fml.common.eventhandler.SubscribeEvent;


	public static void switchModule(String canonicalName) {
		if (!moduleStatus.containsKey(canonicalName)) moduleStatus.put(canonicalName, true);
		boolean status = moduleStatus.get(canonicalName);
		moduleStatus.put(canonicalName, !status);
		syncConfig(SmartCursor.config);
	}

	public static boolean isActiveModule(String canonicalName) {
		if (!moduleStatus.containsKey(canonicalName)) moduleStatus.put(canonicalName, true);
		return moduleStatus.containsKey(canonicalName) && moduleStatus.get(canonicalName);
	}

	public static void syncConfig(Configuration config) {
		config.load();
		for (String key : moduleStatus.keySet()) {
			boolean status = isActiveModule(key);
			config.get("modules", key, status).set(status);
		}
		config.save();
	}

	public static void loadConfig(Configuration config) {
		for (String key : moduleStatus.keySet()) {
			boolean status = config.getBoolean(key, "modules", true, key);
			moduleStatus.put(key, status);
		}
	}

	@SubscribeEvent
	public void onRegisterModule(ModuleConnector event) {