TModLoader v1.4.4.9
TModLoader source code documentation
Loading...
Searching...
No Matches

◆ Add()

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

Adds a hook (implemented by hookDelegate ) to method .

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

Definition at line 205 of file MonoModHooks.cs.

206 {
207 //IL_000e: Unknown result type (might be due to invalid IL or missing references)
208 //IL_0018: Expected O, but got Unknown
209 if (!_hookCache.TryAdd((method, hookDelegate), (IDisposable)new Hook(method, hookDelegate)))
210 {
211 throw new ArgumentException("Delegate has already been applied to this method as a hook!");
212 }
213 }
static ConcurrentDictionary<(MethodBase, Delegate), IDisposable > _hookCache

References Terraria.ModLoader.MonoModHooks._hookCache.

Referenced by Terraria.WorldGen.DetourPass().

+ Here is the caller graph for this function: