tModLoader v2024.11
A mod to make and play Terraria mods
AutoloadAttribute Class Reference

Allows for customizing if the annotated Type should be automatically loaded. True to always autoload, which is the default behavior, or false to prevent autoloading this Type. It is also possible to dictate if autoloading should conditionally only happen on a client or a server by setting Side to ModSide.Client or ModSide.Server. One use of this is to prevent graphics related classes from loading on the server. Note that content with a non-default constructor or marked as abstract will automatically not be autoloaded, so this attribute is not needed for those. More...

Inherits Attribute.

Public Member Functions

 AutoloadAttribute (bool value=true)
 

Static Public Member Functions

static AutoloadAttribute GetValue (Type type)
 

Public Attributes

readonly bool Value
 

Properties

bool NeedsAutoloading [get]
 
ModSide Side = ModSide.Both [get, set]
 

Detailed Description

Allows for customizing if the annotated Type should be automatically loaded.

True to always autoload, which is the default behavior, or false to prevent autoloading this Type.

It is also possible to dictate if autoloading should conditionally only happen on a client or a server by setting Side to ModSide.Client or ModSide.Server. One use of this is to prevent graphics related classes from loading on the server.

Note that content with a non-default constructor or marked as abstract will automatically not be autoloaded, so this attribute is not needed for those.