From 0da2574efa46a0989f7472c7574cda50ec6b6eb7 Mon Sep 17 00:00:00 2001 From: IbanPlay <56191483+IbanPlay@users.noreply.github.com> Date: Sat, 14 May 2022 21:09:10 +0200 Subject: [PATCH] mod.Code.GetTypes() => AssemblyManager.GetLoadableTypes(mod.Code) --- Cooldowns/CooldownRegistry.cs | 3 ++- Particles/GeneralParticleHandler.cs | 3 ++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/Cooldowns/CooldownRegistry.cs b/Cooldowns/CooldownRegistry.cs index 42ad47e6b4..76328fbcad 100644 --- a/Cooldowns/CooldownRegistry.cs +++ b/Cooldowns/CooldownRegistry.cs @@ -2,6 +2,7 @@ using System.Collections.Generic; using System.Reflection; using Terraria.ModLoader; +using Terraria.ModLoader.Core; namespace CalamityMod.Cooldowns { @@ -64,7 +65,7 @@ namespace CalamityMod.Cooldowns public static void RegisterModCooldowns(Mod mod) { Type baseHandlerType = typeof(CooldownHandler); - foreach (Type type in mod.Code.GetTypes()) + foreach (Type type in AssemblyManager.GetLoadableTypes(mod.Code)) { if (type.IsSubclassOf(baseHandlerType) && !type.IsAbstract && type != baseHandlerType) { diff --git a/Particles/GeneralParticleHandler.cs b/Particles/GeneralParticleHandler.cs index 034916b93c..1c113bd1bc 100644 --- a/Particles/GeneralParticleHandler.cs +++ b/Particles/GeneralParticleHandler.cs @@ -7,6 +7,7 @@ using System.Linq; using System.Runtime.Serialization; using Terraria; using Terraria.ModLoader; +using Terraria.ModLoader.Core; namespace CalamityMod.Particles { @@ -27,7 +28,7 @@ namespace CalamityMod.Particles public static void LoadModParticleInstances(Mod mod) { Type baseParticleType = typeof(Particle); - foreach (Type type in mod.Code.GetTypes()) + foreach (Type type in AssemblyManager.GetLoadableTypes(mod.Code)) { if (type.IsSubclassOf(baseParticleType) && !type.IsAbstract && type != baseParticleType) {