tModLoader v2024.08
A mod to make and play Terraria mods
MonoModHooks Class Reference

Static Public Member Functions

static void Add (MethodBase method, Delegate hookDelegate)
 Adds a hook (implemented by hookDelegate ) to method . More...
 
static void DumpIL (Mod mod, ILContext il)
 Dumps the information about the given ILContext to a file in Logs/ILDumps/{Mod Name}/{Method Name}.txt
It may be useful to use a tool such as to compare the IL before and after edits More...
 
static void DumpILHooks ()
 Dumps the list of currently registered IL hooks to the console. Useful for checking if a hook has been correctly added. More...
 
static void DumpOnHooks ()
 Dumps the list of currently registered On hooks to the console. Useful for checking if a hook has been correctly added. More...
 
static void Modify (MethodBase method, ILContext.Manipulator callback)
 Adds an IL hook (implemented by callback ) to method . More...
 
static void RequestNativeAccess ()
 

Member Function Documentation

◆ Add()

static void MonoModHooks.Add ( MethodBase  method,
Delegate  hookDelegate 
)
static

Adds a hook (implemented by hookDelegate ) to method .

Parameters
methodThe method to hook.
hookDelegateThe hook delegate to use.

◆ DumpIL()

static void MonoModHooks.DumpIL ( Mod  mod,
ILContext  il 
)
static

Dumps the information about the given ILContext to a file in Logs/ILDumps/{Mod Name}/{Method Name}.txt
It may be useful to use a tool such as to compare the IL before and after edits

Parameters
mod
il

◆ DumpILHooks()

static void MonoModHooks.DumpILHooks ( )
static

Dumps the list of currently registered IL hooks to the console. Useful for checking if a hook has been correctly added.

Exceptions
Exception

◆ DumpOnHooks()

static void MonoModHooks.DumpOnHooks ( )
static

Dumps the list of currently registered On hooks to the console. Useful for checking if a hook has been correctly added.

Exceptions
Exception

◆ Modify()

static void MonoModHooks.Modify ( MethodBase  method,
ILContext.Manipulator  callback 
)
static

Adds an IL hook (implemented by callback ) to method .

Parameters
methodThe method to hook.
callbackThe hook delegate to use.