Beispiel #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);
        }
Beispiel #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);
        }
Beispiel #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);
        }