// Path: src/net/mcft/copy/core/copycore.java
// @Mod(modid = copycore.MOD_ID, version = "@VERSION@",
//      guiFactory = "net.mcft.copy.core.client.gui.CoreGuiFactory")
// public class copycore {
// 	
// 	public static final String MOD_ID = "copycore";
// 	
// 	@SidedProxy(clientSide = "net.mcft.copy.core.proxy.ClientProxy",
// 	            serverSide = "net.mcft.copy.core.proxy.CommonProxy")
// 	private static CommonProxy proxy;
// 	
// 	public static Logger log;
// 	public static NetworkChannel channel;
// 	
// 	public static PriorityConfig config = new PriorityConfig();
// 	public static CoreConfig globalConfig;
// 	public static SyncedConfig syncedConfig;
// 	
// 	@EventHandler
// 	public void preInit(FMLPreInitializationEvent event) {
// 		
// 		log = event.getModLog();
// 		
// 		setupConfig(event.getSuggestedConfigurationFile());
// 		
// 		channel = new NetworkChannel();
// 		channel.register(0, Side.CLIENT, MessageSyncSettings.class);
// 		channel.register(1, Side.CLIENT, MessageSyncProperties.class);
// 		channel.register(2, Side.CLIENT, MessageOpenGui.class);
// 		
// 		proxy.init();
// 		
// 		Addons.load(MineTweakerAddon.class);
// 		
// 	}
// 	
// 	private void setupConfig(File configFile) {
// 		
// 		registerSettingChangedHandlers();
// 		
// 		globalConfig = new CoreConfig(configFile);
// 		globalConfig.load();
// 		globalConfig.save();
// 		
// 		syncedConfig = new SyncedConfig(MOD_ID);
// 		syncedConfig.addFromReflection(config, globalConfig);
// 		
// 		config.add(Priority.GLOBAL, globalConfig);
// 		config.add(Priority.SYNCED, syncedConfig);
// 		
// 	}
// 	
// 	private void registerSettingChangedHandlers() {
// 		
// 		config.registerSettingChangedHandler(CoreConfig.tweakAutoReplace,
// 				new SimpleTweakChangedHandler(TweakAutoReplace.instance));
// 		
// 		config.registerSettingChangedHandler(CoreConfig.tweakDoubleDoorInteraction,
// 				new SimpleTweakChangedHandler(TweakDoubleDoorInteraction.instance));
// 		
// 		config.registerSettingChangedHandler(CoreConfig.tweakPlayerDeathItemDespawnTime,
// 				new ISettingChangedHandler<Integer>() {
// 					@Override public void onChanged(Setting<Integer> setting, Integer value) {
// 						TweakPlayerDeathItemDespawnTime.instance.setEnabled(value >= 0);
// 						TweakPlayerDeathItemDespawnTime.instance.despawnTime = value;
// 					}
// 				});
// 		
// 	}
// 	
// }
// 
// Path: src/net/mcft/copy/core/config/setting/Setting.java
// public abstract class Setting<T> {
// 	
// 	/** The name including the category, for example "block.storage.flint". */
// 	public final String fullName;
// 	/** The name not including the category, for example "flint". */
// 	public final String name;
// 	/** The category, for example "block.storage". */
// 	public final String category;
// 	
// 	/** The default value of this setting. */
// 	public final T defaultValue;
// 	/** The comment of this setting setting, null if none. */
// 	public String comment = null;
// 	
// 	public Setting(String fullName, T defaultValue) {
// 		this.fullName = fullName;
// 		int dotIndex = fullName.lastIndexOf('.');
// 		if (dotIndex < 1) throw new IllegalArgumentException("fullName doesn't contain a category.");
// 		name = fullName.substring(dotIndex + 1);
// 		category = fullName.substring(0, dotIndex);
// 		
// 		this.defaultValue = defaultValue;
// 	}
// 	
// 	/** Sets the comment for this setting. */
// 	public Setting<T> setComment(String comment) {
// 		this.comment = comment;
// 		return this;
// 	}
// 	
// 	/** Validates the setting and returns a warning
// 	 *  string, or null if validation was successful. */
// 	public String validate(T value) { return null; }
// 	
// 	/** Loads the setting's value from the config. */
// 	public abstract T load(Configuration config);
// 	/** Saves the setting's value to the config. */
// 	public abstract void save(Configuration config, T value);
// 	
// 	/** Reads the setting's synced value from the compound tag. */
// 	public abstract T read(NBTTagCompound compound);
// 	/** Writes the setting's value to the compound tag. */
// 	public abstract void write(NBTTagCompound compound, T value);
// 	
// 	// Equals, hashCode and toString
// 	
// 	@Override
// 	public boolean equals(Object obj) {
// 		return ((obj instanceof Setting) ? fullName.equals(((Setting)obj).fullName) : false);
// 	}
// 	
// 	@Override
// 	public int hashCode() { return fullName.hashCode(); }
// 	
// 	@Override
// 	public String toString() { return "[" + fullName + "]"; }
// 	
// }


import java.io.File;
import java.lang.reflect.Field;
import java.lang.reflect.Modifier;
import java.util.ArrayList;
import java.util.Collection;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.Objects;
import net.mcft.copy.core.copycore;
import net.mcft.copy.core.config.setting.Setting;
import net.minecraftforge.common.config.Configuration;
package net.mcft.copy.core.config;



public class Config extends AbstractConfig {
	
	private final File file;
	private final Configuration forgeConfig;
	
	private final Map<Setting, Object> settingValues = new HashMap<Setting, Object>();
	private final Map<String, String> categoryComments = new HashMap<String, String>();
	
// Path: src/net/mcft/copy/core/copycore.java
// @Mod(modid = copycore.MOD_ID, version = "@VERSION@",
//      guiFactory = "net.mcft.copy.core.client.gui.CoreGuiFactory")
// public class copycore {
// 	
// 	public static final String MOD_ID = "copycore";
// 	
// 	@SidedProxy(clientSide = "net.mcft.copy.core.proxy.ClientProxy",
// 	            serverSide = "net.mcft.copy.core.proxy.CommonProxy")
// 	private static CommonProxy proxy;
// 	
// 	public static Logger log;
// 	public static NetworkChannel channel;
// 	
// 	public static PriorityConfig config = new PriorityConfig();
// 	public static CoreConfig globalConfig;
// 	public static SyncedConfig syncedConfig;
// 	
// 	@EventHandler
// 	public void preInit(FMLPreInitializationEvent event) {
// 		
// 		log = event.getModLog();
// 		
// 		setupConfig(event.getSuggestedConfigurationFile());
// 		
// 		channel = new NetworkChannel();
// 		channel.register(0, Side.CLIENT, MessageSyncSettings.class);
// 		channel.register(1, Side.CLIENT, MessageSyncProperties.class);
// 		channel.register(2, Side.CLIENT, MessageOpenGui.class);
// 		
// 		proxy.init();
// 		
// 		Addons.load(MineTweakerAddon.class);
// 		
// 	}
// 	
// 	private void setupConfig(File configFile) {
// 		
// 		registerSettingChangedHandlers();
// 		
// 		globalConfig = new CoreConfig(configFile);
// 		globalConfig.load();
// 		globalConfig.save();
// 		
// 		syncedConfig = new SyncedConfig(MOD_ID);
// 		syncedConfig.addFromReflection(config, globalConfig);
// 		
// 		config.add(Priority.GLOBAL, globalConfig);
// 		config.add(Priority.SYNCED, syncedConfig);
// 		
// 	}
// 	
// 	private void registerSettingChangedHandlers() {
// 		
// 		config.registerSettingChangedHandler(CoreConfig.tweakAutoReplace,
// 				new SimpleTweakChangedHandler(TweakAutoReplace.instance));
// 		
// 		config.registerSettingChangedHandler(CoreConfig.tweakDoubleDoorInteraction,
// 				new SimpleTweakChangedHandler(TweakDoubleDoorInteraction.instance));
// 		
// 		config.registerSettingChangedHandler(CoreConfig.tweakPlayerDeathItemDespawnTime,
// 				new ISettingChangedHandler<Integer>() {
// 					@Override public void onChanged(Setting<Integer> setting, Integer value) {
// 						TweakPlayerDeathItemDespawnTime.instance.setEnabled(value >= 0);
// 						TweakPlayerDeathItemDespawnTime.instance.despawnTime = value;
// 					}
// 				});
// 		
// 	}
// 	
// }
// 
// Path: src/net/mcft/copy/core/config/setting/Setting.java
// public abstract class Setting<T> {
// 	
// 	/** The name including the category, for example "block.storage.flint". */
// 	public final String fullName;
// 	/** The name not including the category, for example "flint". */
// 	public final String name;
// 	/** The category, for example "block.storage". */
// 	public final String category;
// 	
// 	/** The default value of this setting. */
// 	public final T defaultValue;
// 	/** The comment of this setting setting, null if none. */
// 	public String comment = null;
// 	
// 	public Setting(String fullName, T defaultValue) {
// 		this.fullName = fullName;
// 		int dotIndex = fullName.lastIndexOf('.');
// 		if (dotIndex < 1) throw new IllegalArgumentException("fullName doesn't contain a category.");
// 		name = fullName.substring(dotIndex + 1);
// 		category = fullName.substring(0, dotIndex);
// 		
// 		this.defaultValue = defaultValue;
// 	}
// 	
// 	/** Sets the comment for this setting. */
// 	public Setting<T> setComment(String comment) {
// 		this.comment = comment;
// 		return this;
// 	}
// 	
// 	/** Validates the setting and returns a warning
// 	 *  string, or null if validation was successful. */
// 	public String validate(T value) { return null; }
// 	
// 	/** Loads the setting's value from the config. */
// 	public abstract T load(Configuration config);
// 	/** Saves the setting's value to the config. */
// 	public abstract void save(Configuration config, T value);
// 	
// 	/** Reads the setting's synced value from the compound tag. */
// 	public abstract T read(NBTTagCompound compound);
// 	/** Writes the setting's value to the compound tag. */
// 	public abstract void write(NBTTagCompound compound, T value);
// 	
// 	// Equals, hashCode and toString
// 	
// 	@Override
// 	public boolean equals(Object obj) {
// 		return ((obj instanceof Setting) ? fullName.equals(((Setting)obj).fullName) : false);
// 	}
// 	
// 	@Override
// 	public int hashCode() { return fullName.hashCode(); }
// 	
// 	@Override
// 	public String toString() { return "[" + fullName + "]"; }
// 	
// }


// Path: src/net/mcft/copy/core/config/Config.java
import java.io.File;
import java.lang.reflect.Field;
import java.lang.reflect.Modifier;
import java.util.ArrayList;
import java.util.Collection;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.Objects;
import net.mcft.copy.core.copycore;
import net.mcft.copy.core.config.setting.Setting;
import net.minecraftforge.common.config.Configuration;

package net.mcft.copy.core.config;



public class Config extends AbstractConfig {
	
	private final File file;
	private final Configuration forgeConfig;
	
	private final Map<Setting, Object> settingValues = new HashMap<Setting, Object>();
	private final Map<String, String> categoryComments = new HashMap<String, String>();
	
	private final List<SettingInfo> settings = new ArrayList<SettingInfo>();