tModLoader v2025.03
A mod to make and play Terraria mods
All Classes Namespaces Functions Variables Enumerations Enumerator Properties Events Pages
ReinitializeDuringResizeArraysAttribute Class Reference

Classes annotated with this attribute will have their static constructor called again during the ResizeArrays stage of mod loading. This will happen before ModSystem.ResizeArrays is called for any mod. This is intended for classes containing ID sets created through Terraria.ID.SetFactory, similar to the design of vanilla classes such as ID.ItemID.Sets. This attribute removes the need to manually initialize these ID sets in ModSystem.ResizeArrays and helps avoid mod ordering issues that would complicate the implementation logic. This will not work on generic classes. More...

Inherits Attribute.

Detailed Description

Classes annotated with this attribute will have their static constructor called again during the ResizeArrays stage of mod loading.

This will happen before ModSystem.ResizeArrays is called for any mod.

This is intended for classes containing ID sets created through Terraria.ID.SetFactory, similar to the design of vanilla classes such as ID.ItemID.Sets. This attribute removes the need to manually initialize these ID sets in ModSystem.ResizeArrays and helps avoid mod ordering issues that would complicate the implementation logic.

This will not work on generic classes.