Split many mod/world things into systems

This commit is contained in:
DominicKarma committed 2022-04-04 20:38:44 -05:00
1 parent e69f54f585
commit 60cfab641e
192 files changed
+3100 -3012

No files matched your search

+43
View File
@@ -0,0 +1,43 @@
using CalamityMod.Particles;
using CalamityMod.TileEntities;
using Terraria.ModLoader;
namespace CalamityMod.Systems
{
public class EntityUpdateInterceptionSystem : ModSystem
{
#region Fusable Particle Updating
public override void PostUpdateProjectiles()
{
// Update all fusable particles.
// These are really only visual and as such don't really need any complex netcode.
foreach (BaseFusableParticleSet.FusableParticleRenderCollection particleSet in FusableParticleManager.ParticleSets)
{
foreach (BaseFusableParticleSet.FusableParticle particle in particleSet.ParticleSet.Particles)
particleSet.ParticleSet.UpdateBehavior(particle);
}
}
#endregion
#region Ash Drawing
public override void PostUpdateDusts() => DeathAshParticle.UpdateAll();
#endregion Ash Drawing
#region Post NPC Updating
// TODO - Apply caching to this process. For now most of the looping issues should be eradicated but it can be reduced further.
public override void PostUpdateNPCs() => CalamityGlobalNPC.ResetTownNPCNameBools();
#endregion
#region Tile Entity Time Handler
public override void PostUpdateTime() => TileEntityTimeHandler.Update();
#endregion
#region Particles updating
public override void PostUpdateEverything()
{
if (!Main.dedServ)
GeneralParticleHandler.Update();
}
#endregion
}
}