Beispiel #1
0
        //internal static ITranslationHelper Translation;
        // internal static IMonitor Logger;

        public override void Entry(IModHelper helper)
        {
            ModHelper  = helper;
            Events     = helper.Events;
            Reflection = helper.Reflection;
            Config     = helper.ReadConfig <ModConfig>();

            SkullElevator.Setup();

            LadderFinder.Setup();

            EasyHorse.Setup();

            DontAskToEat.Setup();
        }
Beispiel #2
0
        private static void CopyAndReplace()
        {
            if (BaseHorse == null)
            {
                // Get my stable
                Stable stable = Game1.getFarm().buildings.OfType <Stable>()
                                .Where(bld => bld.GetType().FullName?.Contains("TractorMod") == false &&
                                       (!Context.IsMultiplayer || bld.owner.Value == Game1.player.UniqueMultiplayerID))
                                .FirstOrDefault();

                if (stable == null)
                {
                    return;
                }

                BaseHorse = Utility.findHorse(stable.HorseId);
                if (BaseHorse == null)
                {
                    return;
                }
                if (BaseHorse.Name != Game1.player.horseName.Value)
                {
                    Game1.player.horseName.Value = BaseHorse.Name;
                }
            }

            if (MyHorse == null)
            {
                MyHorse = new EasyHorse();
            }

            CopyHorse(BaseHorse, MyHorse);

            var npcs = MyHorse.currentLocation.characters;

            for (int index = 0; index < npcs.Count; ++index)
            {
                if (npcs[index] == BaseHorse)
                {
                    npcs[index] = MyHorse;
                    return;
                }
            }
        }