Terraria.ModLoader.ModNet.AssignNetIDs C# (CSharp) Method

AssignNetIDs() static private method

static private AssignNetIDs ( ) : void
return void
		internal static void AssignNetIDs() {
			netMods = ModLoader.LoadedMods.Where(mod => mod.Side != ModSide.Server).ToArray();
			for (short i = 0; i < netMods.Length; i++)
				netMods[i].netID = i;
		}

Usage Example

Example #1
0
        internal static void Load()
        {
            Interface.loadMods.SetLoadStage("tModLoader.MSIntializing", ModLoader.Mods.Length);
            LoadModContent(mod => {
                mod.loading = true;
                mod.File?.Read(TmodFile.LoadedState.Streaming, mod.LoadResourceFromStream);
                mod.Autoload();
                mod.Load();
                mod.loading = false;
            });

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

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

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

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

            RefreshModLanguage(Language.ActiveCulture);
            MapLoader.SetupModMap();
            ItemSorting.SetupWhiteLists();
            PlayerInput.ReInitialize();
            SetupRecipes();
        }
All Usage Examples Of Terraria.ModLoader.ModNet::AssignNetIDs