internal static void Unload() { ContentInstance.Clear(); ItemLoader.Unload(); EquipLoader.Unload(); ModPrefix.Unload(); ModDust.Unload(); TileLoader.Unload(); ModTileEntity.Unload(); WallLoader.Unload(); ProjectileLoader.Unload(); NPCLoader.Unload(); NPCHeadLoader.Unload(); PlayerHooks.Unload(); BuffLoader.Unload(); MountLoader.Unload(); ModGore.Unload(); SoundLoader.Unload(); DisposeMusic(); BackgroundTextureLoader.Unload(); UgBgStyleLoader.Unload(); SurfaceBgStyleLoader.Unload(); GlobalBgStyleLoader.Unload(); WaterStyleLoader.Unload(); WaterfallStyleLoader.Unload(); WorldHooks.Unload(); ResizeArrays(true); for (int k = 0; k < Recipe.maxRecipes; k++) { Main.recipe[k] = new Recipe(); } Recipe.numRecipes = 0; RecipeGroupHelper.ResetRecipeGroups(); Recipe.SetupRecipes(); MapLoader.UnloadModMap(); ItemSorting.SetupWhiteLists(); HotKeyLoader.Unload(); RecipeHooks.Unload(); CommandManager.Unload(); TagSerializer.Reload(); ModNet.Unload(); Config.ConfigManager.Unload(); CustomCurrencyManager.Initialize(); EffectsTracker.RemoveModEffects(); CleanupModReferences(); }
internal static void Unload() { while (loadOrder.Count > 0) { GetMod(loadOrder.Pop()).UnloadContent(); } loadOrder.Clear(); loadedMods = new Mod[0]; ItemLoader.Unload(); EquipLoader.Unload(); ModDust.Unload(); TileLoader.Unload(); ModTileEntity.Unload(); WallLoader.Unload(); ProjectileLoader.Unload(); NPCLoader.Unload(); NPCHeadLoader.Unload(); PlayerHooks.Unload(); BuffLoader.Unload(); MountLoader.Unload(); ModGore.Unload(); SoundLoader.Unload(); BackgroundTextureLoader.Unload(); UgBgStyleLoader.Unload(); SurfaceBgStyleLoader.Unload(); GlobalBgStyleLoader.Unload(); WaterStyleLoader.Unload(); WaterfallStyleLoader.Unload(); mods.Clear(); ResizeArrays(true); MapLoader.UnloadModMap(); ItemSorting.SetupWhiteLists(); modHotKeys.Clear(); WorldHooks.Unload(); RecipeHooks.Unload(); CommandManager.Unload(); TagSerializer.Reload(); GameContent.UI.CustomCurrencyManager.Initialize(); if (!Main.dedServ && Main.netMode != 1) //disable vanilla client compatiblity restrictions when reloading on a client { ModNet.AllowVanillaClients = false; } }
//TODO: Unhardcode ALL of this. internal static void Unload() { ContentInstance.Clear(); ModTypeLookup.Clear(); ItemLoader.Unload(); EquipLoader.Unload(); PrefixLoader.Unload(); DustLoader.Unload(); TileLoader.Unload(); TileEntity.manager.Reset(); WallLoader.Unload(); ProjectileLoader.Unload(); NPCLoader.Unload(); NPCHeadLoader.Unload(); BossBarLoader.Unload(); PlayerHooks.Unload(); BuffLoader.Unload(); MountLoader.Unload(); RarityLoader.Unload(); DamageClassLoader.Unload(); InfoDisplayLoader.Unload(); GoreLoader.Unload(); SoundLoader.Unload(); DisposeMusic(); BackgroundTextureLoader.Unload(); UgBgStyleLoader.Unload(); SurfaceBgStyleLoader.Unload(); GlobalBgStyleLoader.Unload(); WaterStyleLoader.Unload(); WaterfallStyleLoader.Unload(); PlayerDrawLayerLoader.Unload(); SystemHooks.Unload(); ResizeArrays(true); for (int k = 0; k < Recipe.maxRecipes; k++) { Main.recipe[k] = new Recipe(); } Recipe.numRecipes = 0; RecipeGroupHelper.ResetRecipeGroups(); Recipe.SetupRecipes(); MapLoader.UnloadModMap(); ItemSorting.SetupWhiteLists(); HotKeyLoader.Unload(); RecipeLoader.Unload(); CommandLoader.Unload(); TagSerializer.Reload(); ModNet.Unload(); Config.ConfigManager.Unload(); CustomCurrencyManager.Initialize(); EffectsTracker.RemoveModEffects(); // ItemID.Search = IdDictionary.Create<ItemID, short>(); // NPCID.Search = IdDictionary.Create<NPCID, short>(); // ProjectileID.Search = IdDictionary.Create<ProjectileID, short>(); // TileID.Search = IdDictionary.Create<TileID, ushort>(); // WallID.Search = IdDictionary.Create<WallID, ushort>(); // BuffID.Search = IdDictionary.Create<BuffID, int>(); ContentSamples.Initialize(); CleanupModReferences(); }