Esempio n. 1
0
        internal static void Load(CancellationToken token)
        {
            CacheVanillaState();

            Interface.loadMods.SetLoadStage("tModLoader.MSIntializing", ModLoader.Mods.Length);
            LoadModContent(token, mod => {
                ContentInstance.Register(mod);
                mod.loading = true;
                mod.AutoloadConfig();
                mod.PrepareAssets();
                mod.Autoload();
                mod.Load();
                SystemHooks.OnModLoad(mod);
                mod.loading = false;
            });

            Interface.loadMods.SetLoadStage("tModLoader.MSSettingUp");
            ResizeArrays();
            RecipeGroupHelper.FixRecipeGroupLookups();

            Interface.loadMods.SetLoadStage("tModLoader.MSLoading", ModLoader.Mods.Length);
            LoadModContent(token, mod => {
                mod.SetupContent();
                mod.PostSetupContent();
                SystemHooks.PostSetupContent(mod);
            });

            MemoryTracking.Finish();

            if (Main.dedServ)
            {
                ModNet.AssignNetIDs();
            }

            Main.player[255] = new Player(false);             // setup inventory is unnecessary

            RefreshModLanguage(Language.ActiveCulture);
            MapLoader.SetupModMap();
            RarityLoader.Initialize();

            ContentSamples.Initialize();
            PlayerInput.reinitialize = true;
            SetupBestiary(token);
            SetupRecipes(token);
            ContentSamples.RebuildItemCreativeSortingIDsAfterRecipesAreSetUp();
            ItemSorting.SetupWhiteLists();

            MenuLoader.GotoSavedModMenu();
            BossBarLoader.GotoSavedStyle();
        }