// Path: src/api/java/com/github/atomicblom/shearmadness/api/events/ShearMadnessSyncSettingsEvent.java
// public class ShearMadnessSyncSettingsEvent extends Event {
//     private Configuration config;
// 
//     public ShearMadnessSyncSettingsEvent(Configuration config) {
// 
//         this.config = config;
//     }
// 
//     public Configuration getConfig() {
//         return config;
//     }
// }
// 
// Path: src/main/java/com/github/atomicblom/shearmadness/utility/Logger.java
// public enum Logger
// {
//     INSTANCE;
// 
//     @SuppressWarnings({"NonSerializableFieldInSerializableClass", "InstanceVariableMayNotBeInitialized"})
//     private org.apache.logging.log4j.Logger logger;
// 
//     public static void info(final String format, final Object... args)
//     {
//         INSTANCE.log(Level.INFO, format, args);
//     }
// 
//     public static void log(final Level level, final Throwable exception, final String format, final Object... args)
//     {
//         //noinspection ChainedMethodCall
//         INSTANCE.getLogger().log(level, String.format(format, args), exception);
//     }
// 
//     public static void severe(final String format, final Object... args)
//     {
//         INSTANCE.log(Level.ERROR, format, args);
//     }
// 
//     public static void warning(final String format, final Object... args)
//     {
//         INSTANCE.log(Level.WARN, format, args);
//     }
// 
//     public static void trace(final String format, final Object... args)
//     {
//         INSTANCE.log(Level.TRACE, format, args);
//     }
// 
//     private org.apache.logging.log4j.Logger getLogger()
//     {
//         if (logger == null)
//         {
//             init();
//         }
// 
//         return logger;
//     }
// 
//     private void init()
//     {
//         if (logger == null)
//         {
//             logger = LogManager.getLogger(CommonReference.MOD_ID);
//         }
//     }
// 
//     private void log(final Level level, final String format, final Object... data)
//     {
//         //noinspection ChainedMethodCall
//         getLogger().log(level, String.format(format, data));
//     }
// }
// 
// Path: src/integration/java/com/github/atomicblom/shearmadness/variations/CommonReference.java
// public final class CommonReference {
//     public static final String MOD_ID = "shearmadness";
//     public static final String MOD_NAME = "Shear Madness";
//     public static final String VERSION = "@MOD_VERSION@";
// 
//     private CommonReference() {}
// }


import com.github.atomicblom.shearmadness.api.events.ShearMadnessSyncSettingsEvent;
import com.github.atomicblom.shearmadness.utility.Logger;
import com.github.atomicblom.shearmadness.variations.CommonReference;
import com.google.common.base.Objects;
import net.minecraftforge.common.MinecraftForge;
import net.minecraftforge.common.config.Configuration;
import net.minecraftforge.fml.client.event.ConfigChangedEvent.OnConfigChangedEvent;
import net.minecraftforge.fml.common.eventhandler.SubscribeEvent;
import java.io.File;
import java.text.SimpleDateFormat;
import java.util.Date;
import java.util.Optional;
import static com.google.common.base.Preconditions.*;
package com.github.atomicblom.shearmadness.configuration;



@SuppressWarnings({"OptionalUsedAsFieldOrParameterType", "NonSerializableFieldInSerializableClass"})
public enum ConfigurationHandler
{
    INSTANCE;
    private static final String CONFIG_VERSION = "2";
    private File fileRef = null;
    private Configuration config = null;
    private Optional<Configuration> configOld = Optional.empty();

    public static void init(File configFile)
    {
        INSTANCE.setConfig(configFile);
        MinecraftForge.EVENT_BUS.register(INSTANCE);
    }

    public Configuration getConfig()
    {
        return config;
    }

    private void setConfig(File configFile)
    {
        checkState(config == null, "ConfigurationHandler has been initialized more than once.");

        fileRef = configFile;

        config = new Configuration(configFile, CONFIG_VERSION);

        if (!CONFIG_VERSION.equals(config.getLoadedConfigVersion()))
        {
            final File fileBak = new File(fileRef.getAbsolutePath() + '_' + new SimpleDateFormat("yyyyMMdd_HHmmss").format(new Date()) + ".old");
            Logger.warning("Your %s config file is out of date and could cause issues. The existing file will be renamed to %s and a new one will be generated.",
                    CommonReference.MOD_NAME, fileBak.getName());
// Path: src/api/java/com/github/atomicblom/shearmadness/api/events/ShearMadnessSyncSettingsEvent.java
// public class ShearMadnessSyncSettingsEvent extends Event {
//     private Configuration config;
// 
//     public ShearMadnessSyncSettingsEvent(Configuration config) {
// 
//         this.config = config;
//     }
// 
//     public Configuration getConfig() {
//         return config;
//     }
// }
// 
// Path: src/main/java/com/github/atomicblom/shearmadness/utility/Logger.java
// public enum Logger
// {
//     INSTANCE;
// 
//     @SuppressWarnings({"NonSerializableFieldInSerializableClass", "InstanceVariableMayNotBeInitialized"})
//     private org.apache.logging.log4j.Logger logger;
// 
//     public static void info(final String format, final Object... args)
//     {
//         INSTANCE.log(Level.INFO, format, args);
//     }
// 
//     public static void log(final Level level, final Throwable exception, final String format, final Object... args)
//     {
//         //noinspection ChainedMethodCall
//         INSTANCE.getLogger().log(level, String.format(format, args), exception);
//     }
// 
//     public static void severe(final String format, final Object... args)
//     {
//         INSTANCE.log(Level.ERROR, format, args);
//     }
// 
//     public static void warning(final String format, final Object... args)
//     {
//         INSTANCE.log(Level.WARN, format, args);
//     }
// 
//     public static void trace(final String format, final Object... args)
//     {
//         INSTANCE.log(Level.TRACE, format, args);
//     }
// 
//     private org.apache.logging.log4j.Logger getLogger()
//     {
//         if (logger == null)
//         {
//             init();
//         }
// 
//         return logger;
//     }
// 
//     private void init()
//     {
//         if (logger == null)
//         {
//             logger = LogManager.getLogger(CommonReference.MOD_ID);
//         }
//     }
// 
//     private void log(final Level level, final String format, final Object... data)
//     {
//         //noinspection ChainedMethodCall
//         getLogger().log(level, String.format(format, data));
//     }
// }
// 
// Path: src/integration/java/com/github/atomicblom/shearmadness/variations/CommonReference.java
// public final class CommonReference {
//     public static final String MOD_ID = "shearmadness";
//     public static final String MOD_NAME = "Shear Madness";
//     public static final String VERSION = "@MOD_VERSION@";
// 
//     private CommonReference() {}
// }


// Path: src/main/java/com/github/atomicblom/shearmadness/configuration/ConfigurationHandler.java
import com.github.atomicblom.shearmadness.api.events.ShearMadnessSyncSettingsEvent;
import com.github.atomicblom.shearmadness.utility.Logger;
import com.github.atomicblom.shearmadness.variations.CommonReference;
import com.google.common.base.Objects;
import net.minecraftforge.common.MinecraftForge;
import net.minecraftforge.common.config.Configuration;
import net.minecraftforge.fml.client.event.ConfigChangedEvent.OnConfigChangedEvent;
import net.minecraftforge.fml.common.eventhandler.SubscribeEvent;
import java.io.File;
import java.text.SimpleDateFormat;
import java.util.Date;
import java.util.Optional;
import static com.google.common.base.Preconditions.*;

package com.github.atomicblom.shearmadness.configuration;



@SuppressWarnings({"OptionalUsedAsFieldOrParameterType", "NonSerializableFieldInSerializableClass"})
public enum ConfigurationHandler
{
    INSTANCE;
    private static final String CONFIG_VERSION = "2";
    private File fileRef = null;
    private Configuration config = null;
    private Optional<Configuration> configOld = Optional.empty();

    public static void init(File configFile)
    {
        INSTANCE.setConfig(configFile);
        MinecraftForge.EVENT_BUS.register(INSTANCE);
    }

    public Configuration getConfig()
    {
        return config;
    }

    private void setConfig(File configFile)
    {
        checkState(config == null, "ConfigurationHandler has been initialized more than once.");

        fileRef = configFile;

        config = new Configuration(configFile, CONFIG_VERSION);

        if (!CONFIG_VERSION.equals(config.getLoadedConfigVersion()))
        {
            final File fileBak = new File(fileRef.getAbsolutePath() + '_' + new SimpleDateFormat("yyyyMMdd_HHmmss").format(new Date()) + ".old");
            Logger.warning("Your %s config file is out of date and could cause issues. The existing file will be renamed to %s and a new one will be generated.",
                    CommonReference.MOD_NAME, fileBak.getName());
            Logger.warning("%s will attempt to copy your old settings, but custom mod/tree settings will have to be migrated manually.", CommonReference.MOD_NAME);