Ejemplo n.º 1
0
        /// <summary>
        /// Called firstly when SMAPI finished loading of the mod.
        /// </summary>
        /// <param name="helper"></param>
        public override void Entry(IModHelper helper)
        {
            // Loads configuration from file.
            Config conf = Helper.ReadConfig <Config>();

            // Initialize InstanceHolder.
            InstanceHolder.Init(this, conf);

            // Initialize Logger
            Logger.Init(this);

            // Register events.
            EventHolder.RegisterEvents(Helper.Events);


            // Registration commands.
            Helper.ConsoleCommands.Add("joedebug", "Debug command for JoE", OnDebugCommand);

            // Limit config values.
            ConfigLimitation.LimitConfigValues();

            // Check mod compatibilities.
            if (ModChecker.IsCoGLoaded(helper))
            {
                Logger.Log("CasksOnGround detected.");
                IsCoGOn = true;
            }

            if (ModChecker.IsCaLoaded(helper))
            {
                Logger.Log("CasksAnywhere detected.");
                IsCaOn = true;
            }

            if (ModChecker.IsCcLoaded(helper))
            {
                Logger.Log("Convenient Chests detected. JoE's CraftingFromChests feature will be disabled and won't patch the game.");
                Conf.CraftingFromChests = false;
                IsCcOn = true;
            }
            else if (!Conf.SafeMode)
            {
                Logger.Log("Start patching using Harmony...");
                HarmonyPatched = HarmonyPatcher.Init();
            }
            else
            {
                Logger.Log("SafeMode enabled, and won't patch the game.");
            }
            helper.WriteConfig(Conf);
            MineIcons.Init(helper);
        }
Ejemplo n.º 2
0
        /// <summary>
        /// Called firstly when SMAPI finished loading of the mod.
        /// </summary>
        /// <param name="helper"></param>
        public override void Entry(IModHelper helper)
        {
            // Initialize Logger
            Logger.Init(Monitor);

            // Initialize InstanceHolder.
            InstanceHolder.Init(this);

            // Register events.
            EventHolder.RegisterEvents(Helper.Events);


            // Registration commands.
            Helper.ConsoleCommands.Add("joedebug", "Debug command for JoE", OnDebugCommand);
            Helper.ConsoleCommands.Add("joerelcon", "Reloading config command for JoE", OnReloadConfigCommand);


            // Limit config values.
            ConfigLimitation.LimitConfigValues();

            // Check mod compatibilities.
            if (ModChecker.IsCoGLoaded(helper))
            {
                Logger.Log("CasksOnGround detected.");
                IsCoGOn = true;
            }

            if (ModChecker.IsCaLoaded(helper))
            {
                Logger.Log("CasksAnywhere detected.");
                IsCaOn = true;
            }

            // Do patching stuff
            if (!Conf.SafeMode)
            {
                HarmonyPatcher.DoPatching();
            }
            else
            {
                Logger.Log("Bypassing patching...");
            }

            helper.WriteConfig(Conf);
            MineIcons.Init(helper);
        }
Ejemplo n.º 3
0
        /// <summary>
        /// Called firstly when SMAPI finished loading of the mod.
        /// </summary>
        /// <param name="helper"></param>
        public override void Entry(IModHelper helper)
        {
            // Loads configuration from file.
            Config conf = Helper.ReadConfig <Config>();

            // Initialize InstanceHolder.
            InstanceHolder.Init(this, conf);

            // Initialize Logger
            Logger.Init(Monitor);

            // Register events.
            EventHolder.RegisterEvents(Helper.Events);


            // Registration commands.
            Helper.ConsoleCommands.Add("joedebug", "Debug command for JoE", OnDebugCommand);

            // Limit config values.
            ConfigLimitation.LimitConfigValues();

            // Check mod compatibilities.
            if (ModChecker.IsCoGLoaded(helper))
            {
                Logger.Log("CasksOnGround detected.");
                IsCoGOn = true;
            }

            if (ModChecker.IsCaLoaded(helper))
            {
                Logger.Log("CasksAnywhere detected.");
                IsCaOn = true;
            }

            helper.WriteConfig(Conf);
            MineIcons.Init(helper);
        }
Ejemplo n.º 4
0
 private static void OnReloadConfigCommand(string name, string[] args)
 {
     // Loads configuration from file.
     InstanceHolder.LoadConfig();
     Logger.Log("Reloaded JoE's config.");
 }