tModLoader v2024.04
A mod to make and play Terraria mods
ModTypeLookup< T > Class Template Reference

Enables content instances to register with Register(T) towards retrieval via ModContent.Find<T>(string) and similar methods. More...

Static Public Member Functions

static void Register (T instance)
 Registers the instance towards lookup via ModContent.Find<T>(string) and similar methods.
Should only be called once per instance. Registers legacy names specified via LegacyNameAttribute on the instance's type automatically.
 
static void RegisterLegacyNames (T instance, params string[] legacyNames)
 Registers the instance towards lookup via ModContent.Find<T>(string) and similar methods using any number of specified legacyNames .
Also see

See also
LegacyNameAttribute

which may be more convenient.

 

Detailed Description

Enables content instances to register with Register(T) towards retrieval via ModContent.Find<T>(string) and similar methods.

Type Constraints
T :IModType