mod.Code.GetTypes() => AssemblyManager.GetLoadableTypes(mod.Code)

This commit is contained in:
IbanPlay committed 2022-05-14 21:09:10 +02:00
1 parent 828ab5d43b
commit 0da2574efa
2 files changed
+4 -2

No files matched your search

+2 -1
View File
@@ -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)
{
+2 -1
View File
@@ -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)
{