diff --git a/CalPlayer/CalamityPlayer.cs b/CalPlayer/CalamityPlayer.cs index a594b32124..a5890b60ef 100644 --- a/CalPlayer/CalamityPlayer.cs +++ b/CalPlayer/CalamityPlayer.cs @@ -2695,7 +2695,7 @@ namespace CalamityMod.CalPlayer foreach (string cdID in removedCooldowns) cooldowns.Remove(cdID); - SyncCooldownDictionary(Main.netMode == NetmodeID.Server); + SyncCooldownDictionary(Main.dedServ); } } @@ -3732,7 +3732,7 @@ namespace CalamityMod.CalPlayer player.StopVanityActions(false); player.RemoveAllGrapplingHooks(); player.Teleport(pos, style); - if (Main.netMode == NetmodeID.Server) + if (Main.dedServ) RemoteClient.CheckSection(player.whoAmI, player.Center); NetMessage.SendData(MessageID.TeleportEntity, -1, -1, null, 0, (float)player.whoAmI, pos.X, pos.Y, style, 0, 0); player.velocity = Vector2.Zero; @@ -4366,7 +4366,7 @@ namespace CalamityMod.CalPlayer confetti.velocity.Y += Main.rand.Next(-50, 51) * 0.05f; confetti.scale *= (float)(1.0 + Main.rand.Next(-30, 31) * 0.01); } - if (Main.rand.NextBool(40) && Main.netMode != NetmodeID.Server) + if (Main.rand.NextBool(40) && !Main.dedServ) { int confettiGore = Main.rand.Next(276, 283); int confetti = Gore.NewGore(Player.GetSource_ItemUse(item), new Vector2(hitbox.X, hitbox.Y), Player.velocity, confettiGore, 1f); diff --git a/CalPlayer/CalamityPlayerDrawEffects.cs b/CalPlayer/CalamityPlayerDrawEffects.cs index 7d579637c6..9a742b531c 100644 --- a/CalPlayer/CalamityPlayerDrawEffects.cs +++ b/CalPlayer/CalamityPlayerDrawEffects.cs @@ -372,7 +372,7 @@ namespace CalamityMod.CalPlayer } // Some extraneous and probably undocumented visual effect caused by the heart lad pet thing - if ((calamityPlayer.ladHearts > 0) && !Player.loveStruck && Main.netMode != NetmodeID.Server && drawInfo.shadow == 0f) + if ((calamityPlayer.ladHearts > 0) && !Player.loveStruck && !Main.dedServ && drawInfo.shadow == 0f) { if (Main.rand.NextBool(5)) { diff --git a/CalPlayer/CalamityPlayerHitHurt.cs b/CalPlayer/CalamityPlayerHitHurt.cs index 016b59831c..5128a0951e 100644 --- a/CalPlayer/CalamityPlayerHitHurt.cs +++ b/CalPlayer/CalamityPlayerHitHurt.cs @@ -2536,7 +2536,7 @@ namespace CalamityMod.CalPlayer if (Player.wingsLogic == (int)VanillaWingID.BoneWings) { // Drop some bones for visual effects - if (Main.netMode != NetmodeID.Server && Player.wingTime > 0) + if (!Main.dedServ && Player.wingTime > 0) { var source = Player.GetSource_Accessory(FindAccessory(ItemID.BoneWings)); for (int i = 0; i < 6; i++) @@ -2872,7 +2872,7 @@ namespace CalamityMod.CalPlayer { NetMessage.SendPlayerDeath(Player.whoAmI, damageSource, (int)1000.0, 0, false, -1, -1); } - if (Main.netMode == NetmodeID.Server) + if (Main.dedServ) { ChatHelper.BroadcastChatMessage(deathText, new Color(225, 25, 25)); } diff --git a/CalPlayer/CalamityPlayerMiscEffects.cs b/CalPlayer/CalamityPlayerMiscEffects.cs index 7bf216f2ee..c1821d50b0 100644 --- a/CalPlayer/CalamityPlayerMiscEffects.cs +++ b/CalPlayer/CalamityPlayerMiscEffects.cs @@ -883,7 +883,7 @@ namespace CalamityMod.CalPlayer private void MiscEffects() { // Update textures - if (Main.netMode != NetmodeID.Server && Player.whoAmI == Main.myPlayer) + if (!Main.dedServ && Player.whoAmI == Main.myPlayer) { Asset carpetAuric = ExtraTextureRefs.FlyingCarpetAuric; Asset carpetOriginal = ExtraTextureRefs.FlyingCarpetVanilla; @@ -1609,7 +1609,7 @@ namespace CalamityMod.CalPlayer // If any cooldowns were removed, send a cooldown removal packet that lists all cooldowns to remove. if (expiredCooldowns.Count > 0) - SyncCooldownRemoval(Main.netMode == NetmodeID.Server, expiredCooldowns); + SyncCooldownRemoval(Main.dedServ, expiredCooldowns); // Grant the player 5 seconds of immunity to immobilizing debuffs after an immobilizing debuff wears off. if (Player.stoned || Player.frozen || Player.webbed || gState) @@ -2391,7 +2391,7 @@ namespace CalamityMod.CalPlayer #region Biome Effects public void DrawPollenInFloralParadise() { - if (!ZoneFloralParadise || !Main.rand.NextBool(7) || Main.netMode == NetmodeID.Server) + if (!ZoneFloralParadise || !Main.rand.NextBool(7) || Main.dedServ) return; for (int i = 0; i < 15; i++) @@ -2761,7 +2761,7 @@ namespace CalamityMod.CalPlayer auralisStealthCounter++; bool usingScope = false; - if (!Main.gameMenu && Main.netMode != NetmodeID.Server) + if (!Main.gameMenu && !Main.dedServ) { if (Player.noThrow <= 0 && !Player.lastMouseInterface || !(Main.CurrentPan == Vector2.Zero)) { @@ -4464,7 +4464,7 @@ namespace CalamityMod.CalPlayer #region Text Chat Messages private void HandleTextChatMessages() { - if (Player.whoAmI != Main.myPlayer || Main.netMode == NetmodeID.Server) + if (Player.whoAmI != Main.myPlayer || Main.dedServ) return; if (startMessageDisplayDelay >= 0) @@ -4631,7 +4631,7 @@ namespace CalamityMod.CalPlayer SyncAndroombaAIPacket.Send(npc.ModNPC(), phase: 1); } } - if (Main.netMode == NetmodeID.Server) + if (Main.dedServ) NetMessage.SendData(MessageID.SyncNPC, -1, -1, null, npc.whoAmI); } } diff --git a/CalamityNetcode.cs b/CalamityNetcode.cs index 71ae34dab4..2abbd7d874 100644 --- a/CalamityNetcode.cs +++ b/CalamityNetcode.cs @@ -136,7 +136,7 @@ namespace CalamityMod public static void SyncWorld() { - if (Main.netMode == NetmodeID.Server) + if (Main.dedServ) NetMessage.SendData(MessageID.WorldData); } diff --git a/Events/AcidRainEvent.cs b/Events/AcidRainEvent.cs index 3ca687018d..d408942aa2 100644 --- a/Events/AcidRainEvent.cs +++ b/Events/AcidRainEvent.cs @@ -337,7 +337,7 @@ namespace CalamityMod.Events // Flow: 2024/09/06 // Salute for the one who wrote 3 if conditional block after experiencing immeasurable torment with packet generations - if (Main.netMode == NetmodeID.Server) + if (Main.dedServ) { AcidRainSyncPacket.Send(); AcidRainOldDukeSummonSyncPacket.Send(); diff --git a/Events/BossRushEvent.cs b/Events/BossRushEvent.cs index cc76cb9048..d3bf603ee5 100644 --- a/Events/BossRushEvent.cs +++ b/Events/BossRushEvent.cs @@ -541,7 +541,7 @@ namespace CalamityMod.Events if (HostileProjectileKillCounter == 1) CalamityUtils.KillAllHostileProjectiles(); - if (Main.netMode == NetmodeID.Server) + if (Main.dedServ) { BRHostileProjKillSyncPacket.Send(); } @@ -557,7 +557,7 @@ namespace CalamityMod.Events if (BossRushStage != 0) { BossRushStage = 0; - if (Main.netMode == NetmodeID.Server) + if (Main.dedServ) { BossRushStagePacket.Send(); } @@ -656,7 +656,7 @@ namespace CalamityMod.Events CalamityUtils.KillAllHostileProjectiles(); CalamityNetcode.SyncWorld(); - if (Main.netMode == NetmodeID.Server) + if (Main.dedServ) { BossRushStagePacket.Send(); BossRushStartTimerPacket.Send(); @@ -745,7 +745,7 @@ namespace CalamityMod.Events } // Sync the stage and progress of Boss Rush whenever a relevant boss dies. - if (Main.netMode == NetmodeID.Server) + if (Main.dedServ) { BossRushStagePacket.Send(); BRHostileProjKillSyncPacket.Send(); @@ -776,7 +776,7 @@ namespace CalamityMod.Events public static void SyncStartTimer(int time) { StartTimer = time; - if (Main.netMode != NetmodeID.Server) + if (!Main.dedServ) return; BossRushStartTimerPacket.Send(); @@ -785,7 +785,7 @@ namespace CalamityMod.Events public static void SyncEndTimer(int time) { EndTimer = time; - if (Main.netMode != NetmodeID.Server) + if (!Main.dedServ) return; BossRushEndTimerPacket.Send(); diff --git a/FluidSimulation/FluidField.cs b/FluidSimulation/FluidField.cs index 03910f257f..eed9ca02fe 100644 --- a/FluidSimulation/FluidField.cs +++ b/FluidSimulation/FluidField.cs @@ -60,7 +60,7 @@ namespace CalamityMod.FluidSimulation { get { - if (Main.netMode != NetmodeID.Server && basicShader is null) + if (!Main.dedServ && basicShader is null) { basicShader = new BasicEffect(Main.instance.GraphicsDevice) { @@ -231,7 +231,7 @@ namespace CalamityMod.FluidSimulation { // Everything here involves heavy manipulation of render targets to work. Doing any of that on the server // would certainly result in a crash due to a lack of a graphics device. - if (Main.netMode == NetmodeID.Server) + if (Main.dedServ) return; if (!ShouldUpdate) diff --git a/FluidSimulation/FluidFieldState.cs b/FluidSimulation/FluidFieldState.cs index e2825f3fd3..9dfa619573 100644 --- a/FluidSimulation/FluidFieldState.cs +++ b/FluidSimulation/FluidFieldState.cs @@ -26,7 +26,7 @@ namespace CalamityMod.FluidSimulation public FluidFieldState(int size, SurfaceFormat fieldContents = SurfaceFormat.Color) { - if (Main.netMode == NetmodeID.Server) + if (Main.dedServ) return; Size = size; diff --git a/Graphics/Metaballs/GalaxyMetaball.cs b/Graphics/Metaballs/GalaxyMetaball.cs index 1a82913348..4d93ed1020 100644 --- a/Graphics/Metaballs/GalaxyMetaball.cs +++ b/Graphics/Metaballs/GalaxyMetaball.cs @@ -62,7 +62,7 @@ namespace CalamityMod.Graphics.Metaballs public override void Load() { - if (Main.netMode == NetmodeID.Server) + if (Main.dedServ) return; // Load the layer asset wrapper. diff --git a/Graphics/Metaballs/GruesomeMetaball.cs b/Graphics/Metaballs/GruesomeMetaball.cs index 3a67d24c7c..0c281d7e5f 100644 --- a/Graphics/Metaballs/GruesomeMetaball.cs +++ b/Graphics/Metaballs/GruesomeMetaball.cs @@ -62,7 +62,7 @@ namespace CalamityMod.Graphics.Metaballs public override void Load() { - if (Main.netMode == NetmodeID.Server) + if (Main.dedServ) return; // Load layer assets. diff --git a/Graphics/Metaballs/Metaball.cs b/Graphics/Metaballs/Metaball.cs index 0ad632f8ae..be9d5556bf 100644 --- a/Graphics/Metaballs/Metaball.cs +++ b/Graphics/Metaballs/Metaball.cs @@ -125,7 +125,7 @@ namespace CalamityMod.Graphics.Metaballs MetaballManager.metaballs.Add(this); // Disallow render target creation on servers. - if (Main.netMode == NetmodeID.Server) + if (Main.dedServ) return; // Generate render targets. diff --git a/Graphics/Metaballs/StreamGougeMetaball.cs b/Graphics/Metaballs/StreamGougeMetaball.cs index 0099af636c..0f31626192 100644 --- a/Graphics/Metaballs/StreamGougeMetaball.cs +++ b/Graphics/Metaballs/StreamGougeMetaball.cs @@ -62,7 +62,7 @@ namespace CalamityMod.Graphics.Metaballs public override void Load() { - if (Main.netMode == NetmodeID.Server) + if (Main.dedServ) return; // Load the layer asset wrapper. diff --git a/Graphics/Renderers/RendererManager.cs b/Graphics/Renderers/RendererManager.cs index 3316d1e63e..a4b0132ce1 100644 --- a/Graphics/Renderers/RendererManager.cs +++ b/Graphics/Renderers/RendererManager.cs @@ -21,7 +21,7 @@ namespace CalamityMod.Graphics.Renderers #region Loading public override void Load() { - if (Main.netMode == NetmodeID.Server) + if (Main.dedServ) return; Main.QueueMainThreadAction(() => @@ -38,7 +38,7 @@ namespace CalamityMod.Graphics.Renderers public override void Unload() { - if (Main.netMode == NetmodeID.Server) + if (Main.dedServ) return; // Clear the cached renderers, so they can be readded on mod loading when initialized. diff --git a/ILEditing/MechanicILChanges.cs b/ILEditing/MechanicILChanges.cs index 32e1c0abab..ad18abaeb4 100644 --- a/ILEditing/MechanicILChanges.cs +++ b/ILEditing/MechanicILChanges.cs @@ -657,7 +657,7 @@ namespace CalamityMod.ILEditing modPlayer.chaliceBleedoutBuffer -= amountOfBleedToClear; // Display text indicating that healing was applied to the bleedout buffer. - if (Main.netMode != NetmodeID.Server) + if (!Main.dedServ) { string text = $"(+{amountOfBleedToClear})"; Rectangle location = new Rectangle((int)player.position.X + 4, (int)player.position.Y - 3, player.width - 4, player.height - 4); @@ -852,7 +852,7 @@ namespace CalamityMod.ILEditing cursor.EmitDelegate(() => { - if (Main.netMode != NetmodeID.Server && BiomeTileCounterSystem.FloralParadiseTiles > 0) + if (!Main.dedServ && BiomeTileCounterSystem.FloralParadiseTiles > 0) DrawFog(Utils.GetLerpValue(0f, 250f, BiomeTileCounterSystem.FloralParadiseTiles, true)); }); @@ -1859,7 +1859,7 @@ namespace CalamityMod.ILEditing Main.npc[retinazerIndex].target = targetPlayerIndex; Main.npc[retinazerIndex].timeLeft *= 20; - if (Main.netMode == NetmodeID.Server && retinazerIndex < 200) + if (Main.dedServ && retinazerIndex < 200) { NetMessage.SendData(MessageID.SyncNPC, -1, -1, null, retinazerIndex); } diff --git a/Items/Accessories/AbyssalDivingGear.cs b/Items/Accessories/AbyssalDivingGear.cs index 440cfaa92c..b2129bd402 100644 --- a/Items/Accessories/AbyssalDivingGear.cs +++ b/Items/Accessories/AbyssalDivingGear.cs @@ -12,7 +12,7 @@ namespace CalamityMod.Items.Accessories public new string LocalizationCategory => "Items.Accessories"; public override void SetStaticDefaults() { - if (Main.netMode != NetmodeID.Server) + if (!Main.dedServ) { int equipSlot = EquipLoader.GetEquipSlot(Mod, Name, EquipType.Face); ArmorIDs.Face.Sets.PreventHairDraw[equipSlot] = true; diff --git a/Items/Accessories/AbyssalDivingSuit.cs b/Items/Accessories/AbyssalDivingSuit.cs index 29f496a0b1..51803181a3 100644 --- a/Items/Accessories/AbyssalDivingSuit.cs +++ b/Items/Accessories/AbyssalDivingSuit.cs @@ -17,7 +17,7 @@ namespace CalamityMod.Items.Accessories public override void Load() { // All code below runs only if we're not loading on a server - if (Main.netMode != NetmodeID.Server) + if (!Main.dedServ) { // Add equip textures EquipLoader.AddEquipTexture(Mod, $"{Texture}_{EquipType.Head}", EquipType.Head, this); @@ -34,7 +34,7 @@ namespace CalamityMod.Items.Accessories Item.value = CalamityGlobalItem.RarityPurpleBuyPrice; Item.rare = ItemRarityID.Purple; - if (Main.netMode != NetmodeID.Server) + if (!Main.dedServ) { int equipSlotHead = EquipLoader.GetEquipSlot(Mod, Name, EquipType.Head); int equipSlotBody = EquipLoader.GetEquipSlot(Mod, Name, EquipType.Body); diff --git a/Items/Accessories/AquaticHeart.cs b/Items/Accessories/AquaticHeart.cs index 0187c48cfc..5c5f1de826 100644 --- a/Items/Accessories/AquaticHeart.cs +++ b/Items/Accessories/AquaticHeart.cs @@ -18,7 +18,7 @@ namespace CalamityMod.Items.Accessories public override void Load() { // All code below runs only if we're not loading on a server - if (Main.netMode != NetmodeID.Server) + if (!Main.dedServ) { // Add equip textures EquipLoader.AddEquipTexture(Mod, "CalamityMod/Items/Accessories/AquaticTrans_Head", EquipType.Head, this); @@ -29,7 +29,7 @@ namespace CalamityMod.Items.Accessories public override void SetStaticDefaults() { - if (Main.netMode != NetmodeID.Server) + if (!Main.dedServ) { int equipSlotHead = EquipLoader.GetEquipSlot(Mod, Name, EquipType.Head); int equipSlotBody = EquipLoader.GetEquipSlot(Mod, Name, EquipType.Body); diff --git a/Items/Accessories/FeatherCrown.cs b/Items/Accessories/FeatherCrown.cs index fc1e5de671..c422418d78 100644 --- a/Items/Accessories/FeatherCrown.cs +++ b/Items/Accessories/FeatherCrown.cs @@ -13,7 +13,7 @@ namespace CalamityMod.Items.Accessories public override void SetStaticDefaults() { - if (Main.netMode != NetmodeID.Server) + if (!Main.dedServ) { int equipSlot = EquipLoader.GetEquipSlot(Mod, Name, EquipType.Face); ArmorIDs.Face.Sets.OverrideHelmet[equipSlot] = true; diff --git a/Items/Accessories/MoonstoneCrown.cs b/Items/Accessories/MoonstoneCrown.cs index 67ce61386b..56872a2ae0 100644 --- a/Items/Accessories/MoonstoneCrown.cs +++ b/Items/Accessories/MoonstoneCrown.cs @@ -16,7 +16,7 @@ namespace CalamityMod.Items.Accessories public override void SetStaticDefaults() { - if (Main.netMode != NetmodeID.Server) + if (!Main.dedServ) { int equipSlot = EquipLoader.GetEquipSlot(Mod, Name, EquipType.Face); ArmorIDs.Face.Sets.OverrideHelmet[equipSlot] = true; diff --git a/Items/Accessories/OccultSkullCrown.cs b/Items/Accessories/OccultSkullCrown.cs index 74efa4c071..96480eb4f3 100644 --- a/Items/Accessories/OccultSkullCrown.cs +++ b/Items/Accessories/OccultSkullCrown.cs @@ -19,7 +19,7 @@ namespace CalamityMod.Items.Accessories public override void SetStaticDefaults() { - if (Main.netMode != NetmodeID.Server) + if (!Main.dedServ) { int equipSlot = EquipLoader.GetEquipSlot(Mod, Name, EquipType.Face); ArmorIDs.Face.Sets.PreventHairDraw[equipSlot] = true; diff --git a/Items/Accessories/ProfanedSoulCrystal.cs b/Items/Accessories/ProfanedSoulCrystal.cs index 85149a4964..bd3e7ab7ba 100644 --- a/Items/Accessories/ProfanedSoulCrystal.cs +++ b/Items/Accessories/ProfanedSoulCrystal.cs @@ -157,7 +157,7 @@ namespace CalamityMod.Items.Accessories */ public override void Load() { - if (Main.netMode == NetmodeID.Server) + if (Main.dedServ) return; EquipLoader.AddEquipTexture(Mod, "CalamityMod/Items/Accessories/ProfanedSoulTransHead", EquipType.Head, this); @@ -174,7 +174,7 @@ namespace CalamityMod.Items.Accessories Main.RegisterItemAnimation(Item.type, new DrawAnimationVertical(8, 4)); ItemID.Sets.AnimatesAsSoul[Type] = true; - if (Main.netMode == NetmodeID.Server) + if (Main.dedServ) return; int equipSlotBody = EquipLoader.GetEquipSlot(Mod, Name, EquipType.Body); diff --git a/Items/Accessories/Vanity/AbandonedWulfrumHelmet.cs b/Items/Accessories/Vanity/AbandonedWulfrumHelmet.cs index 5e8b8ae18d..32ca98b5e7 100644 --- a/Items/Accessories/Vanity/AbandonedWulfrumHelmet.cs +++ b/Items/Accessories/Vanity/AbandonedWulfrumHelmet.cs @@ -24,7 +24,7 @@ namespace CalamityMod.Items.Accessories.Vanity public new string LocalizationCategory => "Items.Accessories"; public override void Load() { - if (Main.netMode != NetmodeID.Server) + if (!Main.dedServ) { EquipLoader.AddEquipTexture(Mod, "CalamityMod/Items/Accessories/Vanity/AbandonedWulfrumHelmet_HeadSet", EquipType.Head, name: "WulfrumOldSetHead"); EquipLoader.AddEquipTexture(Mod, "CalamityMod/Items/Accessories/Vanity/AbandonedWulfrumHelmet_Body", EquipType.Body, this); @@ -35,7 +35,7 @@ namespace CalamityMod.Items.Accessories.Vanity public override void SetStaticDefaults() { - if (Main.netMode == NetmodeID.Server) + if (Main.dedServ) return; int equipSlotHead = EquipLoader.GetEquipSlot(Mod, "WulfrumOldSetHead", EquipType.Head); diff --git a/Items/Accessories/Vanity/CrystalHeartVodka.cs b/Items/Accessories/Vanity/CrystalHeartVodka.cs index 0d24c267b9..d5c29472b1 100644 --- a/Items/Accessories/Vanity/CrystalHeartVodka.cs +++ b/Items/Accessories/Vanity/CrystalHeartVodka.cs @@ -10,7 +10,7 @@ namespace CalamityMod.Items.Accessories.Vanity public override void Load() { - if (Main.netMode != NetmodeID.Server) + if (!Main.dedServ) { EquipLoader.AddEquipTexture(Mod, "CalamityMod/Items/Accessories/Vanity/Fabsol_Head", EquipType.Head, this); EquipLoader.AddEquipTexture(Mod, "CalamityMod/Items/Accessories/Vanity/Fabsol_Body", EquipType.Body, this); @@ -21,7 +21,7 @@ namespace CalamityMod.Items.Accessories.Vanity public override void SetStaticDefaults() { - if (Main.netMode == NetmodeID.Server) + if (Main.dedServ) return; int equipSlotHead = EquipLoader.GetEquipSlot(Mod, Name, EquipType.Head); diff --git a/Items/Accessories/Vanity/GhostBracelet.cs b/Items/Accessories/Vanity/GhostBracelet.cs index b5087243a8..18bb48b9c6 100644 --- a/Items/Accessories/Vanity/GhostBracelet.cs +++ b/Items/Accessories/Vanity/GhostBracelet.cs @@ -10,7 +10,7 @@ namespace CalamityMod.Items.Accessories.Vanity public new string LocalizationCategory => "Items.Accessories"; public override void Load() { - if (Main.netMode != NetmodeID.Server) + if (!Main.dedServ) { EquipLoader.AddEquipTexture(Mod, "CalamityMod/Items/Accessories/Vanity/Dandy_Head", EquipType.Head, this); EquipLoader.AddEquipTexture(Mod, "CalamityMod/Items/Accessories/Vanity/Dandy_Body", EquipType.Body, this); @@ -20,7 +20,7 @@ namespace CalamityMod.Items.Accessories.Vanity public override void SetStaticDefaults() { - if (Main.netMode == NetmodeID.Server) + if (Main.dedServ) return; int equipSlotHead = EquipLoader.GetEquipSlot(Mod, Name, EquipType.Head); diff --git a/Items/Accessories/Vanity/HapuFruit.cs b/Items/Accessories/Vanity/HapuFruit.cs index 30f2a7fefa..65b1948303 100644 --- a/Items/Accessories/Vanity/HapuFruit.cs +++ b/Items/Accessories/Vanity/HapuFruit.cs @@ -12,7 +12,7 @@ namespace CalamityMod.Items.Accessories.Vanity public new string LocalizationCategory => "Items.Accessories"; public override void Load() { - if (Main.netMode != NetmodeID.Server) + if (!Main.dedServ) { EquipLoader.AddEquipTexture(Mod, "CalamityMod/Items/Accessories/Vanity/Heart_Head", EquipType.Head, this); EquipLoader.AddEquipTexture(Mod, "CalamityMod/Items/Accessories/Vanity/Heart_Body", EquipType.Body, this); @@ -24,7 +24,7 @@ namespace CalamityMod.Items.Accessories.Vanity public override void SetStaticDefaults() { - if (Main.netMode == NetmodeID.Server) + if (Main.dedServ) return; int equipSlotHead = EquipLoader.GetEquipSlot(Mod, Name, EquipType.Head); diff --git a/Items/Accessories/Vanity/OracleHeadphones.cs b/Items/Accessories/Vanity/OracleHeadphones.cs index b6997d3609..47645f8084 100644 --- a/Items/Accessories/Vanity/OracleHeadphones.cs +++ b/Items/Accessories/Vanity/OracleHeadphones.cs @@ -9,7 +9,7 @@ namespace CalamityMod.Items.Accessories.Vanity public new string LocalizationCategory => "Items.Accessories"; public override void Load() { - if (Main.netMode != NetmodeID.Server) + if (!Main.dedServ) { EquipLoader.AddEquipTexture(Mod, "CalamityMod/Items/Accessories/Vanity/Mishiro_Head", EquipType.Head, this); EquipLoader.AddEquipTexture(Mod, "CalamityMod/Items/Accessories/Vanity/Mishiro_Body", EquipType.Body, this); @@ -21,7 +21,7 @@ namespace CalamityMod.Items.Accessories.Vanity public override void SetStaticDefaults() { - if (Main.netMode == NetmodeID.Server) + if (Main.dedServ) return; int equipSlotHead = EquipLoader.GetEquipSlot(Mod, Name, EquipType.Head); diff --git a/Items/Accessories/Vanity/Popo.cs b/Items/Accessories/Vanity/Popo.cs index f78f57563a..66fe6d0f3c 100644 --- a/Items/Accessories/Vanity/Popo.cs +++ b/Items/Accessories/Vanity/Popo.cs @@ -10,7 +10,7 @@ namespace CalamityMod.Items.Accessories.Vanity public new string LocalizationCategory => "Items.Accessories"; public override void Load() { - if (Main.netMode != NetmodeID.Server) + if (!Main.dedServ) { EquipLoader.AddEquipTexture(Mod, "CalamityMod/Items/Accessories/Vanity/Popo_Head", EquipType.Head, this); EquipLoader.AddEquipTexture(Mod, "CalamityMod/Items/Accessories/Vanity/PopoNoseless_Head", EquipType.Head, name: "PopoNoseless"); @@ -21,7 +21,7 @@ namespace CalamityMod.Items.Accessories.Vanity public override void SetStaticDefaults() { - if (Main.netMode == NetmodeID.Server) + if (Main.dedServ) return; int equipSlotBody = EquipLoader.GetEquipSlot(Mod, Name, EquipType.Body); diff --git a/Items/Accessories/Vanity/PunchCard.cs b/Items/Accessories/Vanity/PunchCard.cs index 4fef249a0e..40ac2b7d48 100644 --- a/Items/Accessories/Vanity/PunchCard.cs +++ b/Items/Accessories/Vanity/PunchCard.cs @@ -10,7 +10,7 @@ namespace CalamityMod.Items.Accessories.Vanity public new string LocalizationCategory => "Items.Accessories"; public override void Load() { - if (Main.netMode != NetmodeID.Server) + if (!Main.dedServ) { EquipLoader.AddEquipTexture(Mod, "CalamityMod/Items/Accessories/Vanity/Shayy_Head", EquipType.Head, this); EquipLoader.AddEquipTexture(Mod, "CalamityMod/Items/Accessories/Vanity/Shayy_Body", EquipType.Body, this); @@ -20,7 +20,7 @@ namespace CalamityMod.Items.Accessories.Vanity public override void SetStaticDefaults() { - if (Main.netMode == NetmodeID.Server) + if (Main.dedServ) return; int equipSlotHead = EquipLoader.GetEquipSlot(Mod, Name, EquipType.Head); diff --git a/Items/AlicornonaStick.cs b/Items/AlicornonaStick.cs index 4f30a42f0b..1a0dda3f93 100644 --- a/Items/AlicornonaStick.cs +++ b/Items/AlicornonaStick.cs @@ -34,7 +34,7 @@ namespace CalamityMod.Items { int damage = npc.SimpleStrikeNPC((int)(npc.lifeMax / 200), player.direction, true); SoundEngine.PlaySound(Projectiles.Summon.CnidarianJellyfishOnTheString.SlapSound with { Volume = 2, MaxInstances = 200 }, npc.Center); - if (Main.netMode != NetmodeID.Server) + if (!Main.dedServ) { BloodShed(itemRect, npc, damage, player); } diff --git a/Items/Armor/Aerospec/AerospecHeadgear.cs b/Items/Armor/Aerospec/AerospecHeadgear.cs index 874e6b6821..2caf137da0 100644 --- a/Items/Armor/Aerospec/AerospecHeadgear.cs +++ b/Items/Armor/Aerospec/AerospecHeadgear.cs @@ -12,7 +12,7 @@ namespace CalamityMod.Items.Armor.Aerospec public new string LocalizationCategory => "Items.Armor.PreHardmode"; public override void SetStaticDefaults() { - if (Main.netMode != NetmodeID.Server) + if (!Main.dedServ) ArmorIDs.Head.Sets.DrawFullHair[Item.headSlot] = true; } diff --git a/Items/Armor/Auric/AuricTeslaBodyArmor.cs b/Items/Armor/Auric/AuricTeslaBodyArmor.cs index 91ccc4cd61..caa5cbe2cc 100644 --- a/Items/Armor/Auric/AuricTeslaBodyArmor.cs +++ b/Items/Armor/Auric/AuricTeslaBodyArmor.cs @@ -19,7 +19,7 @@ namespace CalamityMod.Items.Armor.Auric public override void Load() { // All code below runs only if we're not loading on a server - if (Main.netMode != NetmodeID.Server) + if (!Main.dedServ) { // Add equip textures EquipLoader.AddEquipTexture(Mod, "CalamityMod/Items/Armor/Auric/AuricTeslaBodyArmor_Back", EquipType.Back, this); diff --git a/Items/Armor/Brimflame/BrimflameRobes.cs b/Items/Armor/Brimflame/BrimflameRobes.cs index 5bf558ddb0..8e2ba2b87b 100644 --- a/Items/Armor/Brimflame/BrimflameRobes.cs +++ b/Items/Armor/Brimflame/BrimflameRobes.cs @@ -12,7 +12,7 @@ namespace CalamityMod.Items.Armor.Brimflame public override void SetStaticDefaults() { - if (Main.netMode == NetmodeID.Server) + if (Main.dedServ) return; int equipSlot = EquipLoader.GetEquipSlot(Mod, Name, EquipType.Body); diff --git a/Items/Armor/CirrusDress.cs b/Items/Armor/CirrusDress.cs index 4da0b51cd9..4436d3cea4 100644 --- a/Items/Armor/CirrusDress.cs +++ b/Items/Armor/CirrusDress.cs @@ -17,7 +17,7 @@ namespace CalamityMod.Items.Armor public override void Load() { - if (Main.netMode != NetmodeID.Server) + if (!Main.dedServ) { EquipLoader.AddEquipTexture(Mod, "CalamityMod/Items/Armor/CirrusDress_Legs", EquipType.Legs, this); } @@ -26,7 +26,7 @@ namespace CalamityMod.Items.Armor public override void SetStaticDefaults() { - if (Main.netMode == NetmodeID.Server) + if (Main.dedServ) return; int equipSlot = EquipLoader.GetEquipSlot(Mod, Name, EquipType.Body); ArmorIDs.Body.Sets.HidesHands[equipSlot] = true; diff --git a/Items/Armor/Daedalus/DaedalusBreastplate.cs b/Items/Armor/Daedalus/DaedalusBreastplate.cs index 99653f3213..9b81c403db 100644 --- a/Items/Armor/Daedalus/DaedalusBreastplate.cs +++ b/Items/Armor/Daedalus/DaedalusBreastplate.cs @@ -11,7 +11,7 @@ namespace CalamityMod.Items.Armor.Daedalus public new string LocalizationCategory => "Items.Armor.Hardmode"; public override void Load() { - if (Main.netMode == NetmodeID.Server) + if (Main.dedServ) return; EquipLoader.AddEquipTexture(Mod, "CalamityMod/Items/Armor/Daedalus/DaedalusBreastplate_Waist", EquipType.Waist, this); diff --git a/Items/Armor/DesertProwler/DesertProwlerSet.cs b/Items/Armor/DesertProwler/DesertProwlerSet.cs index d29bc40ab5..7d7bcd3c06 100644 --- a/Items/Armor/DesertProwler/DesertProwlerSet.cs +++ b/Items/Armor/DesertProwler/DesertProwlerSet.cs @@ -205,7 +205,7 @@ namespace CalamityMod.Items.Armor.DesertProwler public override void SetStaticDefaults() { - if (Main.netMode == NetmodeID.Server) + if (Main.dedServ) return; int equipSlot = EquipLoader.GetEquipSlot(Mod, Name, EquipType.Body); diff --git a/Items/Armor/Empyrean/EmpyreanCloak.cs b/Items/Armor/Empyrean/EmpyreanCloak.cs index 1cb1f1d103..bf80cf38b8 100644 --- a/Items/Armor/Empyrean/EmpyreanCloak.cs +++ b/Items/Armor/Empyrean/EmpyreanCloak.cs @@ -12,7 +12,7 @@ namespace CalamityMod.Items.Armor.Empyrean public new string LocalizationCategory => "Items.Armor.PostMoonLord"; public override void Load() { - if (Main.netMode != NetmodeID.Server) + if (!Main.dedServ) { EquipLoader.AddEquipTexture(Mod, "CalamityMod/Items/Armor/Empyrean/EmpyreanCloak_Neck", EquipType.Neck, this); EquipLoader.AddEquipTexture(Mod, "CalamityMod/Items/Armor/Empyrean/EmpyreanCloak_Back", EquipType.Back, this); @@ -22,7 +22,7 @@ namespace CalamityMod.Items.Armor.Empyrean public override void SetStaticDefaults() { - if (Main.netMode != NetmodeID.Server) + if (!Main.dedServ) { var equipSlot = EquipLoader.GetEquipSlot(Mod, Name, EquipType.Body); ArmorIDs.Body.Sets.HidesArms[equipSlot] = true; diff --git a/Items/Armor/Empyrean/EmpyreanMask.cs b/Items/Armor/Empyrean/EmpyreanMask.cs index cfed0d75cc..87b20de371 100644 --- a/Items/Armor/Empyrean/EmpyreanMask.cs +++ b/Items/Armor/Empyrean/EmpyreanMask.cs @@ -14,7 +14,7 @@ namespace CalamityMod.Items.Armor.Empyrean public new string LocalizationCategory => "Items.Armor.PostMoonLord"; public override void Load() { - if (Main.netMode != NetmodeID.Server) + if (!Main.dedServ) { EquipLoader.AddEquipTexture(Mod, "CalamityMod/Items/Armor/Empyrean/MeldTransformation_Head", EquipType.Head, name: "MeldTransformation"); EquipLoader.AddEquipTexture(Mod, "CalamityMod/Items/Armor/Empyrean/MeldTransformation_Body", EquipType.Body, name: "MeldTransformation"); @@ -26,7 +26,7 @@ namespace CalamityMod.Items.Armor.Empyrean public override void SetStaticDefaults() { - if (Main.netMode == NetmodeID.Server) + if (Main.dedServ) return; var equipSlotHead = EquipLoader.GetEquipSlot(Mod, "MeldTransformation", EquipType.Head); diff --git a/Items/Armor/FathomSwarmer/FathomSwarmerBreastplate.cs b/Items/Armor/FathomSwarmer/FathomSwarmerBreastplate.cs index f08a2fdb0b..be0e044c58 100644 --- a/Items/Armor/FathomSwarmer/FathomSwarmerBreastplate.cs +++ b/Items/Armor/FathomSwarmer/FathomSwarmerBreastplate.cs @@ -13,7 +13,7 @@ namespace CalamityMod.Items.Armor.FathomSwarmer public override void SetStaticDefaults() { - if (Main.netMode == NetmodeID.Server) + if (Main.dedServ) return; int equipSlot = EquipLoader.GetEquipSlot(Mod, Name, EquipType.Body); diff --git a/Items/Armor/ForbiddenCirclet.cs b/Items/Armor/ForbiddenCirclet.cs index 322a0667f7..f5566fca6f 100644 --- a/Items/Armor/ForbiddenCirclet.cs +++ b/Items/Armor/ForbiddenCirclet.cs @@ -15,7 +15,7 @@ namespace CalamityMod.Items.Armor public override void SetStaticDefaults() { - if (Main.netMode != NetmodeID.Server) + if (!Main.dedServ) ArmorIDs.Head.Sets.DrawFullHair[Item.headSlot] = true; } diff --git a/Items/Armor/MarniteArchitect/MarniteArchitectSet.cs b/Items/Armor/MarniteArchitect/MarniteArchitectSet.cs index 34eb51bc23..bc1b1eaadc 100644 --- a/Items/Armor/MarniteArchitect/MarniteArchitectSet.cs +++ b/Items/Armor/MarniteArchitect/MarniteArchitectSet.cs @@ -42,7 +42,7 @@ namespace CalamityMod.Items.Armor.MarniteArchitect public override void SetStaticDefaults() { - if (Main.netMode == NetmodeID.Server) + if (Main.dedServ) return; int equipSlot = EquipLoader.GetEquipSlot(Mod, Name, EquipType.Head); @@ -138,14 +138,14 @@ namespace CalamityMod.Items.Armor.MarniteArchitect public new string LocalizationCategory => "Items.Armor.PreHardmode"; public override void Load() { - if (Main.netMode == NetmodeID.Server) + if (Main.dedServ) return; EquipLoader.AddEquipTexture(Mod, "CalamityMod/Items/Armor/MarniteArchitect/MarniteArchitectToga_Legs", EquipType.Legs, this); } public override void SetStaticDefaults() { - if (Main.netMode == NetmodeID.Server) + if (Main.dedServ) return; } @@ -366,7 +366,7 @@ namespace CalamityMod.Items.Armor.MarniteArchitect MountData.playerHeadOffset = 4; //Sprites - if (Main.netMode != NetmodeID.Server) + if (!Main.dedServ) { MountData.frontTextureGlow = Request("CalamityMod/Items/Armor/MarniteArchitect/MarniteLiftFire"); } diff --git a/Items/Armor/OmegaBlue/OmegaBlueChestplate.cs b/Items/Armor/OmegaBlue/OmegaBlueChestplate.cs index cd1bde96a9..86e43aab19 100644 --- a/Items/Armor/OmegaBlue/OmegaBlueChestplate.cs +++ b/Items/Armor/OmegaBlue/OmegaBlueChestplate.cs @@ -14,7 +14,7 @@ namespace CalamityMod.Items.Armor.OmegaBlue public new string LocalizationCategory => "Items.Armor.PostMoonLord"; public override void SetStaticDefaults() { - if (Main.netMode == NetmodeID.Server) + if (Main.dedServ) return; int equipSlot = EquipLoader.GetEquipSlot(Mod, Name, EquipType.Body); diff --git a/Items/Armor/OmegaBlue/OmegaBlueHelmet.cs b/Items/Armor/OmegaBlue/OmegaBlueHelmet.cs index 60b3e78e26..f431d2621b 100644 --- a/Items/Armor/OmegaBlue/OmegaBlueHelmet.cs +++ b/Items/Armor/OmegaBlue/OmegaBlueHelmet.cs @@ -21,7 +21,7 @@ namespace CalamityMod.Items.Armor.OmegaBlue public override void Load() { - if (Main.netMode != NetmodeID.Server) + if (!Main.dedServ) { EquipLoader.AddEquipTexture(Mod, "CalamityMod/Items/Armor/OmegaBlue/OmegaBlueHelmet_HeadMadness", EquipType.Head, name: "OmegaBlueTransformation"); } @@ -29,7 +29,7 @@ namespace CalamityMod.Items.Armor.OmegaBlue public override void SetStaticDefaults() { - if (Main.netMode == NetmodeID.Server) + if (Main.dedServ) return; var equipSlotHead = EquipLoader.GetEquipSlot(Mod, "OmegaBlueTransformation", EquipType.Head); ArmorIDs.Head.Sets.DrawHead[equipSlotHead] = false; diff --git a/Items/Armor/OmegaBlue/OmegaBlueTentacles.cs b/Items/Armor/OmegaBlue/OmegaBlueTentacles.cs index 444b81aa4e..54f1cbbf0a 100644 --- a/Items/Armor/OmegaBlue/OmegaBlueTentacles.cs +++ b/Items/Armor/OmegaBlue/OmegaBlueTentacles.cs @@ -14,7 +14,7 @@ namespace CalamityMod.Items.Armor.OmegaBlue public new string LocalizationCategory => "Items.Armor.PostMoonLord"; public override void SetStaticDefaults() { - if (Main.netMode == NetmodeID.Server) + if (Main.dedServ) return; int equipSlot = EquipLoader.GetEquipSlot(Mod, Name, EquipType.Legs); diff --git a/Items/Armor/Plaguebringer/PlaguebringerCarapace.cs b/Items/Armor/Plaguebringer/PlaguebringerCarapace.cs index 5dfb7ff7c5..dc7245ce1a 100644 --- a/Items/Armor/Plaguebringer/PlaguebringerCarapace.cs +++ b/Items/Armor/Plaguebringer/PlaguebringerCarapace.cs @@ -13,7 +13,7 @@ namespace CalamityMod.Items.Armor.Plaguebringer public new string LocalizationCategory => "Items.Armor.Hardmode"; public override void SetStaticDefaults() { - if (Main.netMode == NetmodeID.Server) + if (Main.dedServ) return; int equipSlot = EquipLoader.GetEquipSlot(Mod, Name, EquipType.Body); diff --git a/Items/Armor/Prismatic/PrismaticRegalia.cs b/Items/Armor/Prismatic/PrismaticRegalia.cs index 960e7b4a34..fbb6023108 100644 --- a/Items/Armor/Prismatic/PrismaticRegalia.cs +++ b/Items/Armor/Prismatic/PrismaticRegalia.cs @@ -14,7 +14,7 @@ namespace CalamityMod.Items.Armor.Prismatic public override void SetStaticDefaults() { - if (Main.netMode == NetmodeID.Server) + if (Main.dedServ) return; int equipSlot = EquipLoader.GetEquipSlot(Mod, Name, EquipType.Body); diff --git a/Items/Armor/Reaver/ReaverScaleMail.cs b/Items/Armor/Reaver/ReaverScaleMail.cs index 43de28e502..4b4f5a5f6d 100644 --- a/Items/Armor/Reaver/ReaverScaleMail.cs +++ b/Items/Armor/Reaver/ReaverScaleMail.cs @@ -12,7 +12,7 @@ namespace CalamityMod.Items.Armor.Reaver public override void SetStaticDefaults() { - if (Main.netMode == NetmodeID.Server) + if (Main.dedServ) return; int equipSlot = EquipLoader.GetEquipSlot(Mod, Name, EquipType.Body); diff --git a/Items/Armor/SnowRuffian/SnowRuffianChestplate.cs b/Items/Armor/SnowRuffian/SnowRuffianChestplate.cs index cc726ffdc5..c9cc263a73 100644 --- a/Items/Armor/SnowRuffian/SnowRuffianChestplate.cs +++ b/Items/Armor/SnowRuffian/SnowRuffianChestplate.cs @@ -10,7 +10,7 @@ namespace CalamityMod.Items.Armor.SnowRuffian public new string LocalizationCategory => "Items.Armor.PreHardmode"; public override void Load() { - if (Main.netMode == NetmodeID.Server) + if (Main.dedServ) return; EquipLoader.AddEquipTexture(Mod, "CalamityMod/Items/Armor/SnowRuffian/SnowRuffianChestplate_Back", EquipType.Back, this); @@ -20,7 +20,7 @@ namespace CalamityMod.Items.Armor.SnowRuffian public override void SetStaticDefaults() { - if (Main.netMode == NetmodeID.Server) + if (Main.dedServ) return; int equipSlot = EquipLoader.GetEquipSlot(Mod, Name, EquipType.Body); diff --git a/Items/Armor/SnowRuffian/SnowRuffianMask.cs b/Items/Armor/SnowRuffian/SnowRuffianMask.cs index 20ea54216f..c05014c4cb 100644 --- a/Items/Armor/SnowRuffian/SnowRuffianMask.cs +++ b/Items/Armor/SnowRuffian/SnowRuffianMask.cs @@ -14,7 +14,7 @@ namespace CalamityMod.Items.Armor.SnowRuffian public override void Load() { - if (Main.netMode != NetmodeID.Server) + if (!Main.dedServ) { EquipLoader.AddEquipTexture(Mod, "CalamityMod/Items/Armor/SnowRuffian/SnowRuffianWings", EquipType.Wings, this, equipTexture: new SnowRuffianWings()); } diff --git a/Items/Armor/Statigel/StatigelArmor.cs b/Items/Armor/Statigel/StatigelArmor.cs index 61dd19de8f..0ff1c28e1f 100644 --- a/Items/Armor/Statigel/StatigelArmor.cs +++ b/Items/Armor/Statigel/StatigelArmor.cs @@ -13,7 +13,7 @@ namespace CalamityMod.Items.Armor.Statigel public override void SetStaticDefaults() { - if (Main.netMode == NetmodeID.Server) + if (Main.dedServ) return; int equipSlot = EquipLoader.GetEquipSlot(Mod, Name, EquipType.Body); diff --git a/Items/Armor/TitanHeart/TitanHeartMantle.cs b/Items/Armor/TitanHeart/TitanHeartMantle.cs index f52d439894..8a7129a95b 100644 --- a/Items/Armor/TitanHeart/TitanHeartMantle.cs +++ b/Items/Armor/TitanHeart/TitanHeartMantle.cs @@ -13,7 +13,7 @@ namespace CalamityMod.Items.Armor.TitanHeart public override void SetStaticDefaults() { - if (Main.netMode == NetmodeID.Server) + if (Main.dedServ) return; int equipSlot = EquipLoader.GetEquipSlot(Mod, Name, EquipType.Body); diff --git a/Items/Armor/Vanity/AnahitaMask.cs b/Items/Armor/Vanity/AnahitaMask.cs index 4db1f50099..e34bb084e0 100644 --- a/Items/Armor/Vanity/AnahitaMask.cs +++ b/Items/Armor/Vanity/AnahitaMask.cs @@ -11,7 +11,7 @@ namespace CalamityMod.Items.Armor.Vanity public override void SetStaticDefaults() { - if (Main.netMode != NetmodeID.Server) + if (!Main.dedServ) ArmorIDs.Head.Sets.DrawHead[Item.headSlot] = false; } diff --git a/Items/Armor/Vanity/ApolloMask.cs b/Items/Armor/Vanity/ApolloMask.cs index 4fa5fab09d..a8a803c4a0 100644 --- a/Items/Armor/Vanity/ApolloMask.cs +++ b/Items/Armor/Vanity/ApolloMask.cs @@ -12,7 +12,7 @@ namespace CalamityMod.Items.Armor.Vanity public new string LocalizationCategory => "Items.Armor.Vanity"; public override void SetStaticDefaults() { - if (Main.netMode != NetmodeID.Server) + if (!Main.dedServ) { int equipSlotHead = EquipLoader.GetEquipSlot(Mod, Name, EquipType.Head); ArmorIDs.Head.Sets.DrawHead[equipSlotHead] = false; diff --git a/Items/Armor/Vanity/AquaticScourgeMask.cs b/Items/Armor/Vanity/AquaticScourgeMask.cs index be678d7788..6376110756 100644 --- a/Items/Armor/Vanity/AquaticScourgeMask.cs +++ b/Items/Armor/Vanity/AquaticScourgeMask.cs @@ -11,7 +11,7 @@ namespace CalamityMod.Items.Armor.Vanity public override void SetStaticDefaults() { - if (Main.netMode != NetmodeID.Server) + if (!Main.dedServ) ArmorIDs.Head.Sets.DrawHead[Item.headSlot] = false; } diff --git a/Items/Armor/Vanity/AresMask.cs b/Items/Armor/Vanity/AresMask.cs index aa5580989e..7a00162411 100644 --- a/Items/Armor/Vanity/AresMask.cs +++ b/Items/Armor/Vanity/AresMask.cs @@ -11,7 +11,7 @@ namespace CalamityMod.Items.Armor.Vanity public override void SetStaticDefaults() { - if (Main.netMode != NetmodeID.Server) + if (!Main.dedServ) ArmorIDs.Head.Sets.DrawHead[Item.headSlot] = false; } diff --git a/Items/Armor/Vanity/ArtemisMask.cs b/Items/Armor/Vanity/ArtemisMask.cs index b7566aee1f..25ed7aca01 100644 --- a/Items/Armor/Vanity/ArtemisMask.cs +++ b/Items/Armor/Vanity/ArtemisMask.cs @@ -12,7 +12,7 @@ namespace CalamityMod.Items.Armor.Vanity public new string LocalizationCategory => "Items.Armor.Vanity"; public override void SetStaticDefaults() { - if (Main.netMode != NetmodeID.Server) + if (!Main.dedServ) { int equipSlotHead = EquipLoader.GetEquipSlot(Mod, Name, EquipType.Head); ArmorIDs.Head.Sets.DrawHead[equipSlotHead] = false; diff --git a/Items/Armor/Vanity/AshenHorns.cs b/Items/Armor/Vanity/AshenHorns.cs index 7837db098a..3810a096c6 100644 --- a/Items/Armor/Vanity/AshenHorns.cs +++ b/Items/Armor/Vanity/AshenHorns.cs @@ -11,7 +11,7 @@ namespace CalamityMod.Items.Armor.Vanity public override void SetStaticDefaults() { - if (Main.netMode != NetmodeID.Server) + if (!Main.dedServ) ArmorIDs.Head.Sets.DrawFullHair[Item.headSlot] = true; } diff --git a/Items/Armor/Vanity/AstrumAureusMask.cs b/Items/Armor/Vanity/AstrumAureusMask.cs index e1fef0a232..6302db15c8 100644 --- a/Items/Armor/Vanity/AstrumAureusMask.cs +++ b/Items/Armor/Vanity/AstrumAureusMask.cs @@ -12,7 +12,7 @@ namespace CalamityMod.Items.Armor.Vanity public override void SetStaticDefaults() { - if (Main.netMode != NetmodeID.Server) + if (!Main.dedServ) ArmorIDs.Head.Sets.DrawHead[Item.headSlot] = false; } diff --git a/Items/Armor/Vanity/AstrumDeusMask.cs b/Items/Armor/Vanity/AstrumDeusMask.cs index 02f8e896a6..b69d950e2d 100644 --- a/Items/Armor/Vanity/AstrumDeusMask.cs +++ b/Items/Armor/Vanity/AstrumDeusMask.cs @@ -11,7 +11,7 @@ namespace CalamityMod.Items.Armor.Vanity public override void SetStaticDefaults() { - if (Main.netMode != NetmodeID.Server) + if (!Main.dedServ) ArmorIDs.Head.Sets.DrawHead[Item.headSlot] = false; } diff --git a/Items/Armor/Vanity/BrimstoneWaifuMask.cs b/Items/Armor/Vanity/BrimstoneWaifuMask.cs index 0b924dfe7e..eb0be7c6be 100644 --- a/Items/Armor/Vanity/BrimstoneWaifuMask.cs +++ b/Items/Armor/Vanity/BrimstoneWaifuMask.cs @@ -11,7 +11,7 @@ namespace CalamityMod.Items.Armor.Vanity public override void SetStaticDefaults() { - if (Main.netMode != NetmodeID.Server) + if (!Main.dedServ) ArmorIDs.Head.Sets.DrawHead[Item.headSlot] = false; } diff --git a/Items/Armor/Vanity/BumblefuckMask.cs b/Items/Armor/Vanity/BumblefuckMask.cs index daa49fa6a4..4b3cc4d5f2 100644 --- a/Items/Armor/Vanity/BumblefuckMask.cs +++ b/Items/Armor/Vanity/BumblefuckMask.cs @@ -11,7 +11,7 @@ namespace CalamityMod.Items.Armor.Vanity public override void SetStaticDefaults() { - if (Main.netMode != NetmodeID.Server) + if (!Main.dedServ) ArmorIDs.Head.Sets.DrawHead[Item.headSlot] = false; } diff --git a/Items/Armor/Vanity/CalamitasCloneMask.cs b/Items/Armor/Vanity/CalamitasCloneMask.cs index 70e99716a0..e7b9028f0f 100644 --- a/Items/Armor/Vanity/CalamitasCloneMask.cs +++ b/Items/Armor/Vanity/CalamitasCloneMask.cs @@ -12,7 +12,7 @@ namespace CalamityMod.Items.Armor.Vanity public override void SetStaticDefaults() { - if (Main.netMode != NetmodeID.Server) + if (!Main.dedServ) ArmorIDs.Head.Sets.DrawHead[Item.headSlot] = false; } diff --git a/Items/Armor/Vanity/CeaselessVoidMask.cs b/Items/Armor/Vanity/CeaselessVoidMask.cs index b904b2dc40..59eebc330a 100644 --- a/Items/Armor/Vanity/CeaselessVoidMask.cs +++ b/Items/Armor/Vanity/CeaselessVoidMask.cs @@ -11,7 +11,7 @@ namespace CalamityMod.Items.Armor.Vanity public override void SetStaticDefaults() { - if (Main.netMode != NetmodeID.Server) + if (!Main.dedServ) ArmorIDs.Head.Sets.DrawHead[Item.headSlot] = false; } diff --git a/Items/Armor/Vanity/CrabulonMask.cs b/Items/Armor/Vanity/CrabulonMask.cs index 9762528cb5..20104d4fbc 100644 --- a/Items/Armor/Vanity/CrabulonMask.cs +++ b/Items/Armor/Vanity/CrabulonMask.cs @@ -11,7 +11,7 @@ namespace CalamityMod.Items.Armor.Vanity public override void SetStaticDefaults() { - if (Main.netMode != NetmodeID.Server) + if (!Main.dedServ) ArmorIDs.Head.Sets.DrawHead[Item.headSlot] = false; } diff --git a/Items/Armor/Vanity/CryogenMask.cs b/Items/Armor/Vanity/CryogenMask.cs index f040947bf1..7b5ff08c9b 100644 --- a/Items/Armor/Vanity/CryogenMask.cs +++ b/Items/Armor/Vanity/CryogenMask.cs @@ -11,7 +11,7 @@ namespace CalamityMod.Items.Armor.Vanity public override void SetStaticDefaults() { - if (Main.netMode != NetmodeID.Server) + if (!Main.dedServ) ArmorIDs.Head.Sets.DrawHead[Item.headSlot] = false; } diff --git a/Items/Armor/Vanity/DesertScourgeMask.cs b/Items/Armor/Vanity/DesertScourgeMask.cs index 2f02591f1b..38f27aff27 100644 --- a/Items/Armor/Vanity/DesertScourgeMask.cs +++ b/Items/Armor/Vanity/DesertScourgeMask.cs @@ -11,7 +11,7 @@ namespace CalamityMod.Items.Armor.Vanity public override void SetStaticDefaults() { - if (Main.netMode != NetmodeID.Server) + if (!Main.dedServ) ArmorIDs.Head.Sets.DrawHead[Item.headSlot] = false; } diff --git a/Items/Armor/Vanity/DevourerofGodsMask.cs b/Items/Armor/Vanity/DevourerofGodsMask.cs index 66d8800593..a6d1ce5b97 100644 --- a/Items/Armor/Vanity/DevourerofGodsMask.cs +++ b/Items/Armor/Vanity/DevourerofGodsMask.cs @@ -11,7 +11,7 @@ namespace CalamityMod.Items.Armor.Vanity public override void SetStaticDefaults() { - if (Main.netMode != NetmodeID.Server) + if (!Main.dedServ) ArmorIDs.Head.Sets.DrawHead[Item.headSlot] = false; } diff --git a/Items/Armor/Vanity/DraedonMask.cs b/Items/Armor/Vanity/DraedonMask.cs index cdc742b38c..4600a31152 100644 --- a/Items/Armor/Vanity/DraedonMask.cs +++ b/Items/Armor/Vanity/DraedonMask.cs @@ -11,7 +11,7 @@ namespace CalamityMod.Items.Armor.Vanity public override void SetStaticDefaults() { - if (Main.netMode != NetmodeID.Server) + if (!Main.dedServ) ArmorIDs.Head.Sets.DrawHead[Item.headSlot] = false; } diff --git a/Items/Armor/Vanity/HiveMindMask.cs b/Items/Armor/Vanity/HiveMindMask.cs index 31ff5b076d..b8f888d5ed 100644 --- a/Items/Armor/Vanity/HiveMindMask.cs +++ b/Items/Armor/Vanity/HiveMindMask.cs @@ -11,7 +11,7 @@ namespace CalamityMod.Items.Armor.Vanity public override void SetStaticDefaults() { - if (Main.netMode != NetmodeID.Server) + if (!Main.dedServ) ArmorIDs.Head.Sets.DrawHead[Item.headSlot] = false; } diff --git a/Items/Armor/Vanity/HoodOfCalamity.cs b/Items/Armor/Vanity/HoodOfCalamity.cs index 8b98f05fdb..1a89bb31a8 100644 --- a/Items/Armor/Vanity/HoodOfCalamity.cs +++ b/Items/Armor/Vanity/HoodOfCalamity.cs @@ -12,7 +12,7 @@ namespace CalamityMod.Items.Armor.Vanity public override void SetStaticDefaults() { - if (Main.netMode != NetmodeID.Server) + if (!Main.dedServ) ArmorIDs.Head.Sets.DrawHead[Item.headSlot] = false; } diff --git a/Items/Armor/Vanity/OldDukeMask.cs b/Items/Armor/Vanity/OldDukeMask.cs index 03c00611bb..01d8b8168c 100644 --- a/Items/Armor/Vanity/OldDukeMask.cs +++ b/Items/Armor/Vanity/OldDukeMask.cs @@ -11,7 +11,7 @@ namespace CalamityMod.Items.Armor.Vanity public override void SetStaticDefaults() { - if (Main.netMode != NetmodeID.Server) + if (!Main.dedServ) ArmorIDs.Head.Sets.DrawHead[Item.headSlot] = false; } diff --git a/Items/Armor/Vanity/OldHunterSet.cs b/Items/Armor/Vanity/OldHunterSet.cs index 03471b531d..475720b465 100644 --- a/Items/Armor/Vanity/OldHunterSet.cs +++ b/Items/Armor/Vanity/OldHunterSet.cs @@ -38,7 +38,7 @@ namespace CalamityMod.Items.Armor.Vanity public override void Load() { - if (Main.netMode == NetmodeID.Server) + if (Main.dedServ) return; EquipLoader.AddEquipTexture(Mod, "CalamityMod/Items/Armor/Vanity/OldHunterShirt_Back", EquipType.Back, this); @@ -47,7 +47,7 @@ namespace CalamityMod.Items.Armor.Vanity public override void SetStaticDefaults() { - if (Main.netMode == NetmodeID.Server) + if (Main.dedServ) return; int equipSlot = EquipLoader.GetEquipSlot(Mod, Name, EquipType.Body); diff --git a/Items/Armor/Vanity/PerforatorMask.cs b/Items/Armor/Vanity/PerforatorMask.cs index 03148413bf..7cdd7dfb70 100644 --- a/Items/Armor/Vanity/PerforatorMask.cs +++ b/Items/Armor/Vanity/PerforatorMask.cs @@ -11,7 +11,7 @@ namespace CalamityMod.Items.Armor.Vanity public override void SetStaticDefaults() { - if (Main.netMode != NetmodeID.Server) + if (!Main.dedServ) ArmorIDs.Head.Sets.DrawHead[Item.headSlot] = false; } diff --git a/Items/Armor/Vanity/PlaguebringerGoliathMask.cs b/Items/Armor/Vanity/PlaguebringerGoliathMask.cs index 148f99be3e..45f97fd825 100644 --- a/Items/Armor/Vanity/PlaguebringerGoliathMask.cs +++ b/Items/Armor/Vanity/PlaguebringerGoliathMask.cs @@ -11,7 +11,7 @@ namespace CalamityMod.Items.Armor.Vanity public override void SetStaticDefaults() { - if (Main.netMode != NetmodeID.Server) + if (!Main.dedServ) ArmorIDs.Head.Sets.DrawHead[Item.headSlot] = false; } diff --git a/Items/Armor/Vanity/PolterghastMask.cs b/Items/Armor/Vanity/PolterghastMask.cs index e0b4a533ff..2c6fdea8c3 100644 --- a/Items/Armor/Vanity/PolterghastMask.cs +++ b/Items/Armor/Vanity/PolterghastMask.cs @@ -11,7 +11,7 @@ namespace CalamityMod.Items.Armor.Vanity public override void SetStaticDefaults() { - if (Main.netMode != NetmodeID.Server) + if (!Main.dedServ) ArmorIDs.Head.Sets.DrawHead[Item.headSlot] = false; } diff --git a/Items/Armor/Vanity/ProfanedGuardianMask.cs b/Items/Armor/Vanity/ProfanedGuardianMask.cs index 02e6f1d34c..2f5efd9e07 100644 --- a/Items/Armor/Vanity/ProfanedGuardianMask.cs +++ b/Items/Armor/Vanity/ProfanedGuardianMask.cs @@ -11,7 +11,7 @@ namespace CalamityMod.Items.Armor.Vanity public override void SetStaticDefaults() { - if (Main.netMode != NetmodeID.Server) + if (!Main.dedServ) ArmorIDs.Head.Sets.DrawHead[Item.headSlot] = false; } diff --git a/Items/Armor/Vanity/ProvidenceMask.cs b/Items/Armor/Vanity/ProvidenceMask.cs index 289def74b9..4167a58cc0 100644 --- a/Items/Armor/Vanity/ProvidenceMask.cs +++ b/Items/Armor/Vanity/ProvidenceMask.cs @@ -11,7 +11,7 @@ namespace CalamityMod.Items.Armor.Vanity public override void SetStaticDefaults() { - if (Main.netMode != NetmodeID.Server) + if (!Main.dedServ) ArmorIDs.Head.Sets.DrawHead[Item.headSlot] = false; } diff --git a/Items/Armor/Vanity/RavagerMask.cs b/Items/Armor/Vanity/RavagerMask.cs index 6e7c7352a2..0aa28dcd63 100644 --- a/Items/Armor/Vanity/RavagerMask.cs +++ b/Items/Armor/Vanity/RavagerMask.cs @@ -11,7 +11,7 @@ namespace CalamityMod.Items.Armor.Vanity public override void SetStaticDefaults() { - if (Main.netMode != NetmodeID.Server) + if (!Main.dedServ) ArmorIDs.Head.Sets.DrawHead[Item.headSlot] = false; } diff --git a/Items/Armor/Vanity/RobesOfCalamity.cs b/Items/Armor/Vanity/RobesOfCalamity.cs index dad5b38905..cf7c73c7c3 100644 --- a/Items/Armor/Vanity/RobesOfCalamity.cs +++ b/Items/Armor/Vanity/RobesOfCalamity.cs @@ -11,7 +11,7 @@ namespace CalamityMod.Items.Armor.Vanity public new string LocalizationCategory => "Items.Armor.Vanity"; public override void Load() { - if (Main.netMode != NetmodeID.Server) + if (!Main.dedServ) { EquipLoader.AddEquipTexture(Mod, "CalamityMod/Items/Armor/Vanity/RobesOfCalamity_Legs", EquipType.Legs, this); } diff --git a/Items/Armor/Vanity/SCalMask.cs b/Items/Armor/Vanity/SCalMask.cs index a83226b508..543959bb77 100644 --- a/Items/Armor/Vanity/SCalMask.cs +++ b/Items/Armor/Vanity/SCalMask.cs @@ -11,7 +11,7 @@ namespace CalamityMod.Items.Armor.Vanity public override void SetStaticDefaults() { - if (Main.netMode != NetmodeID.Server) + if (!Main.dedServ) ArmorIDs.Head.Sets.DrawHead[Item.headSlot] = false; } diff --git a/Items/Armor/Vanity/SCalRobes.cs b/Items/Armor/Vanity/SCalRobes.cs index fb1ccb4200..957153739f 100644 --- a/Items/Armor/Vanity/SCalRobes.cs +++ b/Items/Armor/Vanity/SCalRobes.cs @@ -11,7 +11,7 @@ namespace CalamityMod.Items.Armor.Vanity public override void SetStaticDefaults() { - if (Main.netMode != NetmodeID.Server) + if (!Main.dedServ) { var equipSlot = EquipLoader.GetEquipSlot(Mod, Name, EquipType.Body); ArmorIDs.Body.Sets.HidesArms[equipSlot] = true; diff --git a/Items/Armor/Vanity/SignusMask.cs b/Items/Armor/Vanity/SignusMask.cs index 6936aac06e..c67217c8e1 100644 --- a/Items/Armor/Vanity/SignusMask.cs +++ b/Items/Armor/Vanity/SignusMask.cs @@ -11,7 +11,7 @@ namespace CalamityMod.Items.Armor.Vanity public override void SetStaticDefaults() { - if (Main.netMode != NetmodeID.Server) + if (!Main.dedServ) ArmorIDs.Head.Sets.DrawHead[Item.headSlot] = false; } diff --git a/Items/Armor/Vanity/SlimeGodMask.cs b/Items/Armor/Vanity/SlimeGodMask.cs index 163b2e0864..2c9504bf3e 100644 --- a/Items/Armor/Vanity/SlimeGodMask.cs +++ b/Items/Armor/Vanity/SlimeGodMask.cs @@ -11,7 +11,7 @@ namespace CalamityMod.Items.Armor.Vanity public override void SetStaticDefaults() { - if (Main.netMode != NetmodeID.Server) + if (!Main.dedServ) ArmorIDs.Head.Sets.DrawHead[Item.headSlot] = false; } diff --git a/Items/Armor/Vanity/SlimeGodMask2.cs b/Items/Armor/Vanity/SlimeGodMask2.cs index 1c773f2cb4..3a4cbc553c 100644 --- a/Items/Armor/Vanity/SlimeGodMask2.cs +++ b/Items/Armor/Vanity/SlimeGodMask2.cs @@ -11,7 +11,7 @@ namespace CalamityMod.Items.Armor.Vanity public override void SetStaticDefaults() { - if (Main.netMode != NetmodeID.Server) + if (!Main.dedServ) ArmorIDs.Head.Sets.DrawHead[Item.headSlot] = false; } diff --git a/Items/Armor/Vanity/StormWeaverMask.cs b/Items/Armor/Vanity/StormWeaverMask.cs index c588118a60..d32c21b1d6 100644 --- a/Items/Armor/Vanity/StormWeaverMask.cs +++ b/Items/Armor/Vanity/StormWeaverMask.cs @@ -11,7 +11,7 @@ namespace CalamityMod.Items.Armor.Vanity public override void SetStaticDefaults() { - if (Main.netMode != NetmodeID.Server) + if (!Main.dedServ) ArmorIDs.Head.Sets.DrawHead[Item.headSlot] = false; } diff --git a/Items/Armor/Vanity/TheCommandersCap.cs b/Items/Armor/Vanity/TheCommandersCap.cs index 5752abcbe9..5340bc723e 100644 --- a/Items/Armor/Vanity/TheCommandersCap.cs +++ b/Items/Armor/Vanity/TheCommandersCap.cs @@ -15,7 +15,7 @@ namespace CalamityMod.Items.Armor.Vanity public override void SetStaticDefaults() { - if (Main.netMode != NetmodeID.Server) + if (!Main.dedServ) ArmorIDs.Head.Sets.DrawFullHair[Item.headSlot] = false; } diff --git a/Items/Armor/Vanity/TheGrandGarment.cs b/Items/Armor/Vanity/TheGrandGarment.cs index 1f2e4f4980..1f8758e0fc 100644 --- a/Items/Armor/Vanity/TheGrandGarment.cs +++ b/Items/Armor/Vanity/TheGrandGarment.cs @@ -10,7 +10,7 @@ namespace CalamityMod.Items.Armor.Vanity public new string LocalizationCategory => "Items.Armor.Vanity"; public override void Load() { - if (Main.netMode != NetmodeID.Server) + if (!Main.dedServ) { EquipLoader.AddEquipTexture(Mod, "CalamityMod/Items/Armor/Vanity/TheGrandGarment_Waist", EquipType.Waist, this); } diff --git a/Items/Armor/Vanity/YharonMask.cs b/Items/Armor/Vanity/YharonMask.cs index 2a68372be7..8e4beefe10 100644 --- a/Items/Armor/Vanity/YharonMask.cs +++ b/Items/Armor/Vanity/YharonMask.cs @@ -11,7 +11,7 @@ namespace CalamityMod.Items.Armor.Vanity public override void SetStaticDefaults() { - if (Main.netMode != NetmodeID.Server) + if (!Main.dedServ) ArmorIDs.Head.Sets.DrawHead[Item.headSlot] = false; } diff --git a/Items/Armor/Victide/VictideBreastplate.cs b/Items/Armor/Victide/VictideBreastplate.cs index f8e6c751c8..43e1c6649b 100644 --- a/Items/Armor/Victide/VictideBreastplate.cs +++ b/Items/Armor/Victide/VictideBreastplate.cs @@ -13,7 +13,7 @@ namespace CalamityMod.Items.Armor.Victide public override void Load() { - if (Main.netMode != NetmodeID.Server) + if (!Main.dedServ) { //register the faulds texture. This appears either when the leggings or the chestplate is equipped (both works) EquipLoader.AddEquipTexture(Mod, "CalamityMod/Items/Armor/Victide/VictideFaulds_Waist", EquipType.Waist, name: "VictideFaulds"); @@ -23,7 +23,7 @@ namespace CalamityMod.Items.Armor.Victide public override void SetStaticDefaults() { - if (Main.netMode != NetmodeID.Server) + if (!Main.dedServ) { var equipSlot = EquipLoader.GetEquipSlot(Mod, Name, EquipType.Body); ArmorIDs.Body.Sets.HidesArms[equipSlot] = true; diff --git a/Items/Armor/Victide/VictideGreaves.cs b/Items/Armor/Victide/VictideGreaves.cs index a9a702b35b..6e96d6af32 100644 --- a/Items/Armor/Victide/VictideGreaves.cs +++ b/Items/Armor/Victide/VictideGreaves.cs @@ -13,7 +13,7 @@ namespace CalamityMod.Items.Armor.Victide public override void SetStaticDefaults() { - if (Main.netMode != NetmodeID.Server) + if (!Main.dedServ) { var equipSlot = EquipLoader.GetEquipSlot(Mod, Name, EquipType.Legs); ArmorIDs.Legs.Sets.HidesBottomSkin[equipSlot] = true; diff --git a/Items/Armor/Wulfrum/WulfrumSet.cs b/Items/Armor/Wulfrum/WulfrumSet.cs index 0ed6f4412c..69987f14d2 100644 --- a/Items/Armor/Wulfrum/WulfrumSet.cs +++ b/Items/Armor/Wulfrum/WulfrumSet.cs @@ -53,7 +53,7 @@ namespace CalamityMod.Items.Armor.Wulfrum public override void Load() { - if (Main.netMode != NetmodeID.Server) + if (!Main.dedServ) { EquipLoader.AddEquipTexture(Mod, "CalamityMod/Items/Armor/Wulfrum/WulfrumHat_FemaleHead", EquipType.Head, name: "WulfrumHatFemale"); } @@ -274,7 +274,7 @@ namespace CalamityMod.Items.Armor.Wulfrum public new string LocalizationCategory => "Items.Armor.PreHardmode"; public override void SetStaticDefaults() { - if (Main.netMode != NetmodeID.Server) + if (!Main.dedServ) { var equipSlot = EquipLoader.GetEquipSlot(Mod, Name, EquipType.Body); ArmorIDs.Body.Sets.HidesArms[equipSlot] = true; @@ -318,7 +318,7 @@ namespace CalamityMod.Items.Armor.Wulfrum Item.rare = ItemRarityID.Blue; Item.defense = 1; - if (Main.netMode != NetmodeID.Server) + if (!Main.dedServ) { var equipSlot = EquipLoader.GetEquipSlot(Mod, Name, EquipType.Legs); ArmorIDs.Legs.Sets.HidesBottomSkin[equipSlot] = true; @@ -361,7 +361,7 @@ namespace CalamityMod.Items.Armor.Wulfrum public override void Kill(double damage, int hitDirection, bool pvp, PlayerDeathReason damageSource) { - if (WulfrumHat.PowerModeEngaged(Player, out var cd) && Main.netMode != NetmodeID.Server) + if (WulfrumHat.PowerModeEngaged(Player, out var cd) && !Main.dedServ) { SetBonusEndEffect(true); if (!Player.GetModPlayer().vanityEquipped) @@ -385,7 +385,7 @@ namespace CalamityMod.Items.Armor.Wulfrum if (cd.timeLeft < WulfrumHat.BastionCooldown) { cd.timeLeft = WulfrumHat.BastionCooldown - 1; - if (Main.netMode != NetmodeID.Server) + if (!Main.dedServ) SetBonusEndEffect(true); } } diff --git a/Items/Mounts/AlicornMount.cs b/Items/Mounts/AlicornMount.cs index 359e74d374..fbb5893ba4 100644 --- a/Items/Mounts/AlicornMount.cs +++ b/Items/Mounts/AlicornMount.cs @@ -63,7 +63,7 @@ namespace CalamityMod.Items.Mounts MountData.swimFrameCount = MountData.inAirFrameCount; MountData.swimFrameDelay = MountData.inAirFrameDelay; MountData.swimFrameStart = MountData.inAirFrameStart; - if (Main.netMode != NetmodeID.Server) + if (!Main.dedServ) { MountData.frontTextureExtra = ModContent.Request("CalamityMod/Items/Mounts/AlicornMountExtra"); MountData.textureWidth = MountData.backTexture.Width(); diff --git a/Items/Mounts/BUMBLEDOGE.cs b/Items/Mounts/BUMBLEDOGE.cs index e3cd53a261..1cbc9c4b3d 100644 --- a/Items/Mounts/BUMBLEDOGE.cs +++ b/Items/Mounts/BUMBLEDOGE.cs @@ -62,7 +62,7 @@ namespace CalamityMod.Items.Mounts MountData.dashingFrameCount = MountData.flyingFrameCount; MountData.dashingFrameDelay = 5; MountData.dashingFrameStart = MountData.flyingFrameStart; - if (Main.netMode != NetmodeID.Server) + if (!Main.dedServ) { MountData.textureWidth = MountData.backTexture.Width(); MountData.textureHeight = MountData.backTexture.Height(); diff --git a/Items/Mounts/Crysthamyr.cs b/Items/Mounts/Crysthamyr.cs index e050a1a7ed..0397aba337 100644 --- a/Items/Mounts/Crysthamyr.cs +++ b/Items/Mounts/Crysthamyr.cs @@ -69,7 +69,7 @@ namespace CalamityMod.Items.Mounts MountData.swimFrameCount = MountData.inAirFrameCount; MountData.swimFrameDelay = MountData.runningFrameDelay; MountData.swimFrameStart = MountData.inAirFrameStart; - if (Main.netMode != NetmodeID.Server) + if (!Main.dedServ) { MountData.frontTextureExtra = ModContent.Request("CalamityMod/Items/Mounts/CrysthamyrExtra"); MountData.textureWidth = MountData.backTexture.Width(); diff --git a/Items/Mounts/DraedonGamerChairMount.cs b/Items/Mounts/DraedonGamerChairMount.cs index a0576fa082..adc03e7738 100644 --- a/Items/Mounts/DraedonGamerChairMount.cs +++ b/Items/Mounts/DraedonGamerChairMount.cs @@ -63,7 +63,7 @@ namespace CalamityMod.Items.Mounts MountData.swimFrameCount = 5; MountData.swimFrameDelay = 5; MountData.swimFrameStart = 0; - if (Main.netMode != NetmodeID.Server) + if (!Main.dedServ) { MountData.frontTextureGlow = ModContent.Request("CalamityMod/Items/Mounts/DraedonGamerChairMount_Glowmask"); MountData.textureWidth = MountData.frontTexture.Width(); diff --git a/Items/Mounts/ExoTank.cs b/Items/Mounts/ExoTank.cs index 59b2dad384..94d45b6660 100644 --- a/Items/Mounts/ExoTank.cs +++ b/Items/Mounts/ExoTank.cs @@ -96,7 +96,7 @@ namespace CalamityMod.Items.Mounts MountData.swimFrameCount = MountData.inAirFrameCount; MountData.swimFrameDelay = MountData.inAirFrameDelay; MountData.swimFrameStart = MountData.inAirFrameStart; - if (Main.netMode != NetmodeID.Server) + if (!Main.dedServ) { // back (back layer) -> backExtra (gun) -> front (launcher) -> frontExtra (front layer) MountData.backTextureExtra = ModContent.Request("CalamityMod/Items/Mounts/ExoTank_BackGun"); diff --git a/Items/Mounts/Minecarts/DoGCartMount.cs b/Items/Mounts/Minecarts/DoGCartMount.cs index f5750c48d5..3132669334 100644 --- a/Items/Mounts/Minecarts/DoGCartMount.cs +++ b/Items/Mounts/Minecarts/DoGCartMount.cs @@ -33,7 +33,7 @@ namespace CalamityMod.Items.Mounts.Minecarts MountData.runSpeed = 22f; MountData.acceleration = 0.16f; - if (Main.netMode != NetmodeID.Server) + if (!Main.dedServ) { MountData.textureWidth = 74; MountData.textureHeight = 114; diff --git a/Items/Mounts/OnyxExcavator.cs b/Items/Mounts/OnyxExcavator.cs index 4a9ba4a65d..402c49a00d 100644 --- a/Items/Mounts/OnyxExcavator.cs +++ b/Items/Mounts/OnyxExcavator.cs @@ -60,7 +60,7 @@ namespace CalamityMod.Items.Mounts MountData.swimFrameCount = MountData.inAirFrameCount; MountData.swimFrameDelay = MountData.inAirFrameDelay; MountData.swimFrameStart = MountData.inAirFrameStart; - if (Main.netMode != NetmodeID.Server) + if (!Main.dedServ) { MountData.backTextureExtra = ModContent.Request("CalamityMod/Items/Mounts/OnyxExcavatorExtra"); MountData.frontTextureExtra = ModContent.Request("CalamityMod/Items/Mounts/OnyxExcavatorExtra2"); diff --git a/Items/Mounts/PhuppersChair.cs b/Items/Mounts/PhuppersChair.cs index b6addb58a1..ba514b1f01 100644 --- a/Items/Mounts/PhuppersChair.cs +++ b/Items/Mounts/PhuppersChair.cs @@ -58,7 +58,7 @@ namespace CalamityMod.Items.Mounts MountData.swimFrameCount = 4; MountData.swimFrameDelay = 4; MountData.swimFrameStart = 0; - if (Main.netMode != NetmodeID.Server) + if (!Main.dedServ) { MountData.textureWidth = MountData.backTexture.Width(); MountData.textureHeight = MountData.backTexture.Height(); diff --git a/Items/Mounts/RimehoundMount.cs b/Items/Mounts/RimehoundMount.cs index 87a2c63868..91459cf03f 100644 --- a/Items/Mounts/RimehoundMount.cs +++ b/Items/Mounts/RimehoundMount.cs @@ -58,7 +58,7 @@ namespace CalamityMod.Items.Mounts MountData.swimFrameCount = MountData.inAirFrameCount; MountData.swimFrameDelay = MountData.inAirFrameDelay; MountData.swimFrameStart = MountData.inAirFrameStart; - if (Main.netMode != NetmodeID.Server) + if (!Main.dedServ) { MountData.textureWidth = MountData.backTexture.Width(); MountData.textureHeight = MountData.backTexture.Height(); diff --git a/Items/Mounts/SquishyBean.cs b/Items/Mounts/SquishyBean.cs index fd7088ef8d..f7b1b676ee 100644 --- a/Items/Mounts/SquishyBean.cs +++ b/Items/Mounts/SquishyBean.cs @@ -71,7 +71,7 @@ namespace CalamityMod.Items.Mounts MountData.swimFrameCount = MountData.inAirFrameCount; MountData.swimFrameDelay = MountData.inAirFrameDelay; MountData.swimFrameStart = MountData.inAirFrameStart; - if (Main.netMode != NetmodeID.Server) + if (!Main.dedServ) { MountData.textureWidth = MountData.backTexture.Width(); MountData.textureHeight = MountData.backTexture.Height(); diff --git a/Items/SummonItems/EyeofDesolation.cs b/Items/SummonItems/EyeofDesolation.cs index 9471bf4ee2..8168d6aae7 100644 --- a/Items/SummonItems/EyeofDesolation.cs +++ b/Items/SummonItems/EyeofDesolation.cs @@ -79,7 +79,7 @@ namespace CalamityMod.Items.SummonItems Main.tile[i + xoffset, j + yoffset].TileType = (ushort)ModContent.TileType(); Main.tile[i + xoffset, j + yoffset].Get().HasTile = true; } - if (Main.netMode == NetmodeID.Server) + if (Main.dedServ) { NetMessage.SendTileSquare(-1, i + xoffset, j + yoffset, 1, TileChangeType.None); } diff --git a/Items/SuperDummy.cs b/Items/SuperDummy.cs index b2ba5a8b1c..415c44514a 100644 --- a/Items/SuperDummy.cs +++ b/Items/SuperDummy.cs @@ -33,7 +33,7 @@ namespace CalamityMod.Items npc.life = 0; npc.active = false; - if (Main.netMode == NetmodeID.Server) + if (Main.dedServ) NetMessage.SendData(MessageID.SyncNPC, -1, -1, null, npc.whoAmI); } } diff --git a/Items/Tools/SeismicHampick.cs b/Items/Tools/SeismicHampick.cs index bd4f680f0b..626b208649 100644 --- a/Items/Tools/SeismicHampick.cs +++ b/Items/Tools/SeismicHampick.cs @@ -73,7 +73,7 @@ namespace CalamityMod.Items.Tools { Dust.NewDust(new Vector2(hitbox.X, hitbox.Y), hitbox.Width, hitbox.Height, Main.rand.NextBool(3) ? 16 : 127); } - if (Main.rand.NextBool(5) && Main.netMode != NetmodeID.Server) + if (Main.rand.NextBool(5) && !Main.dedServ) { int smoke = Gore.NewGore(player.GetSource_ItemUse(Item), new Vector2(hitbox.X, hitbox.Y), default, Main.rand.Next(375, 378), 0.75f); Main.gore[smoke].behindTiles = true; diff --git a/Items/Tools/TectonicTruncator.cs b/Items/Tools/TectonicTruncator.cs index 3f022a6ab5..8e56a87c84 100644 --- a/Items/Tools/TectonicTruncator.cs +++ b/Items/Tools/TectonicTruncator.cs @@ -44,7 +44,7 @@ namespace CalamityMod.Items.Tools { Dust.NewDust(new Vector2(hitbox.X, hitbox.Y), hitbox.Width, hitbox.Height, Main.rand.NextBool(3) ? 16 : 127); } - if (Main.rand.NextBool(5) && Main.netMode != NetmodeID.Server) + if (Main.rand.NextBool(5) && !Main.dedServ) { int smoke = Gore.NewGore(player.GetSource_ItemUse(Item), new Vector2(hitbox.X, hitbox.Y), default, Main.rand.Next(375, 378), 0.75f); Main.gore[smoke].behindTiles = true; diff --git a/Items/Tools/WulfrumTreasurePinger.cs b/Items/Tools/WulfrumTreasurePinger.cs index dad1667256..165d179cd3 100644 --- a/Items/Tools/WulfrumTreasurePinger.cs +++ b/Items/Tools/WulfrumTreasurePinger.cs @@ -102,7 +102,7 @@ namespace CalamityMod.Items.Tools GeneralParticleHandler.SpawnParticle(smoke); } - if (Main.netMode != NetmodeID.Server) + if (!Main.dedServ) { for (int i = 0; i < shrapnelCount; i++) { diff --git a/Items/Weapons/Melee/HellfireFlamberge.cs b/Items/Weapons/Melee/HellfireFlamberge.cs index 0cefd12175..089e30c529 100644 --- a/Items/Weapons/Melee/HellfireFlamberge.cs +++ b/Items/Weapons/Melee/HellfireFlamberge.cs @@ -63,7 +63,7 @@ namespace CalamityMod.Items.Weapons.Melee { Dust.NewDust(new Vector2(hitbox.X, hitbox.Y), hitbox.Width, hitbox.Height, Main.rand.NextBool(3) ? 16 : 174); } - if (Main.rand.NextBool(5) && Main.netMode != NetmodeID.Server) + if (Main.rand.NextBool(5) && !Main.dedServ) { int smoke = Gore.NewGore(player.GetSource_ItemUse(Item), new Vector2(hitbox.X, hitbox.Y), default, Main.rand.Next(375, 378), 0.75f); Main.gore[smoke].behindTiles = true; diff --git a/Items/Weapons/Ranged/Animosity.cs b/Items/Weapons/Ranged/Animosity.cs index 12c48f1fc6..bdbf686074 100644 --- a/Items/Weapons/Ranged/Animosity.cs +++ b/Items/Weapons/Ranged/Animosity.cs @@ -177,7 +177,7 @@ namespace CalamityMod.Items.Weapons.Ranged } } //shell - if (Main.netMode != NetmodeID.Server) + if (!Main.dedServ) { string goreType = Main.rand.NextBool() ? "EmptyAnimosityShell" : "EmptyAnimosityShell2"; Gore.NewGore(source, position, velocity.RotatedBy(2f * -player.direction) * Main.rand.NextFloat(0.6f, 0.7f), Mod.Find(goreType).Type); diff --git a/Items/Weapons/Summon/AresExoskeleton.cs b/Items/Weapons/Summon/AresExoskeleton.cs index ebf42d1ca9..5b822be2c0 100644 --- a/Items/Weapons/Summon/AresExoskeleton.cs +++ b/Items/Weapons/Summon/AresExoskeleton.cs @@ -62,7 +62,7 @@ namespace CalamityMod.Items.Weapons.Summon public override void Load() { // Add the body equip texture. - if (Main.netMode != NetmodeID.Server) + if (!Main.dedServ) EquipLoader.AddEquipTexture(Mod, $"{Texture}_{EquipType.Body}", EquipType.Body, this); } diff --git a/Items/Weapons/Summon/FlamsteedRing.cs b/Items/Weapons/Summon/FlamsteedRing.cs index cf87cff493..9f7230b417 100644 --- a/Items/Weapons/Summon/FlamsteedRing.cs +++ b/Items/Weapons/Summon/FlamsteedRing.cs @@ -29,7 +29,7 @@ namespace CalamityMod.Items.Weapons.Summon public override void Load() { - if (Main.netMode != NetmodeID.Server) + if (!Main.dedServ) { EquipLoader.AddEquipTexture(Mod, "CalamityMod/CalPlayer/DrawLayers/AndromedaWithout_Head", EquipType.Head, name: "HeadlessEquipTexture"); } @@ -39,7 +39,7 @@ namespace CalamityMod.Items.Weapons.Summon public override void SetStaticDefaults() { - if (Main.netMode != NetmodeID.Server) + if (!Main.dedServ) { int equipSlotHead = EquipLoader.GetEquipSlot(Mod, "HeadlessEquipTexture", EquipType.Head); ArmorIDs.Head.Sets.DrawHead[equipSlotHead] = false; diff --git a/ModSupport/WeakReferenceSupport.cs b/ModSupport/WeakReferenceSupport.cs index 1303b6d872..bb4cbf380c 100644 --- a/ModSupport/WeakReferenceSupport.cs +++ b/ModSupport/WeakReferenceSupport.cs @@ -257,7 +257,7 @@ namespace CalamityMod private static void WikiThisSupport() { // Wikithis is a clientside mod - if (Main.netMode == NetmodeID.Server) + if (Main.dedServ) return; CalamityMod calamity = GetInstance(); diff --git a/NPCs/Abyss/Bloatfish.cs b/NPCs/Abyss/Bloatfish.cs index 7b49fa7201..002ff2ebce 100644 --- a/NPCs/Abyss/Bloatfish.cs +++ b/NPCs/Abyss/Bloatfish.cs @@ -211,7 +211,7 @@ namespace CalamityMod.NPCs.Abyss { Dust.NewDust(NPC.position, NPC.width, NPC.height, DustID.Blood, hit.HitDirection, -1f, 0, default, 1f); } - if (Main.netMode != NetmodeID.Server) + if (!Main.dedServ) { Gore.NewGore(NPC.GetSource_Death(), NPC.position, NPC.velocity, Mod.Find("Bloatfish").Type, NPC.scale); Gore.NewGore(NPC.GetSource_Death(), NPC.position, NPC.velocity, Mod.Find("Bloatfish2").Type, NPC.scale); diff --git a/NPCs/Abyss/BobbitWormHead.cs b/NPCs/Abyss/BobbitWormHead.cs index 7d28b94911..d60cbe1b33 100644 --- a/NPCs/Abyss/BobbitWormHead.cs +++ b/NPCs/Abyss/BobbitWormHead.cs @@ -278,7 +278,7 @@ namespace CalamityMod.NPCs.Abyss { Dust.NewDust(NPC.position, NPC.width, NPC.height, DustID.Blood, hit.HitDirection, -1f, 0, default, 1f); } - if (Main.netMode != NetmodeID.Server) + if (!Main.dedServ) { Gore.NewGore(NPC.GetSource_Death(), NPC.position, NPC.velocity, Mod.Find("BobbitWorm").Type, 1f); Gore.NewGore(NPC.GetSource_Death(), NPC.position, NPC.velocity, Mod.Find("BobbitWorm2").Type, 1f); diff --git a/NPCs/Abyss/ColossalSquid.cs b/NPCs/Abyss/ColossalSquid.cs index 569955cea9..77b717aaf5 100644 --- a/NPCs/Abyss/ColossalSquid.cs +++ b/NPCs/Abyss/ColossalSquid.cs @@ -650,7 +650,7 @@ namespace CalamityMod.NPCs.Abyss { Dust.NewDust(NPC.position, NPC.width, NPC.height, DustID.Blood, hit.HitDirection, -1f, 0, default, 1f); } - if (Main.netMode != NetmodeID.Server) + if (!Main.dedServ) { Gore.NewGore(NPC.GetSource_Death(), NPC.position, NPC.velocity, Mod.Find("ColossalSquid").Type, NPC.scale); Gore.NewGore(NPC.GetSource_Death(), NPC.position, NPC.velocity, Mod.Find("ColossalSquid2").Type, NPC.scale); diff --git a/NPCs/Abyss/Cuttlefish.cs b/NPCs/Abyss/Cuttlefish.cs index 62edc486a5..8e5716a636 100644 --- a/NPCs/Abyss/Cuttlefish.cs +++ b/NPCs/Abyss/Cuttlefish.cs @@ -394,7 +394,7 @@ namespace CalamityMod.NPCs.Abyss { Dust.NewDust(NPC.position, NPC.width, NPC.height, DustID.Blood, hit.HitDirection, -1f, 0, default, 1f); } - if (Main.netMode != NetmodeID.Server) + if (!Main.dedServ) { Gore.NewGore(NPC.GetSource_Death(), NPC.position, NPC.velocity, Mod.Find("Cuttlefish").Type, 1f); Gore.NewGore(NPC.GetSource_Death(), NPC.position, NPC.velocity, Mod.Find("Cuttlefish2").Type, 1f); diff --git a/NPCs/Abyss/DevilFish.cs b/NPCs/Abyss/DevilFish.cs index 86f0a98418..ab478d5acd 100644 --- a/NPCs/Abyss/DevilFish.cs +++ b/NPCs/Abyss/DevilFish.cs @@ -110,7 +110,7 @@ namespace CalamityMod.NPCs.Abyss brokenMask = true; NPC.HitSound = SoundID.NPCHit1; NPC.defense = 15; - if (Main.netMode != NetmodeID.Server) + if (!Main.dedServ) { for (int i = 1; i < 4; i++) { @@ -336,7 +336,7 @@ namespace CalamityMod.NPCs.Abyss { Dust.NewDust(NPC.position, NPC.width, NPC.height, DustID.Blood, hit.HitDirection, -1f, 0, default, 1f); } - if (Main.netMode != NetmodeID.Server) + if (!Main.dedServ) { Gore.NewGore(NPC.GetSource_Death(), NPC.position, NPC.velocity, Mod.Find("Devilfish").Type, 1f); Gore.NewGore(NPC.GetSource_Death(), NPC.position, NPC.velocity, Mod.Find("Devilfish2").Type, 1f); diff --git a/NPCs/Abyss/DevilFishAlt.cs b/NPCs/Abyss/DevilFishAlt.cs index 4c3a37908c..f1be9b6e3a 100644 --- a/NPCs/Abyss/DevilFishAlt.cs +++ b/NPCs/Abyss/DevilFishAlt.cs @@ -92,7 +92,7 @@ namespace CalamityMod.NPCs.Abyss brokenMask = true; NPC.HitSound = SoundID.NPCHit1; NPC.defense = 15; - if (Main.netMode != NetmodeID.Server) + if (!Main.dedServ) { for (int i = 1; i < 4; i++) { @@ -310,7 +310,7 @@ namespace CalamityMod.NPCs.Abyss { Dust.NewDust(NPC.position, NPC.width, NPC.height, DustID.Blood, hit.HitDirection, -1f, 0, default, 1f); } - if (Main.netMode != NetmodeID.Server) + if (!Main.dedServ) { Gore.NewGore(NPC.GetSource_Death(), NPC.position, NPC.velocity, Mod.Find("DevilfishAlt").Type, 1f); Gore.NewGore(NPC.GetSource_Death(), NPC.position, NPC.velocity, Mod.Find("DevilfishAlt2").Type, 1f); diff --git a/NPCs/Abyss/EidolonWyrmBody.cs b/NPCs/Abyss/EidolonWyrmBody.cs index 748681ebdf..02450d05e6 100644 --- a/NPCs/Abyss/EidolonWyrmBody.cs +++ b/NPCs/Abyss/EidolonWyrmBody.cs @@ -161,7 +161,7 @@ namespace CalamityMod.NPCs.Abyss { Dust.NewDust(NPC.position, NPC.width, NPC.height, DustID.TintableDust, hit.HitDirection, -1f, 0, default, 1f); } - if (Main.netMode != NetmodeID.Server) + if (!Main.dedServ) { Gore.NewGore(NPC.GetSource_Death(), NPC.Center, NPC.velocity, Mod.Find("Wyrm2").Type, 1f); } diff --git a/NPCs/Abyss/EidolonWyrmBodyAlt.cs b/NPCs/Abyss/EidolonWyrmBodyAlt.cs index bbbceef33f..bb6bcfa664 100644 --- a/NPCs/Abyss/EidolonWyrmBodyAlt.cs +++ b/NPCs/Abyss/EidolonWyrmBodyAlt.cs @@ -161,7 +161,7 @@ namespace CalamityMod.NPCs.Abyss { Dust.NewDust(NPC.position, NPC.width, NPC.height, DustID.TintableDust, hit.HitDirection, -1f, 0, default, 1f); } - if (Main.netMode != NetmodeID.Server) + if (!Main.dedServ) { Gore.NewGore(NPC.GetSource_Death(), NPC.Center, NPC.velocity, Mod.Find("Wyrm3").Type, 1f); } diff --git a/NPCs/Abyss/EidolonWyrmHead.cs b/NPCs/Abyss/EidolonWyrmHead.cs index 37e26cc9b0..5db9631938 100644 --- a/NPCs/Abyss/EidolonWyrmHead.cs +++ b/NPCs/Abyss/EidolonWyrmHead.cs @@ -493,7 +493,7 @@ namespace CalamityMod.NPCs.Abyss { Dust.NewDust(NPC.position, NPC.width, NPC.height, DustID.TintableDust, hit.HitDirection, -1f, 0, default, 1f); } - if (Main.netMode != NetmodeID.Server) + if (!Main.dedServ) { Gore.NewGore(NPC.GetSource_Death(), NPC.position, NPC.velocity, Mod.Find("Wyrm").Type, 1f); } diff --git a/NPCs/Abyss/EidolonWyrmTail.cs b/NPCs/Abyss/EidolonWyrmTail.cs index 817986fec7..dba229a146 100644 --- a/NPCs/Abyss/EidolonWyrmTail.cs +++ b/NPCs/Abyss/EidolonWyrmTail.cs @@ -161,7 +161,7 @@ namespace CalamityMod.NPCs.Abyss { Dust.NewDust(NPC.position, NPC.width, NPC.height, DustID.TintableDust, hit.HitDirection, -1f, 0, default, 1f); } - if (Main.netMode != NetmodeID.Server) + if (!Main.dedServ) { Gore.NewGore(NPC.GetSource_Death(), NPC.Center, NPC.velocity, Mod.Find("Wyrm4").Type, 1f); } diff --git a/NPCs/Abyss/GiantSquid.cs b/NPCs/Abyss/GiantSquid.cs index 4b4373e7a6..9651d90ae0 100644 --- a/NPCs/Abyss/GiantSquid.cs +++ b/NPCs/Abyss/GiantSquid.cs @@ -271,7 +271,7 @@ namespace CalamityMod.NPCs.Abyss { Dust.NewDust(NPC.position, NPC.width, NPC.height, DustID.Blood, hit.HitDirection, -1f, 0, default, 1f); } - if (Main.netMode != NetmodeID.Server) + if (!Main.dedServ) { Gore.NewGore(NPC.GetSource_Death(), NPC.position, NPC.velocity, Mod.Find("GiantSquid").Type, 1f); Gore.NewGore(NPC.GetSource_Death(), NPC.position, NPC.velocity, Mod.Find("GiantSquid2").Type, 1f); diff --git a/NPCs/Abyss/GulperEelBody.cs b/NPCs/Abyss/GulperEelBody.cs index eacba128be..fffdbe9751 100644 --- a/NPCs/Abyss/GulperEelBody.cs +++ b/NPCs/Abyss/GulperEelBody.cs @@ -173,7 +173,7 @@ namespace CalamityMod.NPCs.Abyss { Dust.NewDust(NPC.position, NPC.width, NPC.height, DustID.Blood, hit.HitDirection, -1f, 0, default, 1f); } - if (Main.netMode != NetmodeID.Server) + if (!Main.dedServ) { Gore.NewGore(NPC.GetSource_Death(), NPC.Center, NPC.velocity, Mod.Find("GulperEel2").Type, 1f); Gore.NewGore(NPC.GetSource_Death(), NPC.Center, NPC.velocity, Mod.Find("GulperEel3").Type, 1f); diff --git a/NPCs/Abyss/GulperEelBodyAlt.cs b/NPCs/Abyss/GulperEelBodyAlt.cs index 6a2b05e6f8..700c7a225a 100644 --- a/NPCs/Abyss/GulperEelBodyAlt.cs +++ b/NPCs/Abyss/GulperEelBodyAlt.cs @@ -173,7 +173,7 @@ namespace CalamityMod.NPCs.Abyss { Dust.NewDust(NPC.position, NPC.width, NPC.height, DustID.Blood, hit.HitDirection, -1f, 0, default, 1f); } - if (Main.netMode != NetmodeID.Server) + if (!Main.dedServ) { Gore.NewGore(NPC.GetSource_Death(), NPC.Center, NPC.velocity, Mod.Find("GulperEel2").Type, 1f); Gore.NewGore(NPC.GetSource_Death(), NPC.Center, NPC.velocity, Mod.Find("GulperEel3").Type, 1f); diff --git a/NPCs/Abyss/GulperEelHead.cs b/NPCs/Abyss/GulperEelHead.cs index 64130aad7f..5c3bad9db5 100644 --- a/NPCs/Abyss/GulperEelHead.cs +++ b/NPCs/Abyss/GulperEelHead.cs @@ -396,7 +396,7 @@ namespace CalamityMod.NPCs.Abyss { Dust.NewDust(NPC.position, NPC.width, NPC.height, DustID.Blood, hit.HitDirection, -1f, 0, default, 1f); } - if (Main.netMode != NetmodeID.Server) + if (!Main.dedServ) { Gore.NewGore(NPC.GetSource_Death(), NPC.position, NPC.velocity, Mod.Find("GulperEel").Type, 1f); } diff --git a/NPCs/Abyss/GulperEelTail.cs b/NPCs/Abyss/GulperEelTail.cs index b2104ecf9f..edd3285342 100644 --- a/NPCs/Abyss/GulperEelTail.cs +++ b/NPCs/Abyss/GulperEelTail.cs @@ -173,7 +173,7 @@ namespace CalamityMod.NPCs.Abyss { Dust.NewDust(NPC.position, NPC.width, NPC.height, DustID.Blood, hit.HitDirection, -1f, 0, default, 1f); } - if (Main.netMode != NetmodeID.Server) + if (!Main.dedServ) { Gore.NewGore(NPC.GetSource_Death(), NPC.Center, NPC.velocity, Mod.Find("GulperEel4").Type, 1f); } diff --git a/NPCs/Abyss/Laserfish.cs b/NPCs/Abyss/Laserfish.cs index 9671f0d830..68f902f3e2 100644 --- a/NPCs/Abyss/Laserfish.cs +++ b/NPCs/Abyss/Laserfish.cs @@ -143,7 +143,7 @@ namespace CalamityMod.NPCs.Abyss { Dust.NewDust(NPC.position, NPC.width, NPC.height, DustID.Blood, hit.HitDirection, -1f, 0, default, 1f); } - if (Main.netMode != NetmodeID.Server) + if (!Main.dedServ) { Gore.NewGore(NPC.GetSource_Death(), NPC.position, NPC.velocity, Mod.Find("Laserfish").Type, 1f); Gore.NewGore(NPC.GetSource_Death(), NPC.position, NPC.velocity, Mod.Find("Laserfish2").Type, 1f); diff --git a/NPCs/Abyss/LuminousCorvina.cs b/NPCs/Abyss/LuminousCorvina.cs index 1ab39f808a..6b95e594c6 100644 --- a/NPCs/Abyss/LuminousCorvina.cs +++ b/NPCs/Abyss/LuminousCorvina.cs @@ -118,7 +118,7 @@ namespace CalamityMod.NPCs.Abyss if (screamTimer == screamLimit) { SoundEngine.PlaySound(ScreamSound, NPC.Center); - if (Main.netMode != NetmodeID.Server) + if (!Main.dedServ) { if (!Main.player[NPC.target].dead && Main.player[NPC.target].active) { @@ -329,7 +329,7 @@ namespace CalamityMod.NPCs.Abyss { Dust.NewDust(NPC.position, NPC.width, NPC.height, DustID.Confetti, hit.HitDirection, -1f, 0, default, 1f); } - if (Main.netMode != NetmodeID.Server) + if (!Main.dedServ) { Gore.NewGore(NPC.GetSource_Death(), NPC.position, NPC.velocity, Mod.Find("LuminousCorvina").Type, 1f); Gore.NewGore(NPC.GetSource_Death(), NPC.position, NPC.velocity, Mod.Find("LuminousCorvina2").Type, 1f); diff --git a/NPCs/Abyss/MorayEel.cs b/NPCs/Abyss/MorayEel.cs index 43324d7bdc..dcbd788354 100644 --- a/NPCs/Abyss/MorayEel.cs +++ b/NPCs/Abyss/MorayEel.cs @@ -132,7 +132,7 @@ namespace CalamityMod.NPCs.Abyss { Dust.NewDust(NPC.position, NPC.width, NPC.height, DustID.Blood, hit.HitDirection, -1f, 0, default, 1f); } - if (Main.netMode != NetmodeID.Server) + if (!Main.dedServ) { Gore.NewGore(NPC.GetSource_Death(), NPC.position, NPC.velocity, Mod.Find("MorayEel").Type, 1f); Gore.NewGore(NPC.GetSource_Death(), NPC.position, NPC.velocity, Mod.Find("MorayEel2").Type, 1f); diff --git a/NPCs/Abyss/OarfishBody.cs b/NPCs/Abyss/OarfishBody.cs index ed149f9b14..b110c6b019 100644 --- a/NPCs/Abyss/OarfishBody.cs +++ b/NPCs/Abyss/OarfishBody.cs @@ -147,7 +147,7 @@ namespace CalamityMod.NPCs.Abyss { Dust.NewDust(NPC.position, NPC.width, NPC.height, DustID.Blood, hit.HitDirection, -1f, 0, default, 1f); } - if (Main.netMode != NetmodeID.Server) + if (!Main.dedServ) Gore.NewGore(NPC.GetSource_Death(), NPC.position, NPC.velocity, Mod.Find("OarfishBody").Type, 1f); } } diff --git a/NPCs/Abyss/OarfishHead.cs b/NPCs/Abyss/OarfishHead.cs index 20a9467a9b..82664b5438 100644 --- a/NPCs/Abyss/OarfishHead.cs +++ b/NPCs/Abyss/OarfishHead.cs @@ -356,7 +356,7 @@ namespace CalamityMod.NPCs.Abyss { Dust.NewDust(NPC.position, NPC.width, NPC.height, DustID.Blood, hit.HitDirection, -1f, 0, default, 1f); } - if (Main.netMode != NetmodeID.Server) + if (!Main.dedServ) Gore.NewGore(NPC.GetSource_Death(), NPC.position, NPC.velocity, Mod.Find("OarfishHead").Type, 1f); } } diff --git a/NPCs/Abyss/OarfishTail.cs b/NPCs/Abyss/OarfishTail.cs index 99b6d6bebf..e18c3657b6 100644 --- a/NPCs/Abyss/OarfishTail.cs +++ b/NPCs/Abyss/OarfishTail.cs @@ -147,7 +147,7 @@ namespace CalamityMod.NPCs.Abyss { Dust.NewDust(NPC.position, NPC.width, NPC.height, DustID.Blood, hit.HitDirection, -1f, 0, default, 1f); } - if (Main.netMode != NetmodeID.Server) + if (!Main.dedServ) Gore.NewGore(NPC.GetSource_Death(), NPC.position, NPC.velocity, Mod.Find("OarfishTail").Type, 1f); } } diff --git a/NPCs/Abyss/SlabCrab.cs b/NPCs/Abyss/SlabCrab.cs index 0dd0003fcd..a595aa9e36 100644 --- a/NPCs/Abyss/SlabCrab.cs +++ b/NPCs/Abyss/SlabCrab.cs @@ -280,7 +280,7 @@ namespace CalamityMod.NPCs.Abyss HopTimer = ai2 == -1 ? 0 : ai2; CalmDownTimer = ai3 == -1 ? 0 : ai3; NPC.netUpdate = true; - if (Main.netMode == NetmodeID.Server) + if (Main.dedServ) NetMessage.SendData(MessageID.SyncNPC, -1, -1, null, NPC.whoAmI); } @@ -453,7 +453,7 @@ namespace CalamityMod.NPCs.Abyss { Dust.NewDust(NPC.position, NPC.width, NPC.height, DustID.Water, hit.HitDirection, -1f, 0, default, 1f); } - if (Main.netMode != NetmodeID.Server) + if (!Main.dedServ) { for (int i = 1; i < 5; i++) { diff --git a/NPCs/Abyss/Viperfish.cs b/NPCs/Abyss/Viperfish.cs index 6eda808819..2fed796aaa 100644 --- a/NPCs/Abyss/Viperfish.cs +++ b/NPCs/Abyss/Viperfish.cs @@ -174,7 +174,7 @@ namespace CalamityMod.NPCs.Abyss { Dust.NewDust(NPC.position, NPC.width, NPC.height, DustID.Blood, hit.HitDirection, -1f, 0, default, 1f); } - if (Main.netMode != NetmodeID.Server) + if (!Main.dedServ) { Gore.NewGore(NPC.GetSource_Death(), NPC.position, NPC.velocity, Mod.Find("ViperFish").Type, 1f); Gore.NewGore(NPC.GetSource_Death(), NPC.position, NPC.velocity, Mod.Find("ViperFish2").Type, 1f); diff --git a/NPCs/AcidRain/AcidEel.cs b/NPCs/AcidRain/AcidEel.cs index 195f3ad3d0..feba4c4c47 100644 --- a/NPCs/AcidRain/AcidEel.cs +++ b/NPCs/AcidRain/AcidEel.cs @@ -257,7 +257,7 @@ namespace CalamityMod.NPCs.AcidRain Dust.NewDust(NPC.position, NPC.width, NPC.height, (int)CalamityDusts.SulphurousSeaAcid, hit.HitDirection, -1f, 0, default, 1f); if (NPC.life <= 0) { - if (Main.netMode != NetmodeID.Server) + if (!Main.dedServ) { Gore.NewGore(NPC.GetSource_Death(), NPC.position, NPC.velocity, Mod.Find("AcidEelGore").Type, NPC.scale); Gore.NewGore(NPC.GetSource_Death(), NPC.position, NPC.velocity, Mod.Find("AcidEelGore2").Type, NPC.scale); diff --git a/NPCs/AcidRain/BabyFlakCrab.cs b/NPCs/AcidRain/BabyFlakCrab.cs index 7c5ee432ec..5fc75e32ee 100644 --- a/NPCs/AcidRain/BabyFlakCrab.cs +++ b/NPCs/AcidRain/BabyFlakCrab.cs @@ -149,7 +149,7 @@ namespace CalamityMod.NPCs.AcidRain { Dust.NewDust(NPC.position, NPC.width, NPC.height, (int)CalamityDusts.SulphurousSeaAcid, hit.HitDirection, -1f, 0, default, 1f); } - if (Main.netMode != NetmodeID.Server) + if (!Main.dedServ) { Gore.NewGore(NPC.GetSource_Death(), NPC.position, NPC.velocity, Mod.Find("BabyFlakCrabGore").Type, 1f); } diff --git a/NPCs/AcidRain/CragmawMire.cs b/NPCs/AcidRain/CragmawMire.cs index 1271b5a888..7cfa43f431 100644 --- a/NPCs/AcidRain/CragmawMire.cs +++ b/NPCs/AcidRain/CragmawMire.cs @@ -121,7 +121,7 @@ namespace CalamityMod.NPCs.AcidRain if (InPhase2 && !HasMadeShellBreakGore) { SoundEngine.PlaySound(SoundID.DD2_ExplosiveTrapExplode, NPC.Center); - if (Main.netMode != NetmodeID.Server) + if (!Main.dedServ) { Gore.NewGore(NPC.GetSource_FromAI(), NPC.position, -Vector2.UnitY.RotatedByRandom(0.4f) * 4f, Mod.Find("CragmawMireP1Gore").Type, NPC.scale); Gore.NewGore(NPC.GetSource_FromAI(), NPC.position, -Vector2.UnitY.RotatedByRandom(0.4f) * 4f, Mod.Find("CragmawMireP1Gore2").Type, NPC.scale); @@ -495,7 +495,7 @@ namespace CalamityMod.NPCs.AcidRain Dust.NewDust(NPC.position, NPC.width, NPC.height, (int)CalamityDusts.SulphurousSeaAcid, hit.HitDirection, -1f, 0, default, 1f); if (NPC.life <= 0) { - if (Main.netMode != NetmodeID.Server) + if (!Main.dedServ) { Gore.NewGore(NPC.GetSource_Death(), NPC.position, -Vector2.UnitY.RotatedByRandom(0.4f) * 4f, Mod.Find("CragmawMireP2Gore").Type, NPC.scale); Gore.NewGore(NPC.GetSource_Death(), NPC.position, -Vector2.UnitY.RotatedByRandom(0.4f) * 4f, Mod.Find("CragmawMireP2Gore2").Type, NPC.scale); diff --git a/NPCs/AcidRain/FlakCrab.cs b/NPCs/AcidRain/FlakCrab.cs index 873132f844..c9505ec7fe 100644 --- a/NPCs/AcidRain/FlakCrab.cs +++ b/NPCs/AcidRain/FlakCrab.cs @@ -226,7 +226,7 @@ namespace CalamityMod.NPCs.AcidRain { Dust.NewDust(NPC.position, NPC.width, NPC.height, (int)CalamityDusts.SulphurousSeaAcid, hit.HitDirection, -1f, 0, default, 1f); } - if (Main.netMode != NetmodeID.Server) + if (!Main.dedServ) { Gore.NewGore(NPC.GetSource_Death(), NPC.position, NPC.velocity, Mod.Find("FlakCrabGore1").Type, 1f); Gore.NewGore(NPC.GetSource_Death(), NPC.position, NPC.velocity, Mod.Find("FlakCrabGore2").Type, 1f); diff --git a/NPCs/AcidRain/GammaSlime.cs b/NPCs/AcidRain/GammaSlime.cs index 9d06ba61bc..a901b64e48 100644 --- a/NPCs/AcidRain/GammaSlime.cs +++ b/NPCs/AcidRain/GammaSlime.cs @@ -197,7 +197,7 @@ namespace CalamityMod.NPCs.AcidRain { for (int k = 0; k < 20; k++) Dust.NewDust(NPC.position, NPC.width, NPC.height, (int)CalamityDusts.SulphurousSeaAcid, hit.HitDirection, -1f, 0, default, 1f); - if (Main.netMode != NetmodeID.Server) + if (!Main.dedServ) { Gore.NewGore(NPC.GetSource_Death(), NPC.position, NPC.velocity, Mod.Find("GammaSlimeGore").Type, NPC.scale); Gore.NewGore(NPC.GetSource_Death(), NPC.position, NPC.velocity, Mod.Find("GammaSlimeGore2").Type, NPC.scale); diff --git a/NPCs/AcidRain/IrradiatedSlime.cs b/NPCs/AcidRain/IrradiatedSlime.cs index dfb1a632f8..4a47bcbc42 100644 --- a/NPCs/AcidRain/IrradiatedSlime.cs +++ b/NPCs/AcidRain/IrradiatedSlime.cs @@ -122,7 +122,7 @@ namespace CalamityMod.NPCs.AcidRain { Dust.NewDust(NPC.position, NPC.width, NPC.height, (int)CalamityDusts.SulphurousSeaAcid, hit.HitDirection, -1f, 0, default, 1f); } - if (Main.netMode != NetmodeID.Server) + if (!Main.dedServ) { Gore.NewGore(NPC.GetSource_Death(), NPC.position, NPC.velocity, Mod.Find("IrradiatedSlime").Type, 1f); Gore.NewGore(NPC.GetSource_Death(), NPC.position, NPC.velocity, Mod.Find("IrradiatedSlime2").Type, 1f); diff --git a/NPCs/AcidRain/Mauler.cs b/NPCs/AcidRain/Mauler.cs index 1f9307fc45..0ab66f14c6 100644 --- a/NPCs/AcidRain/Mauler.cs +++ b/NPCs/AcidRain/Mauler.cs @@ -477,7 +477,7 @@ namespace CalamityMod.NPCs.AcidRain for (int k = 0; k < 30; k++) Dust.NewDust(NPC.position, NPC.width, NPC.height, DustID.Blood, hit.HitDirection, -1f, 0, default, 1f); - if (Main.netMode != NetmodeID.Server) + if (!Main.dedServ) { Gore.NewGore(NPC.GetSource_Death(), NPC.position, NPC.velocity, Mod.Find("Mauler").Type, NPC.scale); for (int i = 2; i <= 5; i++) diff --git a/NPCs/AcidRain/NuclearToad.cs b/NPCs/AcidRain/NuclearToad.cs index 89a6358da2..5f50419754 100644 --- a/NPCs/AcidRain/NuclearToad.cs +++ b/NPCs/AcidRain/NuclearToad.cs @@ -187,7 +187,7 @@ namespace CalamityMod.NPCs.AcidRain if (NPC.life <= 0) { - if (Main.netMode != NetmodeID.Server) + if (!Main.dedServ) { Gore.NewGore(NPC.GetSource_Death(), NPC.position, NPC.velocity, Mod.Find("NuclearToadGore1").Type, NPC.scale); Gore.NewGore(NPC.GetSource_Death(), NPC.position, NPC.velocity, Mod.Find("NuclearToadGore2").Type, NPC.scale); diff --git a/NPCs/AcidRain/Orthocera.cs b/NPCs/AcidRain/Orthocera.cs index 56bd5315f8..ef3fd1d1f3 100644 --- a/NPCs/AcidRain/Orthocera.cs +++ b/NPCs/AcidRain/Orthocera.cs @@ -28,7 +28,7 @@ namespace CalamityMod.NPCs.AcidRain get => NPC.ai[3] == 1f; set { - if (Main.netMode == NetmodeID.Server && value != PerformingJump) + if (Main.dedServ && value != PerformingJump) NPC.netUpdate = true; NPC.ai[3] = value.ToInt(); } @@ -255,7 +255,7 @@ namespace CalamityMod.NPCs.AcidRain Dust.NewDust(NPC.position, NPC.width, NPC.height, (int)CalamityDusts.SulphurousSeaAcid, hit.HitDirection, -1f, 0, default, 1f); if (NPC.life <= 0) { - if (Main.netMode != NetmodeID.Server) + if (!Main.dedServ) { Gore.NewGore(NPC.GetSource_Death(), NPC.position, NPC.velocity, Mod.Find("OrthoceraGore").Type, NPC.scale); Gore.NewGore(NPC.GetSource_Death(), NPC.position, NPC.velocity, Mod.Find("OrthoceraGore2").Type, NPC.scale); diff --git a/NPCs/AcidRain/Radiator.cs b/NPCs/AcidRain/Radiator.cs index 5fa6b6b717..b2968f02eb 100644 --- a/NPCs/AcidRain/Radiator.cs +++ b/NPCs/AcidRain/Radiator.cs @@ -74,7 +74,7 @@ namespace CalamityMod.NPCs.AcidRain { Lighting.AddLight(NPC.Center, 0.3f, 1.5f, 0.3f); - if (Main.netMode != NetmodeID.Server) + if (!Main.dedServ) { int auraSize = 200; //roughly 12 blocks (half the size of Wither Beast aura) Player player = Main.player[Main.myPlayer]; diff --git a/NPCs/AcidRain/Skyfin.cs b/NPCs/AcidRain/Skyfin.cs index 8066f0a2cc..2c95fabde1 100644 --- a/NPCs/AcidRain/Skyfin.cs +++ b/NPCs/AcidRain/Skyfin.cs @@ -191,7 +191,7 @@ namespace CalamityMod.NPCs.AcidRain Dust.NewDust(NPC.position, NPC.width, NPC.height, (int)CalamityDusts.SulphurousSeaAcid, hit.HitDirection, -1f, 0, default, 1f); if (NPC.life <= 0) { - if (Main.netMode != NetmodeID.Server) + if (!Main.dedServ) { Gore.NewGore(NPC.GetSource_Death(), NPC.position, NPC.velocity, Mod.Find("SkyfinGore").Type, NPC.scale); Gore.NewGore(NPC.GetSource_Death(), NPC.position, NPC.velocity, Mod.Find("SkyfinGore2").Type, NPC.scale); diff --git a/NPCs/AcidRain/SulphurousSkater.cs b/NPCs/AcidRain/SulphurousSkater.cs index 333d378eec..1bd7b04ece 100644 --- a/NPCs/AcidRain/SulphurousSkater.cs +++ b/NPCs/AcidRain/SulphurousSkater.cs @@ -248,7 +248,7 @@ namespace CalamityMod.NPCs.AcidRain } if (NPC.life <= 0) { - if (Main.netMode != NetmodeID.Server) + if (!Main.dedServ) { Gore.NewGore(NPC.GetSource_Death(), NPC.position, NPC.velocity, Mod.Find("SulphurousSkaterGore").Type, NPC.scale); Gore.NewGore(NPC.GetSource_Death(), NPC.position, NPC.velocity, Mod.Find("SulphurousSkaterGore2").Type, NPC.scale); diff --git a/NPCs/AcidRain/Trilobite.cs b/NPCs/AcidRain/Trilobite.cs index f6a51dac40..f85ec39507 100644 --- a/NPCs/AcidRain/Trilobite.cs +++ b/NPCs/AcidRain/Trilobite.cs @@ -202,7 +202,7 @@ namespace CalamityMod.NPCs.AcidRain } if (NPC.life <= 0) { - if (Main.netMode != NetmodeID.Server) + if (!Main.dedServ) { Gore.NewGore(NPC.GetSource_Death(), NPC.position, NPC.velocity, Mod.Find("TrilobiteGore").Type, NPC.scale); Gore.NewGore(NPC.GetSource_Death(), NPC.position, NPC.velocity, Mod.Find("TrilobiteGore2").Type, NPC.scale); diff --git a/NPCs/AquaticScourge/AquaticScourgeBody.cs b/NPCs/AquaticScourge/AquaticScourgeBody.cs index 87686af096..fa66f19776 100644 --- a/NPCs/AquaticScourge/AquaticScourgeBody.cs +++ b/NPCs/AquaticScourge/AquaticScourgeBody.cs @@ -153,7 +153,7 @@ namespace CalamityMod.NPCs.AquaticScourge { Dust.NewDust(NPC.position, NPC.width, NPC.height, DustID.Blood, hit.HitDirection, -1f, 0, default, 1f); } - if (Main.netMode != NetmodeID.Server) + if (!Main.dedServ) { Gore.NewGore(NPC.GetSource_Death(), NPC.position, NPC.velocity, Mod.Find("ASBody").Type, NPC.scale); Gore.NewGore(NPC.GetSource_Death(), NPC.position, NPC.velocity, Mod.Find("ASBody2").Type, NPC.scale); diff --git a/NPCs/AquaticScourge/AquaticScourgeBodyAlt.cs b/NPCs/AquaticScourge/AquaticScourgeBodyAlt.cs index d1bf9bc88f..9ef8a4450b 100644 --- a/NPCs/AquaticScourge/AquaticScourgeBodyAlt.cs +++ b/NPCs/AquaticScourge/AquaticScourgeBodyAlt.cs @@ -152,7 +152,7 @@ namespace CalamityMod.NPCs.AquaticScourge { Dust.NewDust(NPC.position, NPC.width, NPC.height, DustID.Blood, hit.HitDirection, -1f, 0, default, 1f); } - if (Main.netMode != NetmodeID.Server) + if (!Main.dedServ) { Gore.NewGore(NPC.GetSource_Death(), NPC.position, NPC.velocity, Mod.Find("ASBodyAlt").Type, NPC.scale); Gore.NewGore(NPC.GetSource_Death(), NPC.position, NPC.velocity, Mod.Find("ASBodyAlt2").Type, NPC.scale); diff --git a/NPCs/AquaticScourge/AquaticScourgeHead.cs b/NPCs/AquaticScourge/AquaticScourgeHead.cs index 40cc144e26..0e0f11b603 100644 --- a/NPCs/AquaticScourge/AquaticScourgeHead.cs +++ b/NPCs/AquaticScourge/AquaticScourgeHead.cs @@ -315,7 +315,7 @@ namespace CalamityMod.NPCs.AquaticScourge for (int k = 0; k < 15; k++) Dust.NewDust(NPC.position, NPC.width, NPC.height, DustID.Blood, hit.HitDirection, -1f, 0, default, 1f); - if (Main.netMode != NetmodeID.Server) + if (!Main.dedServ) { Gore.NewGore(NPC.GetSource_Death(), NPC.position, NPC.velocity, Mod.Find("ASHead").Type, NPC.scale); } diff --git a/NPCs/AquaticScourge/AquaticScourgeTail.cs b/NPCs/AquaticScourge/AquaticScourgeTail.cs index 7d9a757ca1..0c7761be5b 100644 --- a/NPCs/AquaticScourge/AquaticScourgeTail.cs +++ b/NPCs/AquaticScourge/AquaticScourgeTail.cs @@ -152,7 +152,7 @@ namespace CalamityMod.NPCs.AquaticScourge { Dust.NewDust(NPC.position, NPC.width, NPC.height, DustID.Blood, hit.HitDirection, -1f, 0, default, 1f); } - if (Main.netMode != NetmodeID.Server) + if (!Main.dedServ) { Gore.NewGore(NPC.GetSource_Death(), NPC.position, NPC.velocity, Mod.Find("ASTail").Type, NPC.scale); Gore.NewGore(NPC.GetSource_Death(), NPC.position, NPC.velocity, Mod.Find("ASTail2").Type, NPC.scale); diff --git a/NPCs/Astral/AstralProbe.cs b/NPCs/Astral/AstralProbe.cs index 36b0aa784c..faddb06bef 100644 --- a/NPCs/Astral/AstralProbe.cs +++ b/NPCs/Astral/AstralProbe.cs @@ -288,7 +288,7 @@ namespace CalamityMod.NPCs.Astral Main.dust[cosmos].velocity *= 2f; } - if (Main.netMode != NetmodeID.Server) + if (!Main.dedServ) { Vector2 goreSource = NPC.Center; int goreAmt = 3; diff --git a/NPCs/Astral/AstralachneaGround.cs b/NPCs/Astral/AstralachneaGround.cs index 1fb2da6802..dbd069a50d 100644 --- a/NPCs/Astral/AstralachneaGround.cs +++ b/NPCs/Astral/AstralachneaGround.cs @@ -123,7 +123,7 @@ namespace CalamityMod.NPCs.Astral //if dead do gores if (NPC.life <= 0) { - if (Main.netMode != NetmodeID.Server) + if (!Main.dedServ) { for (int i = 0; i < 6; i++) { diff --git a/NPCs/Astral/AstralachneaWall.cs b/NPCs/Astral/AstralachneaWall.cs index 5d7d5d3d00..b4dd27e74b 100644 --- a/NPCs/Astral/AstralachneaWall.cs +++ b/NPCs/Astral/AstralachneaWall.cs @@ -132,7 +132,7 @@ namespace CalamityMod.NPCs.Astral //if dead do gores if (NPC.life <= 0) { - if (Main.netMode != NetmodeID.Server) + if (!Main.dedServ) { for (int i = 0; i < 6; i++) { diff --git a/NPCs/Astral/Atlas.cs b/NPCs/Astral/Atlas.cs index 5036e8b734..435dcc51a2 100644 --- a/NPCs/Astral/Atlas.cs +++ b/NPCs/Astral/Atlas.cs @@ -464,7 +464,7 @@ namespace CalamityMod.NPCs.Astral //if dead do gores if (NPC.life <= 0) { - if (Main.netMode != NetmodeID.Server) + if (!Main.dedServ) { //head Gore.NewGore(NPC.GetSource_Death(), NPC.Top, NPC.velocity * 0.5f, Mod.Find("AtlasGore4").Type); diff --git a/NPCs/Astral/FusionFeeder.cs b/NPCs/Astral/FusionFeeder.cs index 27def2f9a5..818c5c67b4 100644 --- a/NPCs/Astral/FusionFeeder.cs +++ b/NPCs/Astral/FusionFeeder.cs @@ -265,7 +265,7 @@ namespace CalamityMod.NPCs.Astral //if dead do gores if (NPC.life <= 0) { - if (Main.netMode != NetmodeID.Server) + if (!Main.dedServ) { for (int i = 0; i < 6; i++) { diff --git a/NPCs/Astral/Hadarian.cs b/NPCs/Astral/Hadarian.cs index 1d50003cf1..8f004e0ea7 100644 --- a/NPCs/Astral/Hadarian.cs +++ b/NPCs/Astral/Hadarian.cs @@ -190,7 +190,7 @@ namespace CalamityMod.NPCs.Astral //if dead do gores if (NPC.life <= 0) { - if (Main.netMode != NetmodeID.Server) + if (!Main.dedServ) { for (int i = 0; i < 5; i++) { diff --git a/NPCs/Astral/Nova.cs b/NPCs/Astral/Nova.cs index 0f8ba1f673..d14ec0d4dd 100644 --- a/NPCs/Astral/Nova.cs +++ b/NPCs/Astral/Nova.cs @@ -282,7 +282,7 @@ namespace CalamityMod.NPCs.Astral //if dead do gores if (NPC.life <= 0) { - if (Main.netMode != NetmodeID.Server) + if (!Main.dedServ) { for (int i = 0; i < 7; i++) { diff --git a/NPCs/Astral/SightseerCollider.cs b/NPCs/Astral/SightseerCollider.cs index aa5b562749..95120b8a6c 100644 --- a/NPCs/Astral/SightseerCollider.cs +++ b/NPCs/Astral/SightseerCollider.cs @@ -120,7 +120,7 @@ namespace CalamityMod.NPCs.Astral //if dead do gores if (NPC.life <= 0) { - if (Main.netMode != NetmodeID.Server) + if (!Main.dedServ) { for (int i = 0; i < 5; i++) { diff --git a/NPCs/Astral/SightseerSpitter.cs b/NPCs/Astral/SightseerSpitter.cs index 44d62a6bdf..67d8668cfb 100644 --- a/NPCs/Astral/SightseerSpitter.cs +++ b/NPCs/Astral/SightseerSpitter.cs @@ -148,7 +148,7 @@ namespace CalamityMod.NPCs.Astral //if dead do gores if (NPC.life <= 0) { - if (Main.netMode != NetmodeID.Server) + if (!Main.dedServ) { for (int i = 0; i < 5; i++) { diff --git a/NPCs/Astral/StellarCulex.cs b/NPCs/Astral/StellarCulex.cs index ccfc0dcac6..1da35af01f 100644 --- a/NPCs/Astral/StellarCulex.cs +++ b/NPCs/Astral/StellarCulex.cs @@ -99,7 +99,7 @@ namespace CalamityMod.NPCs.Astral //if dead do gores if (NPC.life <= 0) { - if (Main.netMode != NetmodeID.Server) + if (!Main.dedServ) { for (int i = 0; i < 6; i++) { diff --git a/NPCs/AstrumAureus/AstrumAureus.cs b/NPCs/AstrumAureus/AstrumAureus.cs index 3a039663e9..80ca2ae44c 100644 --- a/NPCs/AstrumAureus/AstrumAureus.cs +++ b/NPCs/AstrumAureus/AstrumAureus.cs @@ -490,7 +490,7 @@ namespace CalamityMod.NPCs.AstrumAureus aureusDust2 = Dust.NewDust(NPC.position, NPC.width, NPC.height, ModContent.DustType(), 0f, 0f, 100, default, 2f); Main.dust[aureusDust2].velocity *= 2f; } - if (Main.netMode != NetmodeID.Server) + if (!Main.dedServ) { float randomSpread = Main.rand.Next(-200, 201) / 100f; Gore.NewGore(NPC.GetSource_Death(), NPC.position, NPC.velocity * randomSpread, Mod.Find("Aureus1").Type, 1f); diff --git a/NPCs/AstrumDeus/AstrumDeusBody.cs b/NPCs/AstrumDeus/AstrumDeusBody.cs index c90499907a..48520d3f9e 100644 --- a/NPCs/AstrumDeus/AstrumDeusBody.cs +++ b/NPCs/AstrumDeus/AstrumDeusBody.cs @@ -193,7 +193,7 @@ namespace CalamityMod.NPCs.AstrumDeus astralDust = Dust.NewDust(NPC.position, NPC.width, NPC.height, ModContent.DustType(), 0f, 0f, 100, default, 2f); Main.dust[astralDust].velocity *= 2f; } - if (Main.netMode != NetmodeID.Server) + if (!Main.dedServ) { float randomSpread = Main.rand.Next(-200, 201) / 100f; if (NPC.localAI[3] == 1f) diff --git a/NPCs/AstrumDeus/AstrumDeusHead.cs b/NPCs/AstrumDeus/AstrumDeusHead.cs index d15f166851..e1e14712ef 100644 --- a/NPCs/AstrumDeus/AstrumDeusHead.cs +++ b/NPCs/AstrumDeus/AstrumDeusHead.cs @@ -230,7 +230,7 @@ namespace CalamityMod.NPCs.AstrumDeus astralDust = Dust.NewDust(NPC.position, NPC.width, NPC.height, ModContent.DustType(), 0f, 0f, 100, default, 2f); Main.dust[astralDust].velocity *= 2f; } - if (Main.netMode != NetmodeID.Server) + if (!Main.dedServ) { float randomSpread = Main.rand.Next(-200, 201) / 100f; Gore.NewGore(NPC.GetSource_Death(), NPC.position, NPC.velocity * randomSpread, Mod.Find("AstrumDeusHead1").Type, 1f); diff --git a/NPCs/AstrumDeus/AstrumDeusTail.cs b/NPCs/AstrumDeus/AstrumDeusTail.cs index 1cbb9ac13d..df4cda8149 100644 --- a/NPCs/AstrumDeus/AstrumDeusTail.cs +++ b/NPCs/AstrumDeus/AstrumDeusTail.cs @@ -164,7 +164,7 @@ namespace CalamityMod.NPCs.AstrumDeus astralDust = Dust.NewDust(NPC.position, NPC.width, NPC.height, ModContent.DustType(), 0f, 0f, 100, default, 2f); Main.dust[astralDust].velocity *= 2f; } - if (Main.netMode != NetmodeID.Server) + if (!Main.dedServ) { float randomSpread = Main.rand.Next(-200, 201) / 100f; Gore.NewGore(NPC.GetSource_Death(), NPC.position, NPC.velocity * randomSpread, Mod.Find("AstrumDeusTail1").Type, 1f); diff --git a/NPCs/BrimstoneElemental/BrimstoneElemental.cs b/NPCs/BrimstoneElemental/BrimstoneElemental.cs index 93fc575c92..493114f022 100644 --- a/NPCs/BrimstoneElemental/BrimstoneElemental.cs +++ b/NPCs/BrimstoneElemental/BrimstoneElemental.cs @@ -290,7 +290,7 @@ namespace CalamityMod.NPCs.BrimstoneElemental brimDust2 = Dust.NewDust(NPC.position, NPC.width, NPC.height, (int)CalamityDusts.Brimstone, 0f, 0f, 100, default, 2f); Main.dust[brimDust2].velocity *= 2f; } - if (Main.netMode != NetmodeID.Server) + if (!Main.dedServ) { float randomSpread = Main.rand.Next(-200, 201) / 100f; Gore.NewGore(NPC.GetSource_Death(), NPC.position, NPC.velocity * randomSpread, Mod.Find("BrimstoneGore1").Type, 1f); diff --git a/NPCs/Bumblebirb/Bumblefuck.cs b/NPCs/Bumblebirb/Bumblefuck.cs index 3f0f8faf89..6b934b0360 100644 --- a/NPCs/Bumblebirb/Bumblefuck.cs +++ b/NPCs/Bumblebirb/Bumblefuck.cs @@ -521,7 +521,7 @@ namespace CalamityMod.NPCs.Bumblebirb { Dust.NewDust(NPC.position, NPC.width, NPC.height, DustID.CopperCoin, hit.HitDirection, -1f, 0, default, 1f); } - if (Main.netMode != NetmodeID.Server) + if (!Main.dedServ) { for (int i = 0; i < 6; i++) // 1 head, 1 wing, 4 legs = 6. one wing due to them being chonky boyes now { diff --git a/NPCs/CalClone/CalamitasClone.cs b/NPCs/CalClone/CalamitasClone.cs index 1ae8a7732a..95eeab7720 100644 --- a/NPCs/CalClone/CalamitasClone.cs +++ b/NPCs/CalClone/CalamitasClone.cs @@ -266,7 +266,7 @@ namespace CalamityMod.NPCs.CalClone } if (NPC.life <= 0) { - if (Main.netMode != NetmodeID.Server) + if (!Main.dedServ) { Gore.NewGore(NPC.GetSource_Death(), NPC.position, NPC.velocity, Mod.Find("Calamitas").Type, NPC.scale); Gore.NewGore(NPC.GetSource_Death(), NPC.position, NPC.velocity, Mod.Find("Calamitas2").Type, NPC.scale); diff --git a/NPCs/CalClone/Cataclysm.cs b/NPCs/CalClone/Cataclysm.cs index 405b07e95f..c5b3cbf9c1 100644 --- a/NPCs/CalClone/Cataclysm.cs +++ b/NPCs/CalClone/Cataclysm.cs @@ -193,7 +193,7 @@ namespace CalamityMod.NPCs.CalClone } if (NPC.life <= 0) { - if (Main.netMode != NetmodeID.Server) + if (!Main.dedServ) { Gore.NewGore(NPC.GetSource_Death(), NPC.position, NPC.velocity, Mod.Find("Cataclysm").Type, NPC.scale); Gore.NewGore(NPC.GetSource_Death(), NPC.position, NPC.velocity, Mod.Find("Cataclysm2").Type, NPC.scale); diff --git a/NPCs/CalClone/Catastrophe.cs b/NPCs/CalClone/Catastrophe.cs index 9f2ad19fd1..ee72d7ea16 100644 --- a/NPCs/CalClone/Catastrophe.cs +++ b/NPCs/CalClone/Catastrophe.cs @@ -187,7 +187,7 @@ namespace CalamityMod.NPCs.CalClone } if (NPC.life <= 0) { - if (Main.netMode != NetmodeID.Server) + if (!Main.dedServ) { Gore.NewGore(NPC.GetSource_Death(), NPC.position, NPC.velocity, Mod.Find("Catastrophe").Type, NPC.scale); Gore.NewGore(NPC.GetSource_Death(), NPC.position, NPC.velocity, Mod.Find("Catastrophe2").Type, NPC.scale); diff --git a/NPCs/CalClone/SoulSeeker.cs b/NPCs/CalClone/SoulSeeker.cs index 6915fac89a..d6a78285ce 100644 --- a/NPCs/CalClone/SoulSeeker.cs +++ b/NPCs/CalClone/SoulSeeker.cs @@ -143,7 +143,7 @@ namespace CalamityMod.NPCs.CalClone } if (NPC.life <= 0) { - if (Main.netMode != NetmodeID.Server) + if (!Main.dedServ) { Gore.NewGore(NPC.GetSource_Death(), NPC.position, NPC.velocity, Mod.Find("SoulSeeker").Type, 1f); Gore.NewGore(NPC.GetSource_Death(), NPC.position, NPC.velocity, Mod.Find("SoulSeeker2").Type, 1f); diff --git a/NPCs/CalamityAIs/CalamityBossAIs/AstrumDeusAI.cs b/NPCs/CalamityAIs/CalamityBossAIs/AstrumDeusAI.cs index 8949910384..ed78fd0c8a 100644 --- a/NPCs/CalamityAIs/CalamityBossAIs/AstrumDeusAI.cs +++ b/NPCs/CalamityAIs/CalamityBossAIs/AstrumDeusAI.cs @@ -70,7 +70,7 @@ namespace CalamityMod.NPCs.CalamityAIs.CalamityBossAIs // Inflict Extreme Gravity to nearby players if (revenge) { - if (Main.netMode != NetmodeID.Server) + if (!Main.dedServ) { if (!Main.player[Main.myPlayer].dead && Main.player[Main.myPlayer].active && Vector2.Distance(Main.player[Main.myPlayer].Center, npc.Center) < CalamityGlobalNPC.CatchUpDistance350Tiles) Main.player[Main.myPlayer].AddBuff(ModContent.BuffType(), 2); @@ -219,7 +219,7 @@ namespace CalamityMod.NPCs.CalamityAIs.CalamityBossAIs Main.npc[headOneID].netUpdate = true; // On server, immediately send the correct extra AI of this head to clients. - if (Main.netMode == NetmodeID.Server) + if (Main.dedServ) { SyncCalamityNPCAIArrayPacket.Send(Main.npc[headOneID]); } @@ -235,7 +235,7 @@ namespace CalamityMod.NPCs.CalamityAIs.CalamityBossAIs Main.npc[headTwoID].netUpdate = true; // On server, immediately send the correct extra AI of this head to clients. - if (Main.netMode == NetmodeID.Server) + if (Main.dedServ) { SyncCalamityNPCAIArrayPacket.Send(Main.npc[headTwoID]); } @@ -367,7 +367,7 @@ namespace CalamityMod.NPCs.CalamityAIs.CalamityBossAIs Main.npc[lol].Calamity().newAI[0] = Main.npc[Previous].Calamity().newAI[0]; Main.npc[lol].Calamity().newAI[3] = Main.npc[Previous].Calamity().newAI[3]; - if (Main.netMode == NetmodeID.Server) + if (Main.dedServ) { SyncCalamityNPCAIArrayPacket.Send(Main.npc[lol]); } diff --git a/NPCs/CalamityAIs/CalamityBossAIs/BumblebirbAI.cs b/NPCs/CalamityAIs/CalamityBossAIs/BumblebirbAI.cs index 0882a65f4f..b5112224ae 100644 --- a/NPCs/CalamityAIs/CalamityBossAIs/BumblebirbAI.cs +++ b/NPCs/CalamityAIs/CalamityBossAIs/BumblebirbAI.cs @@ -1064,7 +1064,7 @@ namespace CalamityMod.NPCs.CalamityAIs.CalamityBossAIs npc.velocity *= 1.15f; npc.netSpam = 5; - if (Main.netMode == NetmodeID.Server) + if (Main.dedServ) NetMessage.SendData(MessageID.SyncNPC, -1, -1, null, npc.whoAmI, 0f, 0f, 0f, 0, 0, 0); return; diff --git a/NPCs/CalamityGlobalNPC.cs b/NPCs/CalamityGlobalNPC.cs index b74e52e643..5796d7df1f 100644 --- a/NPCs/CalamityGlobalNPC.cs +++ b/NPCs/CalamityGlobalNPC.cs @@ -3850,7 +3850,7 @@ namespace CalamityMod.NPCs if (KillTime > 0 || npc.type == NPCType()) { // Apply Boss Effects while any boss NPC is active - if (Main.netMode != NetmodeID.Server) + if (!Main.dedServ) { if (!Main.player[Main.myPlayer].dead && Main.player[Main.myPlayer].active && Vector2.Distance(Main.player[Main.myPlayer].Center, npc.Center) < BossZenDistance) Main.player[Main.myPlayer].AddBuff(BuffType(), 2); @@ -5023,7 +5023,7 @@ namespace CalamityMod.NPCs } Lighting.AddLight(npc.Center, dustLerpColor1.ToVector3() * 0.7f); - if (Main.netMode != NetmodeID.Server) + if (!Main.dedServ) { Player localPlayer = Main.LocalPlayer; if (!localPlayer.dead && localPlayer.HitboxForBestiaryNearbyCheck.Intersects(npc.Hitbox)) @@ -6477,7 +6477,7 @@ namespace CalamityMod.NPCs //20% is balanced for non empowered, while 40% helps ensure psc remains balanced at empowered tier //Some PSC projectiles receive a reduced amount of benefit from this, for balancing purposes modifiers.ScalingBonusDamage += (empowered ? 0.4f : 0.2f) * TagDamageMult; - if (Main.netMode != NetmodeID.Server) + if (!Main.dedServ) { var color = ProvUtils.GetColorBasedOnEnrage(!Main.dayTime, 0); float power = Math.Min(npc.height / 100f, 3f); @@ -6587,7 +6587,7 @@ namespace CalamityMod.NPCs npc2.velocity.Y -= Main.rand.Next(0, 10) * (Main.getGoodWorld ? 0.5f : 0.1f) + s; npc2.ai[0] = -1000 * Main.rand.Next(3); - if (Main.netMode == NetmodeID.Server && slime < Main.maxNPCs) + if (Main.dedServ && slime < Main.maxNPCs) NetMessage.SendData(MessageID.SyncNPC, -1, -1, null, slime, 0f, 0f, 0f, 0, 0, 0); } } @@ -6876,7 +6876,7 @@ namespace CalamityMod.NPCs if (typeToSpawn != NPCID.None) { int spawnedNPC = NPCLoader.SpawnNPC(typeToSpawn, checkPositionX, checkPositionY - 1); - if (Main.netMode == NetmodeID.Server && spawnedNPC < Main.maxNPCs) + if (Main.dedServ && spawnedNPC < Main.maxNPCs) { Main.npc[spawnedNPC].position.Y -= 8f; NetMessage.SendData(MessageID.SyncNPC, -1, -1, null, spawnedNPC); @@ -7206,7 +7206,7 @@ namespace CalamityMod.NPCs if (rTide > 0) RiptideDebuff.DrawEffects(npc, ref drawColor); - if (somaShredStacks > 0 && Main.netMode != NetmodeID.Server) + if (somaShredStacks > 0 && !Main.dedServ) Shred.DrawEffects(npc, this, ref drawColor); if (sulphurPoison > 0) @@ -7273,7 +7273,7 @@ namespace CalamityMod.NPCs } // Some extraneous and probably undocumented visual effect caused by the heart lad pet thing - if (ladHearts > 0 && !npc.loveStruck && Main.netMode != NetmodeID.Server) + if (ladHearts > 0 && !npc.loveStruck && !Main.dedServ) { if (Main.rand.NextBool(5)) { diff --git a/NPCs/CalamityVanillaMinibossesAI.cs b/NPCs/CalamityVanillaMinibossesAI.cs index 10d1ddeb09..c4af09141c 100644 --- a/NPCs/CalamityVanillaMinibossesAI.cs +++ b/NPCs/CalamityVanillaMinibossesAI.cs @@ -622,7 +622,7 @@ namespace CalamityMod.NPCs if (!Main.npc[(int)npc.ai[1]].active || Main.npc[(int)npc.ai[1]].aiStyle != 58) { npc.ai[2] += 10f; - if (npc.ai[2] > 50f || Main.netMode != NetmodeID.Server) + if (npc.ai[2] > 50f || !Main.dedServ) { npc.life = -1; npc.HitEffect(0, 10.0); diff --git a/NPCs/CeaselessVoid/CeaselessVoid.cs b/NPCs/CeaselessVoid/CeaselessVoid.cs index 6fb3d01529..41817f7e07 100644 --- a/NPCs/CeaselessVoid/CeaselessVoid.cs +++ b/NPCs/CeaselessVoid/CeaselessVoid.cs @@ -322,7 +322,7 @@ namespace CalamityMod.NPCs.CeaselessVoid Main.dust[purpleDust2].velocity *= 2f; } - if (Main.netMode != NetmodeID.Server) + if (!Main.dedServ) { float randomSpread = Main.rand.Next(-200, 201) / 100f; Gore.NewGore(NPC.GetSource_Death(), NPC.position, NPC.velocity * randomSpread, Mod.Find("CeaselessVoid").Type, 1f); diff --git a/NPCs/Crabulon/Crabulon.cs b/NPCs/Crabulon/Crabulon.cs index 02c31c3d75..5c15926749 100644 --- a/NPCs/Crabulon/Crabulon.cs +++ b/NPCs/Crabulon/Crabulon.cs @@ -657,7 +657,7 @@ namespace CalamityMod.NPCs.Crabulon Main.npc[crabShroom].SetDefaults(npcType); Main.npc[crabShroom].velocity.X = Main.rand.Next(-50, 51) * (Main.getGoodWorld ? 0.2f : 0.1f); Main.npc[crabShroom].velocity.Y = Main.rand.Next(-50, -31) * (Main.getGoodWorld ? 0.2f : 0.1f); - if (Main.netMode == NetmodeID.Server && crabShroom < Main.maxNPCs) + if (Main.dedServ && crabShroom < Main.maxNPCs) NetMessage.SendData(MessageID.SyncNPC, -1, -1, null, crabShroom); } } @@ -954,7 +954,7 @@ namespace CalamityMod.NPCs.Crabulon stompDust = Dust.NewDust(NPC.position, NPC.width, NPC.height, DustID.BlueFairy, 0f, 0f, 100, default, 2f); Main.dust[stompDust].velocity *= 2f; } - if (Main.netMode != NetmodeID.Server) + if (!Main.dedServ) { float randomSpread = Main.rand.Next(-200, 201) / 100f; Gore.NewGore(NPC.GetSource_Death(), NPC.position, NPC.velocity * randomSpread, Mod.Find("Crabulon").Type, NPC.scale); diff --git a/NPCs/Crags/CalamityEye.cs b/NPCs/Crags/CalamityEye.cs index 0ed1511b15..1c8cbd99a4 100644 --- a/NPCs/Crags/CalamityEye.cs +++ b/NPCs/Crags/CalamityEye.cs @@ -83,7 +83,7 @@ namespace CalamityMod.NPCs.Crags { Dust.NewDust(NPC.position, NPC.width, NPC.height, DustID.Blood, hit.HitDirection, -1f, 0, default, 1f); } - if (Main.netMode != NetmodeID.Server) + if (!Main.dedServ) { Gore.NewGore(NPC.GetSource_Death(), NPC.position, NPC.velocity, Mod.Find("CalamityEye").Type, 1f); Gore.NewGore(NPC.GetSource_Death(), NPC.position, NPC.velocity, Mod.Find("CalamityEye2").Type, 1f); diff --git a/NPCs/Crags/DespairStone.cs b/NPCs/Crags/DespairStone.cs index 5170db261a..e562c70478 100644 --- a/NPCs/Crags/DespairStone.cs +++ b/NPCs/Crags/DespairStone.cs @@ -186,7 +186,7 @@ namespace CalamityMod.NPCs.Crags { Dust.NewDust(NPC.position, NPC.width, NPC.height, (int)CalamityDusts.Brimstone, hit.HitDirection, -1f, 0, default, 1f); } - if (Main.netMode != NetmodeID.Server) + if (!Main.dedServ) { Gore.NewGore(NPC.GetSource_Death(), NPC.position, NPC.velocity, Mod.Find("DespairStone").Type, NPC.scale); Gore.NewGore(NPC.GetSource_Death(), NPC.position, NPC.velocity, Mod.Find("DespairStone2").Type, NPC.scale); diff --git a/NPCs/Crags/RenegadeWarlock.cs b/NPCs/Crags/RenegadeWarlock.cs index 034ca0b0ae..770a2ab412 100644 --- a/NPCs/Crags/RenegadeWarlock.cs +++ b/NPCs/Crags/RenegadeWarlock.cs @@ -84,7 +84,7 @@ namespace CalamityMod.NPCs.Crags { Dust.NewDust(NPC.position, NPC.width, NPC.height, DustID.Blood, hit.HitDirection, -1f, 0, default, 1f); } - if (Main.netMode != NetmodeID.Server) + if (!Main.dedServ) { int count = Main.zenithWorld ? 20 : 1; // remember that old oversight in the draedon update? for (int g = 0; g < count; g++) diff --git a/NPCs/Crags/Scryllar.cs b/NPCs/Crags/Scryllar.cs index 05d844cff5..9be31715aa 100644 --- a/NPCs/Crags/Scryllar.cs +++ b/NPCs/Crags/Scryllar.cs @@ -296,7 +296,7 @@ namespace CalamityMod.NPCs.Crags { Dust.NewDust(NPC.position, NPC.width, NPC.height, (int)CalamityDusts.Brimstone, hit.HitDirection, -1f, 0, default, 1f); } - if (Main.netMode != NetmodeID.Server) + if (!Main.dedServ) { Gore.NewGore(NPC.GetSource_Death(), NPC.position, NPC.velocity, Mod.Find("Scryllar").Type, NPC.scale); } diff --git a/NPCs/Crags/ScryllarRage.cs b/NPCs/Crags/ScryllarRage.cs index e73be83f5c..45bf652574 100644 --- a/NPCs/Crags/ScryllarRage.cs +++ b/NPCs/Crags/ScryllarRage.cs @@ -269,7 +269,7 @@ namespace CalamityMod.NPCs.Crags { Dust.NewDust(NPC.position, NPC.width, NPC.height, (int)CalamityDusts.Brimstone, hit.HitDirection, -1f, 0, default, 1f); } - if (Main.netMode != NetmodeID.Server) + if (!Main.dedServ) { Gore.NewGore(NPC.GetSource_Death(), NPC.position, NPC.velocity, Mod.Find("ScryllarRage").Type, NPC.scale); Gore.NewGore(NPC.GetSource_Death(), NPC.position, NPC.velocity, Mod.Find("ScryllarRage2").Type, NPC.scale); diff --git a/NPCs/Crags/SoulSlurper.cs b/NPCs/Crags/SoulSlurper.cs index de9995a56b..fedf150195 100644 --- a/NPCs/Crags/SoulSlurper.cs +++ b/NPCs/Crags/SoulSlurper.cs @@ -320,7 +320,7 @@ namespace CalamityMod.NPCs.Crags } if (NPC.life <= 0) { - if (Main.netMode != NetmodeID.Server) + if (!Main.dedServ) { Gore.NewGore(NPC.GetSource_Death(), NPC.position, NPC.velocity, Mod.Find("SoulSlurper").Type, NPC.scale); Gore.NewGore(NPC.GetSource_Death(), NPC.position, NPC.velocity, Mod.Find("SoulSlurper2").Type, NPC.scale); diff --git a/NPCs/Cryogen/Cryogen.cs b/NPCs/Cryogen/Cryogen.cs index 9f15609f3e..18bbcb9a8b 100644 --- a/NPCs/Cryogen/Cryogen.cs +++ b/NPCs/Cryogen/Cryogen.cs @@ -311,7 +311,7 @@ namespace CalamityMod.NPCs.Cryogen if (!WorldGen.SolidTile(enemySpawnX, enemySpawnY)) { int legendEnemySpawn = NPC.NewNPC(NPC.GetSource_FromAI(), enemySpawnX * 16 + 8, enemySpawnY * 16, spawnType); - if (Main.netMode == NetmodeID.Server && legendEnemySpawn < Main.maxNPCs) + if (Main.dedServ && legendEnemySpawn < Main.maxNPCs) NetMessage.SendData(MessageID.SyncNPC, -1, -1, null, legendEnemySpawn); break; @@ -1240,7 +1240,7 @@ namespace CalamityMod.NPCs.Cryogen { SoundStyle sound = Main.zenithWorld ? SoundID.NPCDeath14 : TransitionSound; SoundEngine.PlaySound(sound, NPC.Center); - if (Main.netMode != NetmodeID.Server && !Main.zenithWorld) + if (!Main.dedServ && !Main.zenithWorld) { int chipGoreAmount = newPhase >= 5 ? 3 : newPhase >= 3 ? 2 : 1; for (int i = 1; i < chipGoreAmount; i++) @@ -1379,7 +1379,7 @@ namespace CalamityMod.NPCs.Cryogen icyDust2 = Dust.NewDust(NPC.position, NPC.width, NPC.height, dusttype, 0f, 0f, 100, default, 2f); Main.dust[icyDust2].velocity *= 2f; } - if (Main.netMode != NetmodeID.Server && !Main.zenithWorld) + if (!Main.dedServ && !Main.zenithWorld) { float randomSpread = Main.rand.Next(-200, 201) / 100f; for (int i = 1; i < 4; i++) diff --git a/NPCs/Cryogen/CryogenShield.cs b/NPCs/Cryogen/CryogenShield.cs index 532154de8c..aff0c00efc 100644 --- a/NPCs/Cryogen/CryogenShield.cs +++ b/NPCs/Cryogen/CryogenShield.cs @@ -187,7 +187,7 @@ namespace CalamityMod.NPCs.Cryogen Main.dust[icyDust2].velocity *= 2f; } - if (Main.netMode != NetmodeID.Server && !Main.zenithWorld) + if (!Main.dedServ && !Main.zenithWorld) { int totalGores = 16; double radians = MathHelper.TwoPi / totalGores; diff --git a/NPCs/DesertScourge/DesertNuisanceBody.cs b/NPCs/DesertScourge/DesertNuisanceBody.cs index ca4fb0570f..04f7f4f571 100644 --- a/NPCs/DesertScourge/DesertNuisanceBody.cs +++ b/NPCs/DesertScourge/DesertNuisanceBody.cs @@ -295,7 +295,7 @@ namespace CalamityMod.NPCs.DesertScourge if (NPC.life <= 0) { - if (Main.netMode != NetmodeID.Server) + if (!Main.dedServ) { switch ((int)NPC.ai[3]) { diff --git a/NPCs/DesertScourge/DesertNuisanceBodyYoung.cs b/NPCs/DesertScourge/DesertNuisanceBodyYoung.cs index 5a24a228c4..7c36c4c1d6 100644 --- a/NPCs/DesertScourge/DesertNuisanceBodyYoung.cs +++ b/NPCs/DesertScourge/DesertNuisanceBodyYoung.cs @@ -303,7 +303,7 @@ namespace CalamityMod.NPCs.DesertScourge if (NPC.life <= 0) { - if (Main.netMode != NetmodeID.Server) + if (!Main.dedServ) { switch ((int)NPC.ai[3]) { diff --git a/NPCs/DesertScourge/DesertNuisanceHead.cs b/NPCs/DesertScourge/DesertNuisanceHead.cs index b72b17ecaf..9b910362cd 100644 --- a/NPCs/DesertScourge/DesertNuisanceHead.cs +++ b/NPCs/DesertScourge/DesertNuisanceHead.cs @@ -519,7 +519,7 @@ namespace CalamityMod.NPCs.DesertScourge if (NPC.life <= 0) { - if (Main.netMode != NetmodeID.Server) + if (!Main.dedServ) Gore.NewGore(NPC.GetSource_Death(), NPC.position, NPC.velocity, Mod.Find("ScourgeNuisanceHead").Type, NPC.scale); for (int k = 0; k < 10; k++) diff --git a/NPCs/DesertScourge/DesertNuisanceHeadYoung.cs b/NPCs/DesertScourge/DesertNuisanceHeadYoung.cs index deb6591e6b..c1ae0da906 100644 --- a/NPCs/DesertScourge/DesertNuisanceHeadYoung.cs +++ b/NPCs/DesertScourge/DesertNuisanceHeadYoung.cs @@ -560,7 +560,7 @@ namespace CalamityMod.NPCs.DesertScourge if (NPC.life <= 0) { - if (Main.netMode != NetmodeID.Server) + if (!Main.dedServ) Gore.NewGore(NPC.GetSource_Death(), NPC.position, NPC.velocity, Mod.Find("ScourgeNuisance2Head").Type, NPC.scale); for (int k = 0; k < 10; k++) diff --git a/NPCs/DesertScourge/DesertNuisanceTail.cs b/NPCs/DesertScourge/DesertNuisanceTail.cs index ff0620eeed..7c83738f4c 100644 --- a/NPCs/DesertScourge/DesertNuisanceTail.cs +++ b/NPCs/DesertScourge/DesertNuisanceTail.cs @@ -185,7 +185,7 @@ namespace CalamityMod.NPCs.DesertScourge if (NPC.life <= 0) { - if (Main.netMode != NetmodeID.Server) + if (!Main.dedServ) Gore.NewGore(NPC.GetSource_Death(), NPC.position, NPC.velocity, Mod.Find("ScourgeNuisanceTail").Type, NPC.scale); for (int k = 0; k < 10; k++) diff --git a/NPCs/DesertScourge/DesertNuisanceTailYoung.cs b/NPCs/DesertScourge/DesertNuisanceTailYoung.cs index 8c0b1882c9..00290efb8d 100644 --- a/NPCs/DesertScourge/DesertNuisanceTailYoung.cs +++ b/NPCs/DesertScourge/DesertNuisanceTailYoung.cs @@ -193,7 +193,7 @@ namespace CalamityMod.NPCs.DesertScourge if (NPC.life <= 0) { - if (Main.netMode != NetmodeID.Server) + if (!Main.dedServ) Gore.NewGore(NPC.GetSource_Death(), NPC.position, NPC.velocity, Mod.Find("ScourgeNuisance2Tail").Type, NPC.scale); for (int k = 0; k < 10; k++) diff --git a/NPCs/DesertScourge/DesertScourgeBody.cs b/NPCs/DesertScourge/DesertScourgeBody.cs index 55f6cd07e7..32d276bc6b 100644 --- a/NPCs/DesertScourge/DesertScourgeBody.cs +++ b/NPCs/DesertScourge/DesertScourgeBody.cs @@ -339,7 +339,7 @@ namespace CalamityMod.NPCs.DesertScourge if (NPC.life <= 0) { - if (Main.netMode != NetmodeID.Server) + if (!Main.dedServ) { switch ((int)NPC.ai[3]) { @@ -379,7 +379,7 @@ namespace CalamityMod.NPCs.DesertScourge // Sometimes "Deflect" projectiles in gfb into water blasts. if (Main.rand.NextBool(20) && Main.zenithWorld) { - if (Main.netMode != NetmodeID.Server) + if (!Main.dedServ) { Vector2 velocity = new Vector2(-projectile.velocity.X, -projectile.velocity.Y); velocity.Normalize(); diff --git a/NPCs/DesertScourge/DesertScourgeHead.cs b/NPCs/DesertScourge/DesertScourgeHead.cs index fc57caf6b7..66df943fe9 100644 --- a/NPCs/DesertScourge/DesertScourgeHead.cs +++ b/NPCs/DesertScourge/DesertScourgeHead.cs @@ -1021,7 +1021,7 @@ namespace CalamityMod.NPCs.DesertScourge if (NPC.life <= 0) { - if (Main.netMode != NetmodeID.Server) + if (!Main.dedServ) { Gore.NewGore(NPC.GetSource_Death(), NPC.position, NPC.velocity, Mod.Find("ScourgeHead").Type, NPC.scale); Gore.NewGore(NPC.GetSource_Death(), NPC.position, NPC.velocity, Mod.Find("ScourgeHead2").Type, NPC.scale); diff --git a/NPCs/DesertScourge/DesertScourgeTail.cs b/NPCs/DesertScourge/DesertScourgeTail.cs index d09f5d3e8d..86d94a3997 100644 --- a/NPCs/DesertScourge/DesertScourgeTail.cs +++ b/NPCs/DesertScourge/DesertScourgeTail.cs @@ -227,7 +227,7 @@ namespace CalamityMod.NPCs.DesertScourge if (NPC.life <= 0) { - if (Main.netMode != NetmodeID.Server) + if (!Main.dedServ) Gore.NewGore(NPC.GetSource_Death(), NPC.position, NPC.velocity, Mod.Find("ScourgeTail").Type, NPC.scale); for (int k = 0; k < 10; k++) diff --git a/NPCs/DevourerofGods/CosmicGuardianBody.cs b/NPCs/DevourerofGods/CosmicGuardianBody.cs index 43c9f062f9..51946e7d4c 100644 --- a/NPCs/DevourerofGods/CosmicGuardianBody.cs +++ b/NPCs/DevourerofGods/CosmicGuardianBody.cs @@ -195,7 +195,7 @@ namespace CalamityMod.NPCs.DevourerofGods { if (NPC.life <= 0) { - if (Main.netMode != NetmodeID.Server) + if (!Main.dedServ) { float randomSpread = Main.rand.Next(-200, 201) / 100f; Gore.NewGore(NPC.GetSource_Death(), NPC.position, NPC.velocity * randomSpread * Main.rand.NextFloat(), Mod.Find("DoT2").Type, 1f); diff --git a/NPCs/DevourerofGods/CosmicGuardianHead.cs b/NPCs/DevourerofGods/CosmicGuardianHead.cs index 6f9825e6d1..d85e147d7e 100644 --- a/NPCs/DevourerofGods/CosmicGuardianHead.cs +++ b/NPCs/DevourerofGods/CosmicGuardianHead.cs @@ -137,7 +137,7 @@ namespace CalamityMod.NPCs.DevourerofGods } tail = true; } - if (!NPC.active && Main.netMode == NetmodeID.Server) + if (!NPC.active && Main.dedServ) { NetMessage.SendData(MessageID.DamageNPC, -1, -1, null, NPC.whoAmI, -1f, 0f, 0f, 0, 0, 0); } @@ -416,7 +416,7 @@ namespace CalamityMod.NPCs.DevourerofGods { if (NPC.life <= 0) { - if (Main.netMode != NetmodeID.Server) + if (!Main.dedServ) { Gore.NewGore(NPC.GetSource_Death(), NPC.position, NPC.velocity, Mod.Find("DoT").Type, 1f); } diff --git a/NPCs/DevourerofGods/CosmicGuardianTail.cs b/NPCs/DevourerofGods/CosmicGuardianTail.cs index 24469b1616..7bcc59229f 100644 --- a/NPCs/DevourerofGods/CosmicGuardianTail.cs +++ b/NPCs/DevourerofGods/CosmicGuardianTail.cs @@ -187,7 +187,7 @@ namespace CalamityMod.NPCs.DevourerofGods { if (NPC.life <= 0) { - if (Main.netMode != NetmodeID.Server) + if (!Main.dedServ) { float randomSpread = Main.rand.Next(-200, 201) / 100f; Gore.NewGore(NPC.GetSource_Death(), NPC.position, NPC.velocity * randomSpread * Main.rand.NextFloat(), Mod.Find("DoT2").Type, 1f); diff --git a/NPCs/DevourerofGods/DevourerofGodsBody.cs b/NPCs/DevourerofGods/DevourerofGodsBody.cs index 3523335b13..8eeabe1a7f 100644 --- a/NPCs/DevourerofGods/DevourerofGodsBody.cs +++ b/NPCs/DevourerofGods/DevourerofGodsBody.cs @@ -501,7 +501,7 @@ namespace CalamityMod.NPCs.DevourerofGods { if (NPC.life <= 0) { - if (Main.netMode != NetmodeID.Server) + if (!Main.dedServ) { float randomSpread = Main.rand.Next(-200, 201) / 100f; Gore.NewGore(NPC.GetSource_Death(), NPC.position, NPC.velocity * randomSpread * Main.rand.NextFloat(), Mod.Find("DoGS6").Type, NPC.scale); diff --git a/NPCs/DevourerofGods/DevourerofGodsHead.cs b/NPCs/DevourerofGods/DevourerofGodsHead.cs index 8e5da0d276..f4d2a079c9 100644 --- a/NPCs/DevourerofGods/DevourerofGodsHead.cs +++ b/NPCs/DevourerofGods/DevourerofGodsHead.cs @@ -287,7 +287,7 @@ namespace CalamityMod.NPCs.DevourerofGods writer.Write(extrapitch); // Be sure to inform clients of the fact that The Devourer of Gods is dying if only the server recieved this packet. - if (Main.netMode == NetmodeID.Server && !wasDyingBefore && Dying) + if (Main.dedServ && !wasDyingBefore && Dying) { NPC.netSpam = 0; NPC.netUpdate = true; @@ -1029,7 +1029,7 @@ namespace CalamityMod.NPCs.DevourerofGods // Set flight time to max during laser walls if (!spawnedGuardians3 && laserWallPhase == (int)LaserWallPhase.FireLaserWalls) { - if (Main.netMode != NetmodeID.Server) + if (!Main.dedServ) { if (!Main.player[Main.myPlayer].dead && Main.player[Main.myPlayer].active && Vector2.Distance(Main.player[Main.myPlayer].Center, NPC.Center) < CalamityGlobalNPC.CatchUpDistance350Tiles) Main.player[Main.myPlayer].Calamity().infiniteFlight = true; @@ -1059,7 +1059,7 @@ namespace CalamityMod.NPCs.DevourerofGods // Flight if (NPC.ai[3] == 0f) { - if (Main.netMode != NetmodeID.Server) + if (!Main.dedServ) { if (!Main.player[Main.myPlayer].dead && Main.player[Main.myPlayer].active && Vector2.Distance(Main.player[Main.myPlayer].Center, NPC.Center) < CalamityGlobalNPC.CatchUpDistance350Tiles) Main.player[Main.myPlayer].AddBuff(ModContent.BuffType(), 2); @@ -1274,7 +1274,7 @@ namespace CalamityMod.NPCs.DevourerofGods // Ground else { - if (Main.netMode != NetmodeID.Server) + if (!Main.dedServ) { if (!Main.player[Main.myPlayer].dead && Main.player[Main.myPlayer].active && Vector2.Distance(Main.player[Main.myPlayer].Center, NPC.Center) < CalamityGlobalNPC.CatchUpDistance350Tiles) Main.player[Main.myPlayer].AddBuff(ModContent.BuffType(), 2); @@ -1864,7 +1864,7 @@ namespace CalamityMod.NPCs.DevourerofGods // Flight if (NPC.ai[3] == 0f) { - if (Main.netMode != NetmodeID.Server) + if (!Main.dedServ) { if (!Main.player[Main.myPlayer].dead && Main.player[Main.myPlayer].active && Vector2.Distance(Main.player[Main.myPlayer].Center, NPC.Center) < CalamityGlobalNPC.CatchUpDistance350Tiles) Main.player[Main.myPlayer].AddBuff(ModContent.BuffType(), 2); @@ -2061,7 +2061,7 @@ namespace CalamityMod.NPCs.DevourerofGods // Ground else { - if (Main.netMode != NetmodeID.Server) + if (!Main.dedServ) { if (!Main.player[Main.myPlayer].dead && Main.player[Main.myPlayer].active && Vector2.Distance(Main.player[Main.myPlayer].Center, NPC.Center) < CalamityGlobalNPC.CatchUpDistance350Tiles) Main.player[Main.myPlayer].AddBuff(ModContent.BuffType(), 2); @@ -2539,7 +2539,7 @@ namespace CalamityMod.NPCs.DevourerofGods if (Main.netMode != NetmodeID.MultiplayerClient) Projectile.NewProjectile(NPC.GetSource_FromAI(), NPC.Center, Vector2.Zero, ModContent.ProjectileType(), 0, 0f); - if (Main.netMode != NetmodeID.Server) + if (!Main.dedServ) { SoundEngine.PlaySound(DeathAnimationSound, NPC.Center); @@ -2855,7 +2855,7 @@ namespace CalamityMod.NPCs.DevourerofGods } if (NPC.life <= 0) { - if (Main.netMode != NetmodeID.Server) + if (!Main.dedServ) { Gore.NewGore(NPC.GetSource_Death(), NPC.position, NPC.velocity, Mod.Find("DoGS").Type, NPC.scale); Gore.NewGore(NPC.GetSource_Death(), NPC.position, NPC.velocity, Mod.Find("DoGS2").Type, NPC.scale); diff --git a/NPCs/DevourerofGods/DevourerofGodsTail.cs b/NPCs/DevourerofGods/DevourerofGodsTail.cs index 2dcd798415..9eddad668f 100644 --- a/NPCs/DevourerofGods/DevourerofGodsTail.cs +++ b/NPCs/DevourerofGods/DevourerofGodsTail.cs @@ -420,7 +420,7 @@ namespace CalamityMod.NPCs.DevourerofGods } if (NPC.life <= 0) { - if (Main.netMode != NetmodeID.Server) + if (!Main.dedServ) { Gore.NewGore(NPC.GetSource_Death(), NPC.position, NPC.velocity, Mod.Find("DoGS3").Type, NPC.scale); Gore.NewGore(NPC.GetSource_Death(), NPC.position, NPC.velocity, Mod.Find("DoGS4").Type, NPC.scale); diff --git a/NPCs/DraedonLabThings/RepairUnitCritter.cs b/NPCs/DraedonLabThings/RepairUnitCritter.cs index 8c425427dd..9134f87a5f 100644 --- a/NPCs/DraedonLabThings/RepairUnitCritter.cs +++ b/NPCs/DraedonLabThings/RepairUnitCritter.cs @@ -336,7 +336,7 @@ namespace CalamityMod.NPCs.DraedonLabThings Dust.NewDustDirect(NPC.position, NPC.width, NPC.height, DustID.Electric); if (NPC.life <= 0) { - if (Main.netMode != NetmodeID.Server) + if (!Main.dedServ) { for (int i = 1; i <= 3; i++) Gore.NewGorePerfect(NPC.GetSource_Death(), NPC.Center, NPC.velocity.RotatedByRandom(0.3f) * Main.rand.NextFloat(0.7f, 1f), Mod.Find($"RepairUnit{i}").Type); diff --git a/NPCs/ExoMechs/Apollo/Apollo.cs b/NPCs/ExoMechs/Apollo/Apollo.cs index 3b0399f151..c98fbb9b1a 100644 --- a/NPCs/ExoMechs/Apollo/Apollo.cs +++ b/NPCs/ExoMechs/Apollo/Apollo.cs @@ -1750,7 +1750,7 @@ namespace CalamityMod.NPCs.ExoMechs.Apollo Main.dust[plasmaDust].noGravity = true; } - if (Main.netMode != NetmodeID.Server) + if (!Main.dedServ) { Gore.NewGore(NPC.GetSource_Death(), NPC.position, NPC.velocity, Mod.Find("Apollo1").Type, 1f); Gore.NewGore(NPC.GetSource_Death(), NPC.position, NPC.velocity, Mod.Find("Apollo2").Type, 1f); diff --git a/NPCs/ExoMechs/Ares/AresBody.cs b/NPCs/ExoMechs/Ares/AresBody.cs index dbd6a74ecb..a41fcab55f 100644 --- a/NPCs/ExoMechs/Ares/AresBody.cs +++ b/NPCs/ExoMechs/Ares/AresBody.cs @@ -853,7 +853,7 @@ namespace CalamityMod.NPCs.ExoMechs.Ares case (int)Phase.Deathrays: // Set flight time to max during Deathray Spiral - if (Main.netMode != NetmodeID.Server) + if (!Main.dedServ) { if (!Main.player[Main.myPlayer].dead && Main.player[Main.myPlayer].active && Vector2.Distance(Main.player[Main.myPlayer].Center, NPC.Center) < DeathrayEnrageDistance) { @@ -1667,7 +1667,7 @@ namespace CalamityMod.NPCs.ExoMechs.Ares Main.dust[plasmaDust].noGravity = true; } - if (Main.netMode != NetmodeID.Server) + if (!Main.dedServ) { Gore.NewGore(NPC.GetSource_Death(), NPC.position, NPC.velocity, Mod.Find("AresBody1").Type, 1f); Gore.NewGore(NPC.GetSource_Death(), NPC.position, NPC.velocity, Mod.Find("AresBody2").Type, 1f); diff --git a/NPCs/ExoMechs/Ares/AresGaussNuke.cs b/NPCs/ExoMechs/Ares/AresGaussNuke.cs index 2590e97a5a..29284604a7 100644 --- a/NPCs/ExoMechs/Ares/AresGaussNuke.cs +++ b/NPCs/ExoMechs/Ares/AresGaussNuke.cs @@ -682,7 +682,7 @@ namespace CalamityMod.NPCs.ExoMechs.Ares Main.dust[plasmaDust].noGravity = true; } - if (Main.netMode != NetmodeID.Server) + if (!Main.dedServ) { Gore.NewGore(NPC.GetSource_Death(), NPC.position, NPC.velocity, Mod.Find("AresGaussNuke1").Type, 1f); Gore.NewGore(NPC.GetSource_Death(), NPC.position, NPC.velocity, Mod.Find("AresGaussNuke2").Type, 1f); diff --git a/NPCs/ExoMechs/Ares/AresLaserCannon.cs b/NPCs/ExoMechs/Ares/AresLaserCannon.cs index 71b77c28f0..7ba3e64ca0 100644 --- a/NPCs/ExoMechs/Ares/AresLaserCannon.cs +++ b/NPCs/ExoMechs/Ares/AresLaserCannon.cs @@ -732,7 +732,7 @@ namespace CalamityMod.NPCs.ExoMechs.Ares Main.dust[plasmaDust].noGravity = true; } - if (Main.netMode != NetmodeID.Server) + if (!Main.dedServ) { Gore.NewGore(NPC.GetSource_Death(), NPC.position, NPC.velocity, Mod.Find("AresLaserCannon1").Type, 1f); Gore.NewGore(NPC.GetSource_Death(), NPC.position, NPC.velocity, Mod.Find("AresLaserCannon2").Type, 1f); diff --git a/NPCs/ExoMechs/Ares/AresPlasmaFlamethrower.cs b/NPCs/ExoMechs/Ares/AresPlasmaFlamethrower.cs index 27af6cc19e..fc227df3a3 100644 --- a/NPCs/ExoMechs/Ares/AresPlasmaFlamethrower.cs +++ b/NPCs/ExoMechs/Ares/AresPlasmaFlamethrower.cs @@ -681,7 +681,7 @@ namespace CalamityMod.NPCs.ExoMechs.Ares Main.dust[plasmaDust].noGravity = true; } - if (Main.netMode != NetmodeID.Server) + if (!Main.dedServ) { Gore.NewGore(NPC.GetSource_Death(), NPC.position, NPC.velocity, Mod.Find("AresPlasmaFlamethrower1").Type, 1f); Gore.NewGore(NPC.GetSource_Death(), NPC.position, NPC.velocity, Mod.Find("AresPlasmaFlamethrower2").Type, 1f); diff --git a/NPCs/ExoMechs/Ares/AresTeslaCannon.cs b/NPCs/ExoMechs/Ares/AresTeslaCannon.cs index 9934fbdb21..e4dc3a1fb2 100644 --- a/NPCs/ExoMechs/Ares/AresTeslaCannon.cs +++ b/NPCs/ExoMechs/Ares/AresTeslaCannon.cs @@ -675,7 +675,7 @@ namespace CalamityMod.NPCs.ExoMechs.Ares Main.dust[plasmaDust].noGravity = true; } - if (Main.netMode != NetmodeID.Server) + if (!Main.dedServ) { Gore.NewGore(NPC.GetSource_Death(), NPC.position, NPC.velocity, Mod.Find("AresTeslaCannon1").Type, 1f); Gore.NewGore(NPC.GetSource_Death(), NPC.position, NPC.velocity, Mod.Find("AresTeslaCannon2").Type, 1f); diff --git a/NPCs/ExoMechs/Artemis/Artemis.cs b/NPCs/ExoMechs/Artemis/Artemis.cs index c24b5dfb85..7818bae958 100644 --- a/NPCs/ExoMechs/Artemis/Artemis.cs +++ b/NPCs/ExoMechs/Artemis/Artemis.cs @@ -1581,7 +1581,7 @@ namespace CalamityMod.NPCs.ExoMechs.Artemis Main.dust[plasmaDust].noGravity = true; } - if (Main.netMode != NetmodeID.Server) + if (!Main.dedServ) { Gore.NewGore(NPC.GetSource_Death(), NPC.position, NPC.velocity, Mod.Find("Artemis1").Type, 1f); Gore.NewGore(NPC.GetSource_Death(), NPC.position, NPC.velocity, Mod.Find("Artemis2").Type, 1f); diff --git a/NPCs/ExoMechs/Draedon.cs b/NPCs/ExoMechs/Draedon.cs index 3bfd6b266f..5527da2298 100644 --- a/NPCs/ExoMechs/Draedon.cs +++ b/NPCs/ExoMechs/Draedon.cs @@ -379,7 +379,7 @@ namespace CalamityMod.NPCs.ExoMechs if (Main.netMode != NetmodeID.MultiplayerClient) SummonExoMech(); - if (Main.netMode != NetmodeID.Server) + if (!Main.dedServ) { SoundEngine.PlaySound(CommonCalamitySounds.FlareSound with { Volume = CommonCalamitySounds.FlareSound.Volume * 1.55f }, PlayerToFollow.Center); if (!exoMechdusa) @@ -794,7 +794,7 @@ namespace CalamityMod.NPCs.ExoMechs if (NPC.life > 0) return; - if (Main.netMode != NetmodeID.Server && !HasBeenKilled) + if (!Main.dedServ && !HasBeenKilled) { for (int i = 1; i <= 4; i++) { diff --git a/NPCs/ExoMechs/Thanatos/ThanatosBody1.cs b/NPCs/ExoMechs/Thanatos/ThanatosBody1.cs index 414df945d7..001642cf54 100644 --- a/NPCs/ExoMechs/Thanatos/ThanatosBody1.cs +++ b/NPCs/ExoMechs/Thanatos/ThanatosBody1.cs @@ -681,7 +681,7 @@ namespace CalamityMod.NPCs.ExoMechs.Thanatos Main.dust[plasmaDust].noGravity = true; } - if (Main.netMode != NetmodeID.Server) + if (!Main.dedServ) { Gore.NewGore(NPC.GetSource_Death(), NPC.position, NPC.velocity, Mod.Find("ThanatosBody1").Type, 1f); Gore.NewGore(NPC.GetSource_Death(), NPC.position, NPC.velocity, Mod.Find("ThanatosBody1_2").Type, 1f); diff --git a/NPCs/ExoMechs/Thanatos/ThanatosBody2.cs b/NPCs/ExoMechs/Thanatos/ThanatosBody2.cs index 63def90f4a..851583cc43 100644 --- a/NPCs/ExoMechs/Thanatos/ThanatosBody2.cs +++ b/NPCs/ExoMechs/Thanatos/ThanatosBody2.cs @@ -686,7 +686,7 @@ namespace CalamityMod.NPCs.ExoMechs.Thanatos Main.dust[plasmaDust].noGravity = true; } - if (Main.netMode != NetmodeID.Server) + if (!Main.dedServ) { Gore.NewGore(NPC.GetSource_Death(), NPC.position, NPC.velocity, Mod.Find("ThanatosBody2").Type, 1f); Gore.NewGore(NPC.GetSource_Death(), NPC.position, NPC.velocity, Mod.Find("ThanatosBody2_2").Type, 1f); diff --git a/NPCs/ExoMechs/Thanatos/ThanatosHead.cs b/NPCs/ExoMechs/Thanatos/ThanatosHead.cs index 06a5ec4975..a5634d6a46 100644 --- a/NPCs/ExoMechs/Thanatos/ThanatosHead.cs +++ b/NPCs/ExoMechs/Thanatos/ThanatosHead.cs @@ -1339,7 +1339,7 @@ namespace CalamityMod.NPCs.ExoMechs.Thanatos Main.dust[plasmaDust].noGravity = true; } - if (Main.netMode != NetmodeID.Server) + if (!Main.dedServ) { Gore.NewGore(NPC.GetSource_Death(), NPC.position, NPC.velocity, Mod.Find("ThanatosHead").Type, 1f); Gore.NewGore(NPC.GetSource_Death(), NPC.position, NPC.velocity, Mod.Find("ThanatosHead2").Type, 1f); diff --git a/NPCs/ExoMechs/Thanatos/ThanatosTail.cs b/NPCs/ExoMechs/Thanatos/ThanatosTail.cs index a1dcf46bdf..7e5a54ad58 100644 --- a/NPCs/ExoMechs/Thanatos/ThanatosTail.cs +++ b/NPCs/ExoMechs/Thanatos/ThanatosTail.cs @@ -684,7 +684,7 @@ namespace CalamityMod.NPCs.ExoMechs.Thanatos Main.dust[plasmaDust].noGravity = true; } - if (Main.netMode != NetmodeID.Server) + if (!Main.dedServ) { Gore.NewGore(NPC.GetSource_Death(), NPC.position, NPC.velocity, Mod.Find("ThanatosTail").Type, 1f); Gore.NewGore(NPC.GetSource_Death(), NPC.position, NPC.velocity, Mod.Find("ThanatosTail2").Type, 1f); diff --git a/NPCs/HiveMind/DankCreeper.cs b/NPCs/HiveMind/DankCreeper.cs index b10d53ba72..758f6cac73 100644 --- a/NPCs/HiveMind/DankCreeper.cs +++ b/NPCs/HiveMind/DankCreeper.cs @@ -139,7 +139,7 @@ namespace CalamityMod.NPCs.HiveMind for (int k = 0; k < 20; k++) Dust.NewDust(NPC.position, NPC.width, NPC.height, DustID.Glass, hit.HitDirection, -1f, 0, default, 1f); - if (Main.netMode != NetmodeID.Server) + if (!Main.dedServ) { Gore.NewGore(NPC.GetSource_Death(), NPC.position, NPC.velocity, Mod.Find("DankCreeperGore").Type, 1f); Gore.NewGore(NPC.GetSource_Death(), NPC.position, NPC.velocity, Mod.Find("DankCreeperGore2").Type, 1f); diff --git a/NPCs/HiveMind/HiveMind.cs b/NPCs/HiveMind/HiveMind.cs index d9ab68bccf..01aafe3e10 100644 --- a/NPCs/HiveMind/HiveMind.cs +++ b/NPCs/HiveMind/HiveMind.cs @@ -475,7 +475,7 @@ namespace CalamityMod.NPCs.HiveMind { NPC.localAI[1] = 1f; - if (Main.netMode != NetmodeID.Server) + if (!Main.dedServ) { int goreAmount = 7; for (int i = 1; i <= goreAmount; i++) @@ -605,7 +605,7 @@ namespace CalamityMod.NPCs.HiveMind int fivePercentMinions = NPC.NewNPC(NPC.GetSource_FromAI(), x, y, type); Main.npc[fivePercentMinions].SetDefaults(type); - if (Main.netMode == NetmodeID.Server && fivePercentMinions < Main.maxNPCs) + if (Main.dedServ && fivePercentMinions < Main.maxNPCs) NetMessage.SendData(MessageID.SyncNPC, -1, -1, null, fivePercentMinions); } @@ -1228,7 +1228,7 @@ namespace CalamityMod.NPCs.HiveMind int type = ModContent.NPCType(); int tenPercentMinions = NPC.NewNPC(NPC.GetSource_FromAI(), x, y, type); Main.npc[tenPercentMinions].SetDefaults(type); - if (Main.netMode == NetmodeID.Server && tenPercentMinions < Main.maxNPCs) + if (Main.dedServ && tenPercentMinions < Main.maxNPCs) NetMessage.SendData(MessageID.SyncNPC, -1, -1, null, tenPercentMinions); } } @@ -1311,7 +1311,7 @@ namespace CalamityMod.NPCs.HiveMind if (NPC.life <= 0) { - if (Main.netMode != NetmodeID.Server) + if (!Main.dedServ) { int goreAmount = 10; for (int i = 1; i <= goreAmount; i++) diff --git a/NPCs/Leviathan/Leviathan.cs b/NPCs/Leviathan/Leviathan.cs index 0d135c22d4..8d88507216 100644 --- a/NPCs/Leviathan/Leviathan.cs +++ b/NPCs/Leviathan/Leviathan.cs @@ -801,7 +801,7 @@ namespace CalamityMod.NPCs.Leviathan bloody2 = Dust.NewDust(NPC.position, NPC.width, NPC.height, DustID.Blood, 0f, 0f, 100, default, 2f); Main.dust[bloody2].velocity *= 2f; } - if (Main.netMode != NetmodeID.Server) + if (!Main.dedServ) { float randomSpread = Main.rand.Next(-200, 201) / 100f; Gore.NewGore(NPC.GetSource_Death(), NPC.position, NPC.velocity * randomSpread, Mod.Find("LeviGore").Type, NPC.scale); diff --git a/NPCs/NormalNPCs/ArmoredDiggerBody.cs b/NPCs/NormalNPCs/ArmoredDiggerBody.cs index 9582773fef..a4ea0b9aeb 100644 --- a/NPCs/NormalNPCs/ArmoredDiggerBody.cs +++ b/NPCs/NormalNPCs/ArmoredDiggerBody.cs @@ -186,7 +186,7 @@ namespace CalamityMod.NPCs.NormalNPCs { Dust.NewDust(NPC.position, NPC.width, NPC.height, DustID.Torch, hit.HitDirection, -1f, 0, default, 1f); } - if (Main.netMode != NetmodeID.Server) + if (!Main.dedServ) { Gore.NewGore(NPC.GetSource_Death(), NPC.position, NPC.velocity, Mod.Find("ArmoredDiggerBody").Type, 1f); Gore.NewGore(NPC.GetSource_Death(), NPC.position, NPC.velocity, Mod.Find("ArmoredDiggerBody2").Type, 1f); diff --git a/NPCs/NormalNPCs/ArmoredDiggerHead.cs b/NPCs/NormalNPCs/ArmoredDiggerHead.cs index 33ee0968e7..5f230ad2bb 100644 --- a/NPCs/NormalNPCs/ArmoredDiggerHead.cs +++ b/NPCs/NormalNPCs/ArmoredDiggerHead.cs @@ -468,7 +468,7 @@ namespace CalamityMod.NPCs.NormalNPCs { Dust.NewDust(NPC.position, NPC.width, NPC.height, DustID.Torch, hit.HitDirection, -1f, 0, default, 1f); } - if (Main.netMode != NetmodeID.Server) + if (!Main.dedServ) { Gore.NewGore(NPC.GetSource_Death(), NPC.position, NPC.velocity, Mod.Find("ArmoredDiggerHead").Type, 1f); Gore.NewGore(NPC.GetSource_Death(), NPC.position, NPC.velocity, Mod.Find("ArmoredDiggerHead2").Type, 1f); diff --git a/NPCs/NormalNPCs/ArmoredDiggerTail.cs b/NPCs/NormalNPCs/ArmoredDiggerTail.cs index b6536f1e61..8aa015ef78 100644 --- a/NPCs/NormalNPCs/ArmoredDiggerTail.cs +++ b/NPCs/NormalNPCs/ArmoredDiggerTail.cs @@ -141,7 +141,7 @@ namespace CalamityMod.NPCs.NormalNPCs { Dust.NewDust(NPC.position, NPC.width, NPC.height, DustID.Torch, hit.HitDirection, -1f, 0, default, 1f); } - if (Main.netMode != NetmodeID.Server) + if (!Main.dedServ) { Gore.NewGore(NPC.GetSource_Death(), NPC.position, NPC.velocity, Mod.Find("ArmoredDiggerTail").Type, 1f); Gore.NewGore(NPC.GetSource_Death(), NPC.position, NPC.velocity, Mod.Find("ArmoredDiggerTail2").Type, 1f); diff --git a/NPCs/NormalNPCs/AuroraSpirit.cs b/NPCs/NormalNPCs/AuroraSpirit.cs index 0e177cee4c..8c65b93520 100644 --- a/NPCs/NormalNPCs/AuroraSpirit.cs +++ b/NPCs/NormalNPCs/AuroraSpirit.cs @@ -127,7 +127,7 @@ namespace CalamityMod.NPCs.NormalNPCs { Dust.NewDust(NPC.position, NPC.width, NPC.height, DustID.IceRod, hit.HitDirection, -1f, 0, default, 1f); } - if (Main.netMode != NetmodeID.Server) + if (!Main.dedServ) { Gore.NewGore(NPC.GetSource_Death(), NPC.position, NPC.velocity, Mod.Find("CryoSpirit").Type, 1f); } diff --git a/NPCs/NormalNPCs/Bohldohr.cs b/NPCs/NormalNPCs/Bohldohr.cs index b48e26de4c..a6a4b88510 100644 --- a/NPCs/NormalNPCs/Bohldohr.cs +++ b/NPCs/NormalNPCs/Bohldohr.cs @@ -74,7 +74,7 @@ namespace CalamityMod.NPCs.NormalNPCs { Dust.NewDust(NPC.position, NPC.width, NPC.height, DustID.Ambient_DarkBrown, hit.HitDirection, -1f, 0, default, 1f); } - if (Main.netMode != NetmodeID.Server) + if (!Main.dedServ) { Gore.NewGore(NPC.GetSource_Death(), NPC.position, NPC.velocity, Mod.Find("Bohldohr").Type, 1f); Gore.NewGore(NPC.GetSource_Death(), NPC.position, NPC.velocity, Mod.Find("Bohldohr2").Type, 1f); diff --git a/NPCs/NormalNPCs/BucketZombie.cs b/NPCs/NormalNPCs/BucketZombie.cs index 17873f340f..d0b4edf209 100644 --- a/NPCs/NormalNPCs/BucketZombie.cs +++ b/NPCs/NormalNPCs/BucketZombie.cs @@ -82,7 +82,7 @@ namespace CalamityMod.NPCs.NormalNPCs { Dust.NewDust(NPC.position, NPC.width, NPC.height, DustID.Blood, hit.HitDirection, -1f, 0, default, 1f); } - if (Main.netMode != NetmodeID.Server) + if (!Main.dedServ) { Gore.NewGore(NPC.GetSource_Death(), NPC.position, NPC.velocity, Mod.Find("BucketZombie").Type, 1f); Gore.NewGore(NPC.GetSource_Death(), NPC.position, NPC.velocity, Mod.Find("BucketZombie2").Type, 1f); diff --git a/NPCs/NormalNPCs/CladCrab.cs b/NPCs/NormalNPCs/CladCrab.cs index 51e14ce53b..7696168219 100644 --- a/NPCs/NormalNPCs/CladCrab.cs +++ b/NPCs/NormalNPCs/CladCrab.cs @@ -295,7 +295,7 @@ namespace CalamityMod.NPCs.NormalNPCs Dust.NewDust(NPC.position, NPC.width, NPC.height, DustID.Stone, hit.HitDirection, -1f, 0, default, 1f); Dust.NewDust(NPC.position, NPC.width, NPC.height, DustID.Grass, hit.HitDirection, -1f, 0, default, 1f); } - if (Main.netMode != NetmodeID.Server) + if (!Main.dedServ) { Gore.NewGore(NPC.GetSource_Death(), NPC.Center, NPC.velocity, Mod.Find("CladCrab").Type); Gore.NewGore(NPC.GetSource_Death(), NPC.Center, NPC.velocity, Mod.Find("CladCrab2").Type); diff --git a/NPCs/NormalNPCs/CrawlerAmber.cs b/NPCs/NormalNPCs/CrawlerAmber.cs index 17192a95df..f954995ab2 100644 --- a/NPCs/NormalNPCs/CrawlerAmber.cs +++ b/NPCs/NormalNPCs/CrawlerAmber.cs @@ -117,7 +117,7 @@ namespace CalamityMod.NPCs.NormalNPCs { Dust.NewDust(NPC.position, NPC.width, NPC.height, DustID.Sand, hit.HitDirection, -1f, 0, default, 1f); } - if (Main.netMode != NetmodeID.Server) + if (!Main.dedServ) { Gore.NewGore(NPC.GetSource_Death(), NPC.position, NPC.velocity, Mod.Find("CrawlerAmber").Type, 1f); Gore.NewGore(NPC.GetSource_Death(), NPC.position, NPC.velocity, Mod.Find("CrawlerAmber2").Type, 1f); diff --git a/NPCs/NormalNPCs/CrawlerAmethyst.cs b/NPCs/NormalNPCs/CrawlerAmethyst.cs index 402b5e213f..a4e87c0b90 100644 --- a/NPCs/NormalNPCs/CrawlerAmethyst.cs +++ b/NPCs/NormalNPCs/CrawlerAmethyst.cs @@ -117,7 +117,7 @@ namespace CalamityMod.NPCs.NormalNPCs { Dust.NewDust(NPC.position, NPC.width, NPC.height, DustID.PurpleCrystalShard, hit.HitDirection, -1f, 0, default, 1f); } - if (Main.netMode != NetmodeID.Server) + if (!Main.dedServ) { Gore.NewGore(NPC.GetSource_Death(), NPC.position, NPC.velocity, Mod.Find("CrawlerAmethyst").Type, 1f); Gore.NewGore(NPC.GetSource_Death(), NPC.position, NPC.velocity, Mod.Find("CrawlerAmethyst2").Type, 1f); diff --git a/NPCs/NormalNPCs/CrawlerCrystal.cs b/NPCs/NormalNPCs/CrawlerCrystal.cs index 528a2c090b..e1a0792b18 100644 --- a/NPCs/NormalNPCs/CrawlerCrystal.cs +++ b/NPCs/NormalNPCs/CrawlerCrystal.cs @@ -118,7 +118,7 @@ namespace CalamityMod.NPCs.NormalNPCs { Dust.NewDust(NPC.position, NPC.width, NPC.height, DustID.BlueCrystalShard, hit.HitDirection, -1f, 0, default, 1f); } - if (Main.netMode != NetmodeID.Server) + if (!Main.dedServ) { Gore.NewGore(NPC.GetSource_Death(), NPC.position, NPC.velocity, Mod.Find("CrawlerCrystal").Type, 1f); Gore.NewGore(NPC.GetSource_Death(), NPC.position, NPC.velocity, Mod.Find("CrawlerCrystal2").Type, 1f); diff --git a/NPCs/NormalNPCs/CrawlerDiamond.cs b/NPCs/NormalNPCs/CrawlerDiamond.cs index cd13945757..09e32974f5 100644 --- a/NPCs/NormalNPCs/CrawlerDiamond.cs +++ b/NPCs/NormalNPCs/CrawlerDiamond.cs @@ -117,7 +117,7 @@ namespace CalamityMod.NPCs.NormalNPCs { Dust.NewDust(NPC.position, NPC.width, NPC.height, DustID.GemDiamond, hit.HitDirection, -1f, 0, default, 1f); } - if (Main.netMode != NetmodeID.Server) + if (!Main.dedServ) { Gore.NewGore(NPC.GetSource_Death(), NPC.position, NPC.velocity, Mod.Find("CrawlerDiamond").Type, 1f); Gore.NewGore(NPC.GetSource_Death(), NPC.position, NPC.velocity, Mod.Find("CrawlerDiamond2").Type, 1f); diff --git a/NPCs/NormalNPCs/CrawlerEmerald.cs b/NPCs/NormalNPCs/CrawlerEmerald.cs index 9cda2fb1aa..83098672ad 100644 --- a/NPCs/NormalNPCs/CrawlerEmerald.cs +++ b/NPCs/NormalNPCs/CrawlerEmerald.cs @@ -117,7 +117,7 @@ namespace CalamityMod.NPCs.NormalNPCs { Dust.NewDust(NPC.position, NPC.width, NPC.height, DustID.GemEmerald, hit.HitDirection, -1f, 0, default, 1f); } - if (Main.netMode != NetmodeID.Server) + if (!Main.dedServ) { Gore.NewGore(NPC.GetSource_Death(), NPC.position, NPC.velocity, Mod.Find("CrawlerEmerald").Type, 1f); Gore.NewGore(NPC.GetSource_Death(), NPC.position, NPC.velocity, Mod.Find("CrawlerEmerald2").Type, 1f); diff --git a/NPCs/NormalNPCs/CrawlerRuby.cs b/NPCs/NormalNPCs/CrawlerRuby.cs index 09f52c7060..85e11808ee 100644 --- a/NPCs/NormalNPCs/CrawlerRuby.cs +++ b/NPCs/NormalNPCs/CrawlerRuby.cs @@ -117,7 +117,7 @@ namespace CalamityMod.NPCs.NormalNPCs { Dust.NewDust(NPC.position, NPC.width, NPC.height, DustID.HeartCrystal, hit.HitDirection, -1f, 0, default, 1f); } - if (Main.netMode != NetmodeID.Server) + if (!Main.dedServ) { Gore.NewGore(NPC.GetSource_Death(), NPC.position, NPC.velocity, Mod.Find("CrawlerRuby").Type, 1f); Gore.NewGore(NPC.GetSource_Death(), NPC.position, NPC.velocity, Mod.Find("CrawlerRuby2").Type, 1f); diff --git a/NPCs/NormalNPCs/CrawlerSapphire.cs b/NPCs/NormalNPCs/CrawlerSapphire.cs index a75e5b20fd..82e676db37 100644 --- a/NPCs/NormalNPCs/CrawlerSapphire.cs +++ b/NPCs/NormalNPCs/CrawlerSapphire.cs @@ -117,7 +117,7 @@ namespace CalamityMod.NPCs.NormalNPCs { Dust.NewDust(NPC.position, NPC.width, NPC.height, DustID.BlueCrystalShard, hit.HitDirection, -1f, 0, default, 1f); } - if (Main.netMode != NetmodeID.Server) + if (!Main.dedServ) { Gore.NewGore(NPC.GetSource_Death(), NPC.position, NPC.velocity, Mod.Find("CrawlerSapphire").Type, 1f); Gore.NewGore(NPC.GetSource_Death(), NPC.position, NPC.velocity, Mod.Find("CrawlerSapphire2").Type, 1f); diff --git a/NPCs/NormalNPCs/CrawlerTopaz.cs b/NPCs/NormalNPCs/CrawlerTopaz.cs index 347d6d546c..3ce4c15784 100644 --- a/NPCs/NormalNPCs/CrawlerTopaz.cs +++ b/NPCs/NormalNPCs/CrawlerTopaz.cs @@ -117,7 +117,7 @@ namespace CalamityMod.NPCs.NormalNPCs { Dust.NewDust(NPC.position, NPC.width, NPC.height, DustID.t_Honey, hit.HitDirection, -1f, 0, default, 1f); } - if (Main.netMode != NetmodeID.Server) + if (!Main.dedServ) { Gore.NewGore(NPC.GetSource_Death(), NPC.position, NPC.velocity, Mod.Find("CrawlerTopaz").Type, 1f); Gore.NewGore(NPC.GetSource_Death(), NPC.position, NPC.velocity, Mod.Find("CrawlerTopaz2").Type, 1f); diff --git a/NPCs/NormalNPCs/Eidolist.cs b/NPCs/NormalNPCs/Eidolist.cs index 9a4cab62f1..fe9bf61205 100644 --- a/NPCs/NormalNPCs/Eidolist.cs +++ b/NPCs/NormalNPCs/Eidolist.cs @@ -346,7 +346,7 @@ namespace CalamityMod.NPCs.NormalNPCs { Dust.NewDust(NPC.position, NPC.width, NPC.height, DustID.TintableDust, hit.HitDirection, -1f, 0, default, 1f); } - if (Main.netMode != NetmodeID.Server) + if (!Main.dedServ) { Gore.NewGore(NPC.GetSource_Death(), NPC.position, NPC.velocity, Mod.Find("Eidolist").Type, NPC.scale); Gore.NewGore(NPC.GetSource_Death(), NPC.position, NPC.velocity, Mod.Find("Eidolist2").Type, NPC.scale); diff --git a/NPCs/NormalNPCs/FearlessGoldfishWarrior.cs b/NPCs/NormalNPCs/FearlessGoldfishWarrior.cs index e5eca4bb8e..0877b823af 100644 --- a/NPCs/NormalNPCs/FearlessGoldfishWarrior.cs +++ b/NPCs/NormalNPCs/FearlessGoldfishWarrior.cs @@ -249,7 +249,7 @@ namespace CalamityMod.NPCs.NormalNPCs NPC.ai[3] = (float)backUpTimer; NPC.netUpdate = true; } - if (Main.netMode == NetmodeID.Server & canOpenDoor) + if (Main.dedServ & canOpenDoor) { NetMessage.SendData(MessageID.ToggleDoorState, -1, -1, null, 0, (float)doorCheckX, (float)(doorCheckY - 1), (float)NPC.direction, 0, 0, 0); } @@ -262,7 +262,7 @@ namespace CalamityMod.NPCs.NormalNPCs NPC.ai[3] = (float)backUpTimer; NPC.netUpdate = true; } - if (Main.netMode == NetmodeID.Server & canOpenTallGate) + if (Main.dedServ & canOpenTallGate) { NetMessage.SendData(MessageID.ToggleDoorState, -1, -1, null, 4, (float)doorCheckX, (float)(doorCheckY - 1), 0f, 0, 0, 0); } diff --git a/NPCs/NormalNPCs/Foveanator.cs b/NPCs/NormalNPCs/Foveanator.cs index 8a94dd7c66..30d5b09bca 100644 --- a/NPCs/NormalNPCs/Foveanator.cs +++ b/NPCs/NormalNPCs/Foveanator.cs @@ -505,7 +505,7 @@ namespace CalamityMod.NPCs.NormalNPCs { SoundEngine.PlaySound(SoundID.NPCHit1, NPC.Center); - if (Main.netMode != NetmodeID.Server) + if (!Main.dedServ) { for (int i = 0; i < 2; i++) { @@ -927,7 +927,7 @@ namespace CalamityMod.NPCs.NormalNPCs for (int i = 0; i < 150; i++) Dust.NewDust(NPC.position, NPC.width, NPC.height, DustID.Blood, 2 * hit.HitDirection, -2f); - if (Main.netMode != NetmodeID.Server) + if (!Main.dedServ) { for (int i = 0; i < 2; i++) { @@ -953,7 +953,7 @@ namespace CalamityMod.NPCs.NormalNPCs Main.dust[dust].velocity *= 3f; } - if (Main.netMode != NetmodeID.Server) + if (!Main.dedServ) { int gore = Gore.NewGore(NPC.GetSource_Death(), NPC.position, default, Main.rand.Next(61, 64)); Main.gore[gore].velocity *= 0.4f; diff --git a/NPCs/NormalNPCs/Frogfish.cs b/NPCs/NormalNPCs/Frogfish.cs index 616cabe023..3c4fe4c6f8 100644 --- a/NPCs/NormalNPCs/Frogfish.cs +++ b/NPCs/NormalNPCs/Frogfish.cs @@ -139,7 +139,7 @@ namespace CalamityMod.NPCs.NormalNPCs { Dust.NewDust(NPC.position, NPC.width, NPC.height, DustID.Blood, hit.HitDirection, -1f, 0, default, 1f); } - if (Main.netMode != NetmodeID.Server) + if (!Main.dedServ) { Gore.NewGore(NPC.GetSource_Death(), NPC.position, NPC.velocity, Mod.Find("Frogfish").Type, 1f); Gore.NewGore(NPC.GetSource_Death(), NPC.position, NPC.velocity, Mod.Find("Frogfish2").Type, 1f); diff --git a/NPCs/NormalNPCs/Horse.cs b/NPCs/NormalNPCs/Horse.cs index 6d7b54958e..9d463af369 100644 --- a/NPCs/NormalNPCs/Horse.cs +++ b/NPCs/NormalNPCs/Horse.cs @@ -150,7 +150,7 @@ namespace CalamityMod.NPCs.NormalNPCs Main.dust[earthDust2].velocity *= 2f; } - if (Main.netMode != NetmodeID.Server) + if (!Main.dedServ) { Vector2 goreSource = NPC.Center; int goreAmt = 3; diff --git a/NPCs/NormalNPCs/IceClasper.cs b/NPCs/NormalNPCs/IceClasper.cs index bf70ac2606..3bd82cae9d 100644 --- a/NPCs/NormalNPCs/IceClasper.cs +++ b/NPCs/NormalNPCs/IceClasper.cs @@ -310,7 +310,7 @@ namespace CalamityMod.NPCs.NormalNPCs { Dust.NewDust(NPC.position, NPC.width, NPC.height, DustID.Frost, hit.HitDirection, -1f, 0, default, 1f); } - if (Main.netMode != NetmodeID.Server) + if (!Main.dedServ) { Gore.NewGore(NPC.GetSource_Death(), NPC.Center, NPC.velocity, Mod.Find("IceClasper").Type); Gore.NewGore(NPC.GetSource_Death(), NPC.Center, NPC.velocity, Mod.Find("IceClasper2").Type); diff --git a/NPCs/NormalNPCs/ImpiousImmolator.cs b/NPCs/NormalNPCs/ImpiousImmolator.cs index ab77e707d2..923a6e30ad 100644 --- a/NPCs/NormalNPCs/ImpiousImmolator.cs +++ b/NPCs/NormalNPCs/ImpiousImmolator.cs @@ -285,7 +285,7 @@ namespace CalamityMod.NPCs.NormalNPCs { Dust.NewDust(NPC.position, NPC.width, NPC.height, (int)CalamityDusts.ProfanedFire, hit.HitDirection, -1f, 0, default, 1f); } - if (Main.netMode != NetmodeID.Server) + if (!Main.dedServ) { Gore.NewGore(NPC.GetSource_Death(), NPC.position, NPC.velocity, Mod.Find("ImpiousImmolator").Type, 1f); Gore.NewGore(NPC.GetSource_Death(), NPC.position, NPC.velocity, Mod.Find("ImpiousImmolator2").Type, 1f); diff --git a/NPCs/NormalNPCs/MantisShrimp.cs b/NPCs/NormalNPCs/MantisShrimp.cs index 721b6b923f..5dd4b71209 100644 --- a/NPCs/NormalNPCs/MantisShrimp.cs +++ b/NPCs/NormalNPCs/MantisShrimp.cs @@ -139,7 +139,7 @@ namespace CalamityMod.NPCs.NormalNPCs { Dust.NewDust(NPC.position, NPC.width, NPC.height, DustID.Blood, hit.HitDirection, -1f, 0, default, 1f); } - if (Main.netMode != NetmodeID.Server) + if (!Main.dedServ) { Gore.NewGore(NPC.GetSource_Death(), NPC.position, NPC.velocity, Mod.Find("MantisShrimp").Type, 1f); Gore.NewGore(NPC.GetSource_Death(), NPC.position, NPC.velocity, Mod.Find("MantisShrimp2").Type, 1f); diff --git a/NPCs/NormalNPCs/OverloadedSoldier.cs b/NPCs/NormalNPCs/OverloadedSoldier.cs index f9a42d6e5e..737a0269d0 100644 --- a/NPCs/NormalNPCs/OverloadedSoldier.cs +++ b/NPCs/NormalNPCs/OverloadedSoldier.cs @@ -300,7 +300,7 @@ namespace CalamityMod.NPCs.NormalNPCs NPC.ai[3] = (float)backUpTimer; NPC.netUpdate = true; } - if (Main.netMode == NetmodeID.Server & canOpenDoor) + if (Main.dedServ & canOpenDoor) { NetMessage.SendData(MessageID.ToggleDoorState, -1, -1, null, 0, (float)doorCheckX, (float)(doorCheckY - 1), (float)NPC.direction, 0, 0, 0); } @@ -313,7 +313,7 @@ namespace CalamityMod.NPCs.NormalNPCs NPC.ai[3] = (float)backUpTimer; NPC.netUpdate = true; } - if (Main.netMode == NetmodeID.Server & canOpenTallGate) + if (Main.dedServ & canOpenTallGate) { NetMessage.SendData(MessageID.ToggleDoorState, -1, -1, null, 4, (float)doorCheckX, (float)(doorCheckY - 1), 0f, 0, 0, 0); } diff --git a/NPCs/NormalNPCs/PlanterasFreeTentacle.cs b/NPCs/NormalNPCs/PlanterasFreeTentacle.cs index 8640f341e9..1feaea149e 100644 --- a/NPCs/NormalNPCs/PlanterasFreeTentacle.cs +++ b/NPCs/NormalNPCs/PlanterasFreeTentacle.cs @@ -212,7 +212,7 @@ namespace CalamityMod.NPCs.NormalNPCs for (int i = 0; i < 150; i++) Dust.NewDust(NPC.position, NPC.width, NPC.height, DustID.Plantera_Green, 2 * hit.HitDirection, -2f); - if (Main.netMode != NetmodeID.Server) + if (!Main.dedServ) { Gore.NewGore(NPC.GetSource_Death(), new Vector2(NPC.position.X + (float)Main.rand.Next(NPC.width), NPC.position.Y + (float)Main.rand.Next(NPC.height)), NPC.velocity, 388, NPC.scale); Gore.NewGore(NPC.GetSource_Death(), new Vector2(NPC.position.X + (float)Main.rand.Next(NPC.width), NPC.position.Y + (float)Main.rand.Next(NPC.height)), NPC.velocity, 389, NPC.scale); diff --git a/NPCs/NormalNPCs/ProfanedEnergyBody.cs b/NPCs/NormalNPCs/ProfanedEnergyBody.cs index 1f848d4090..31fd92aaa5 100644 --- a/NPCs/NormalNPCs/ProfanedEnergyBody.cs +++ b/NPCs/NormalNPCs/ProfanedEnergyBody.cs @@ -105,7 +105,7 @@ namespace CalamityMod.NPCs.NormalNPCs { Dust.NewDust(NPC.position, NPC.width, NPC.height, (int)CalamityDusts.ProfanedFire, hit.HitDirection, -1f, 0, default, 1f); } - if (Main.netMode != NetmodeID.Server) + if (!Main.dedServ) { Gore.NewGore(NPC.GetSource_Death(), NPC.position, NPC.velocity, Mod.Find("ProfanedEnergyBody").Type, 1f); Gore.NewGore(NPC.GetSource_Death(), NPC.position, NPC.velocity, Mod.Find("ProfanedEnergyBody2").Type, 1f); diff --git a/NPCs/NormalNPCs/Rimehound.cs b/NPCs/NormalNPCs/Rimehound.cs index b997458456..4fb5748983 100644 --- a/NPCs/NormalNPCs/Rimehound.cs +++ b/NPCs/NormalNPCs/Rimehound.cs @@ -171,7 +171,7 @@ namespace CalamityMod.NPCs.NormalNPCs { Dust.NewDust(NPC.position, NPC.width, NPC.height, DustID.Blood, hit.HitDirection, -1f, 0, default, 1f); } - if (Main.netMode != NetmodeID.Server) + if (!Main.dedServ) { Gore.NewGore(NPC.GetSource_Death(), NPC.position, NPC.velocity, Mod.Find("AngryDog").Type, 1f); Gore.NewGore(NPC.GetSource_Death(), NPC.position, NPC.velocity, Mod.Find("AngryDog2").Type, 1f); diff --git a/NPCs/NormalNPCs/Rotdog.cs b/NPCs/NormalNPCs/Rotdog.cs index bb0141847c..c27214493c 100644 --- a/NPCs/NormalNPCs/Rotdog.cs +++ b/NPCs/NormalNPCs/Rotdog.cs @@ -124,7 +124,7 @@ namespace CalamityMod.NPCs.NormalNPCs { Dust.NewDust(NPC.position, NPC.width, NPC.height, DustID.Blood, hit.HitDirection, -1f, 0, default, 1f); } - if (Main.netMode != NetmodeID.Server) + if (!Main.dedServ) { Gore.NewGore(NPC.GetSource_Death(), NPC.position, NPC.velocity, Mod.Find("Rotdog1").Type, 1f); Gore.NewGore(NPC.GetSource_Death(), NPC.position, NPC.velocity, Mod.Find("Rotdog2").Type, 1f); diff --git a/NPCs/NormalNPCs/ScornEater.cs b/NPCs/NormalNPCs/ScornEater.cs index 6e34f798d6..595c902888 100644 --- a/NPCs/NormalNPCs/ScornEater.cs +++ b/NPCs/NormalNPCs/ScornEater.cs @@ -223,7 +223,7 @@ namespace CalamityMod.NPCs.NormalNPCs { Dust.NewDust(NPC.position, NPC.width, NPC.height, (int)CalamityDusts.ProfanedFire, hit.HitDirection, -1f, 0, default, 1f); } - if (Main.netMode != NetmodeID.Server) + if (!Main.dedServ) { Gore.NewGore(NPC.GetSource_Death(), NPC.position, NPC.velocity, Mod.Find("ScornEater").Type, 1f); Gore.NewGore(NPC.GetSource_Death(), NPC.position, NPC.velocity, Mod.Find("ScornEater2").Type, 1f); diff --git a/NPCs/NormalNPCs/ShockstormShuttle.cs b/NPCs/NormalNPCs/ShockstormShuttle.cs index 161238d44f..c75989cfda 100644 --- a/NPCs/NormalNPCs/ShockstormShuttle.cs +++ b/NPCs/NormalNPCs/ShockstormShuttle.cs @@ -393,7 +393,7 @@ namespace CalamityMod.NPCs.NormalNPCs { Dust.NewDust(NPC.position, NPC.width, NPC.height, DustID.BoneTorch, hit.HitDirection, -1f, 0, default, 1f); } - if (Main.netMode != NetmodeID.Server) + if (!Main.dedServ) { Gore.NewGore(NPC.GetSource_Death(), NPC.position, NPC.velocity, Mod.Find("ShockstormShuttle").Type, 1f); Gore.NewGore(NPC.GetSource_Death(), NPC.position, NPC.velocity, Mod.Find("ShockstormShuttle2").Type, 1f); diff --git a/NPCs/NormalNPCs/Shroomble.cs b/NPCs/NormalNPCs/Shroomble.cs index ce2e765f3d..b7a3f55518 100644 --- a/NPCs/NormalNPCs/Shroomble.cs +++ b/NPCs/NormalNPCs/Shroomble.cs @@ -167,7 +167,7 @@ namespace CalamityMod.NPCs.NormalNPCs { Dust.NewDust(NPC.position, NPC.width, NPC.height, DustID.Pixie, hit.HitDirection * 0.5f, -0.5f, 0, default, 0.5f); } - if (Main.netMode != NetmodeID.Server) + if (!Main.dedServ) { Gore.NewGore(NPC.GetSource_Death(), NPC.Center, NPC.velocity, Mod.Find("Shroomble").Type); Gore.NewGore(NPC.GetSource_Death(), NPC.Center, NPC.velocity, Mod.Find("Shroomble2").Type); diff --git a/NPCs/NormalNPCs/SkeletronPrime2.cs b/NPCs/NormalNPCs/SkeletronPrime2.cs index 508c8a2260..dcbd25f0ae 100644 --- a/NPCs/NormalNPCs/SkeletronPrime2.cs +++ b/NPCs/NormalNPCs/SkeletronPrime2.cs @@ -225,7 +225,7 @@ namespace CalamityMod.NPCs.NormalNPCs Main.npc[spazmatism].localAI[3] = 1f; Main.npc[spazmatism].SyncVanillaLocalAI(); string typeName = Main.npc[spazmatism].TypeName; - if (Main.netMode == NetmodeID.Server && spazmatism < Main.maxNPCs) + if (Main.dedServ && spazmatism < Main.maxNPCs) NetMessage.SendData(MessageID.SyncNPC, -1, -1, null, spazmatism); AchievementsHelper.CheckMechaMayhem(); @@ -875,7 +875,7 @@ namespace CalamityMod.NPCs.NormalNPCs { if (NPC.life <= 0) { - if (Main.netMode != NetmodeID.Server) + if (!Main.dedServ) { Gore.NewGore(NPC.GetSource_Death(), NPC.position, NPC.velocity, Mod.Find("SkeletronPrime2_1").Type, NPC.scale); Gore.NewGore(NPC.GetSource_Death(), NPC.position, NPC.velocity, Mod.Find("SkeletronPrime2_2").Type, NPC.scale); diff --git a/NPCs/NormalNPCs/Stormlion.cs b/NPCs/NormalNPCs/Stormlion.cs index dd3131cb42..7a00d1fa3a 100644 --- a/NPCs/NormalNPCs/Stormlion.cs +++ b/NPCs/NormalNPCs/Stormlion.cs @@ -74,7 +74,7 @@ namespace CalamityMod.NPCs.NormalNPCs { Dust.NewDust(NPC.position, NPC.width, NPC.height, DustID.Blood, hit.HitDirection, -1f, 0, default, 1f); } - if (Main.netMode != NetmodeID.Server) + if (!Main.dedServ) { Gore.NewGore(NPC.GetSource_Death(), NPC.position, NPC.velocity, Mod.Find("Stormlion").Type, NPC.scale); Gore.NewGore(NPC.GetSource_Death(), NPC.position, NPC.velocity, Mod.Find("Stormlion2").Type, NPC.scale); diff --git a/NPCs/NormalNPCs/ThiccWaifu.cs b/NPCs/NormalNPCs/ThiccWaifu.cs index 42e7e11033..1af0826051 100644 --- a/NPCs/NormalNPCs/ThiccWaifu.cs +++ b/NPCs/NormalNPCs/ThiccWaifu.cs @@ -224,7 +224,7 @@ namespace CalamityMod.NPCs.NormalNPCs { Dust.NewDustDirect(NPC.position, NPC.width, NPC.height, DustID.Cloud); - if (Main.rand.NextBool(15) && Main.netMode != NetmodeID.Server) + if (Main.rand.NextBool(15) && !Main.dedServ) { int smokeType = Utils.SelectRandom(Main.rand, GoreID.ChimneySmoke1, GoreID.ChimneySmoke2, GoreID.ChimneySmoke3); Vector2 smokeVelocity = Main.rand.NextVector2CircularEdge(6f, 6f); diff --git a/NPCs/OldDuke/OldDuke.cs b/NPCs/OldDuke/OldDuke.cs index bc34705496..d9fd23d8cd 100644 --- a/NPCs/OldDuke/OldDuke.cs +++ b/NPCs/OldDuke/OldDuke.cs @@ -498,7 +498,7 @@ namespace CalamityMod.NPCs.OldDuke Dust.NewDust(NPC.position, NPC.width, NPC.height, (int)CalamityDusts.SulphurousSeaAcid, 2 * hit.HitDirection, -2f, 0, default, 1f); } - if (Main.netMode != NetmodeID.Server) + if (!Main.dedServ) { Gore.NewGore(NPC.GetSource_Death(), NPC.Center + Vector2.UnitX * 20f * NPC.direction, NPC.velocity, Mod.Find("OldDukeGore").Type, NPC.scale); Gore.NewGore(NPC.GetSource_Death(), NPC.Center + Vector2.UnitX * 20f * NPC.direction, NPC.velocity, Mod.Find("OldDukeGore2").Type, NPC.scale); diff --git a/NPCs/OldDuke/OldDukeToothBall.cs b/NPCs/OldDuke/OldDukeToothBall.cs index 481b7c2a6e..be2fa69fef 100644 --- a/NPCs/OldDuke/OldDukeToothBall.cs +++ b/NPCs/OldDuke/OldDukeToothBall.cs @@ -264,7 +264,7 @@ namespace CalamityMod.NPCs.OldDuke Main.dust[toxicDust].noGravity = true; } - if (Main.netMode != NetmodeID.Server) + if (!Main.dedServ) { Gore.NewGore(NPC.GetSource_Death(), NPC.position, NPC.velocity, Mod.Find("OldDukeToothBallGore").Type, NPC.scale); Gore.NewGore(NPC.GetSource_Death(), NPC.position, NPC.velocity, Mod.Find("OldDukeToothBallGore2").Type, NPC.scale); diff --git a/NPCs/OldDuke/SulphurousSharkron.cs b/NPCs/OldDuke/SulphurousSharkron.cs index 85ec66d493..fd999977ae 100644 --- a/NPCs/OldDuke/SulphurousSharkron.cs +++ b/NPCs/OldDuke/SulphurousSharkron.cs @@ -317,7 +317,7 @@ namespace CalamityMod.NPCs.OldDuke Main.dust[bloody].velocity.X *= 2f; } - if (Main.netMode != NetmodeID.Server) + if (!Main.dedServ) { Gore.NewGore(NPC.GetSource_Death(), NPC.position, NPC.velocity, Mod.Find("SulphurousSharkronGore").Type, NPC.scale); Gore.NewGore(NPC.GetSource_Death(), NPC.position, NPC.velocity, Mod.Find("SulphurousSharkronGore2").Type, NPC.scale); diff --git a/NPCs/Other/LecherousOrb.cs b/NPCs/Other/LecherousOrb.cs index 8b339b269e..5d6d4e7e7d 100644 --- a/NPCs/Other/LecherousOrb.cs +++ b/NPCs/Other/LecherousOrb.cs @@ -118,7 +118,7 @@ namespace CalamityMod.NPCs.Other magic.noGravity = true; } - if (Main.netMode != NetmodeID.Server) + if (!Main.dedServ) { for (int i = 1; i <= 4; i++) Gore.NewGoreDirect(NPC.GetSource_Death(), NPC.Center, Main.rand.NextVector2Circular(3f, 3f), Mod.Find($"LecherousGore{i}").Type); diff --git a/NPCs/Other/THELORDE.cs b/NPCs/Other/THELORDE.cs index c197d7f2b7..360e1a19fa 100644 --- a/NPCs/Other/THELORDE.cs +++ b/NPCs/Other/THELORDE.cs @@ -179,7 +179,7 @@ namespace CalamityMod.NPCs.Other playerLOL.velocity.Y *= 0.99f; if (!DownedBossSystem.downedCalamitas && !DownedBossSystem.downedExoMechs) { - if (Main.netMode != NetmodeID.Server) + if (!Main.dedServ) { if (!playerLOL.dead && playerLOL.active) { diff --git a/NPCs/Perforator/PerforatorBodyLarge.cs b/NPCs/Perforator/PerforatorBodyLarge.cs index 31a00fe8ff..2154470e3a 100644 --- a/NPCs/Perforator/PerforatorBodyLarge.cs +++ b/NPCs/Perforator/PerforatorBodyLarge.cs @@ -208,7 +208,7 @@ namespace CalamityMod.NPCs.Perforator { Dust.NewDust(NPC.position, NPC.width, NPC.height, DustID.Blood, hit.HitDirection, -1f, 0, default, 1f); } - if (Main.netMode != NetmodeID.Server) + if (!Main.dedServ) { Gore.NewGore(NPC.GetSource_Death(), NPC.position, NPC.velocity, Mod.Find("LargePerf2").Type, NPC.scale); Gore.NewGore(NPC.GetSource_Death(), NPC.position, NPC.velocity, Mod.Find("LargePerf3").Type, NPC.scale); diff --git a/NPCs/Perforator/PerforatorBodyMedium.cs b/NPCs/Perforator/PerforatorBodyMedium.cs index 7cf12cca7c..a15339120e 100644 --- a/NPCs/Perforator/PerforatorBodyMedium.cs +++ b/NPCs/Perforator/PerforatorBodyMedium.cs @@ -144,7 +144,7 @@ namespace CalamityMod.NPCs.Perforator NPC.whoAmI = whoAmI2; } - if (!NPC.active && Main.netMode == NetmodeID.Server) + if (!NPC.active && Main.dedServ) NetMessage.SendData(MessageID.DamageNPC, -1, -1, null, NPC.whoAmI, -1f, 0f, 0f, 0, 0, 0); } @@ -262,7 +262,7 @@ namespace CalamityMod.NPCs.Perforator { Dust.NewDust(NPC.position, NPC.width, NPC.height, DustID.Blood, hit.HitDirection, -1f, 0, default, 1f); } - if (Main.netMode != NetmodeID.Server) + if (!Main.dedServ) { Gore.NewGore(NPC.GetSource_Death(), NPC.position, NPC.velocity, Mod.Find("MediumPerf2").Type, NPC.scale); Gore.NewGore(NPC.GetSource_Death(), NPC.position, NPC.velocity, Mod.Find("MediumPerf3").Type, NPC.scale); diff --git a/NPCs/Perforator/PerforatorBodySmall.cs b/NPCs/Perforator/PerforatorBodySmall.cs index af7efbb936..552626f6b9 100644 --- a/NPCs/Perforator/PerforatorBodySmall.cs +++ b/NPCs/Perforator/PerforatorBodySmall.cs @@ -204,7 +204,7 @@ namespace CalamityMod.NPCs.Perforator { Dust.NewDust(NPC.position, NPC.width, NPC.height, DustID.Blood, hit.HitDirection, -1f, 0, default, 1f); } - if (Main.netMode != NetmodeID.Server) + if (!Main.dedServ) { Gore.NewGore(NPC.GetSource_Death(), NPC.position, NPC.velocity, Mod.Find("SmallPerf2").Type, NPC.scale); } diff --git a/NPCs/Perforator/PerforatorHeadLarge.cs b/NPCs/Perforator/PerforatorHeadLarge.cs index 6896dab446..af7e943b92 100644 --- a/NPCs/Perforator/PerforatorHeadLarge.cs +++ b/NPCs/Perforator/PerforatorHeadLarge.cs @@ -574,7 +574,7 @@ namespace CalamityMod.NPCs.Perforator { Dust.NewDust(NPC.position, NPC.width, NPC.height, DustID.Blood, hit.HitDirection, -1f, 0, default, 1f); } - if (Main.netMode != NetmodeID.Server) + if (!Main.dedServ) { Gore.NewGore(NPC.GetSource_Death(), NPC.position, NPC.velocity, Mod.Find("LargePerf").Type, NPC.scale); Gore.NewGore(NPC.GetSource_Death(), NPC.position, NPC.velocity, Mod.Find("LargePerf2").Type, NPC.scale); diff --git a/NPCs/Perforator/PerforatorHeadMedium.cs b/NPCs/Perforator/PerforatorHeadMedium.cs index abe6f138cd..e3cf886284 100644 --- a/NPCs/Perforator/PerforatorHeadMedium.cs +++ b/NPCs/Perforator/PerforatorHeadMedium.cs @@ -174,7 +174,7 @@ namespace CalamityMod.NPCs.Perforator NetMessage.SendData(MessageID.DamageNPC, -1, -1, null, NPC.whoAmI, -1f, 0f, 0f, 0, 0, 0); } - if (!NPC.active && Main.netMode == NetmodeID.Server) + if (!NPC.active && Main.dedServ) NetMessage.SendData(MessageID.DamageNPC, -1, -1, null, NPC.whoAmI, -1f, 0f, 0f, 0, 0, 0); } @@ -499,7 +499,7 @@ namespace CalamityMod.NPCs.Perforator { Dust.NewDust(NPC.position, NPC.width, NPC.height, DustID.Blood, hit.HitDirection, -1f, 0, default, 1f); } - if (Main.netMode != NetmodeID.Server) + if (!Main.dedServ) { Gore.NewGore(NPC.GetSource_Death(), NPC.position, NPC.velocity, Mod.Find("MediumPerf").Type, NPC.scale); Gore.NewGore(NPC.GetSource_Death(), NPC.position, NPC.velocity, Mod.Find("MediumPerf2").Type, NPC.scale); diff --git a/NPCs/Perforator/PerforatorHeadSmall.cs b/NPCs/Perforator/PerforatorHeadSmall.cs index be6d04386d..1931ce9a48 100644 --- a/NPCs/Perforator/PerforatorHeadSmall.cs +++ b/NPCs/Perforator/PerforatorHeadSmall.cs @@ -533,7 +533,7 @@ namespace CalamityMod.NPCs.Perforator { Dust.NewDust(NPC.position, NPC.width, NPC.height, DustID.Blood, hit.HitDirection, -1f, 0, default, 1f); } - if (Main.netMode != NetmodeID.Server) + if (!Main.dedServ) { Gore.NewGore(NPC.GetSource_Death(), NPC.position, NPC.velocity, Mod.Find("SmallPerf").Type, NPC.scale); } diff --git a/NPCs/Perforator/PerforatorHive.cs b/NPCs/Perforator/PerforatorHive.cs index 230e7abc05..6968d2f8cc 100644 --- a/NPCs/Perforator/PerforatorHive.cs +++ b/NPCs/Perforator/PerforatorHive.cs @@ -629,7 +629,7 @@ namespace CalamityMod.NPCs.Perforator } if (NPC.life <= 0) { - if (Main.netMode != NetmodeID.Server) + if (!Main.dedServ) { Gore.NewGore(NPC.GetSource_Death(), NPC.position, NPC.velocity, Mod.Find("Hive").Type, 1f); Gore.NewGore(NPC.GetSource_Death(), NPC.position, NPC.velocity, Mod.Find("Hive2").Type, 1f); diff --git a/NPCs/Perforator/PerforatorTailLarge.cs b/NPCs/Perforator/PerforatorTailLarge.cs index 99ea4c7dbd..20cfe2cf62 100644 --- a/NPCs/Perforator/PerforatorTailLarge.cs +++ b/NPCs/Perforator/PerforatorTailLarge.cs @@ -199,7 +199,7 @@ namespace CalamityMod.NPCs.Perforator { Dust.NewDust(NPC.position, NPC.width, NPC.height, DustID.Blood, hit.HitDirection, -1f, 0, default, 1f); } - if (Main.netMode != NetmodeID.Server) + if (!Main.dedServ) { Gore.NewGore(NPC.GetSource_Death(), NPC.position, NPC.velocity, Mod.Find("LargePerf4").Type, NPC.scale); Gore.NewGore(NPC.GetSource_Death(), NPC.position, NPC.velocity, Mod.Find("LargePerf5").Type, NPC.scale); diff --git a/NPCs/Perforator/PerforatorTailMedium.cs b/NPCs/Perforator/PerforatorTailMedium.cs index ddc46d0d16..5363704b89 100644 --- a/NPCs/Perforator/PerforatorTailMedium.cs +++ b/NPCs/Perforator/PerforatorTailMedium.cs @@ -115,7 +115,7 @@ namespace CalamityMod.NPCs.Perforator NetMessage.SendData(MessageID.DamageNPC, -1, -1, null, NPC.whoAmI, -1f, 0f, 0f, 0, 0, 0); } - if (!NPC.active && Main.netMode == NetmodeID.Server) + if (!NPC.active && Main.dedServ) NetMessage.SendData(MessageID.DamageNPC, -1, -1, null, NPC.whoAmI, -1f, 0f, 0f, 0, 0, 0); } @@ -206,7 +206,7 @@ namespace CalamityMod.NPCs.Perforator { Dust.NewDust(NPC.position, NPC.width, NPC.height, DustID.Blood, hit.HitDirection, -1f, 0, default, 1f); } - if (Main.netMode != NetmodeID.Server) + if (!Main.dedServ) { Gore.NewGore(NPC.GetSource_Death(), NPC.position, NPC.velocity, Mod.Find("MediumPerf3").Type, NPC.scale); Gore.NewGore(NPC.GetSource_Death(), NPC.position, NPC.velocity, Mod.Find("MediumPerf4").Type, NPC.scale); diff --git a/NPCs/Perforator/PerforatorTailSmall.cs b/NPCs/Perforator/PerforatorTailSmall.cs index 43453de572..da90401b93 100644 --- a/NPCs/Perforator/PerforatorTailSmall.cs +++ b/NPCs/Perforator/PerforatorTailSmall.cs @@ -200,7 +200,7 @@ namespace CalamityMod.NPCs.Perforator { Dust.NewDust(NPC.position, NPC.width, NPC.height, DustID.Blood, hit.HitDirection, -1f, 0, default, 1f); } - if (Main.netMode != NetmodeID.Server) + if (!Main.dedServ) { Gore.NewGore(NPC.GetSource_Death(), NPC.position, NPC.velocity, Mod.Find("SmallPerf3").Type, NPC.scale); } diff --git a/NPCs/PlagueEnemies/Melter.cs b/NPCs/PlagueEnemies/Melter.cs index 1c30016023..4203d6ee5e 100644 --- a/NPCs/PlagueEnemies/Melter.cs +++ b/NPCs/PlagueEnemies/Melter.cs @@ -85,7 +85,7 @@ namespace CalamityMod.NPCs.PlagueEnemies { Dust.NewDust(NPC.position, NPC.width, NPC.height, (int)CalamityDusts.Plague, hit.HitDirection, -1f, 0, default, 1f); } - if (Main.netMode != NetmodeID.Server) + if (!Main.dedServ) { Gore.NewGore(NPC.GetSource_Death(), NPC.position, NPC.velocity, Mod.Find("Melter").Type, 1f); Gore.NewGore(NPC.GetSource_Death(), NPC.position, NPC.velocity, Mod.Find("Melter2").Type, 1f); diff --git a/NPCs/PlagueEnemies/PlagueCharger.cs b/NPCs/PlagueEnemies/PlagueCharger.cs index 0b5fe1a1b1..54f956edec 100644 --- a/NPCs/PlagueEnemies/PlagueCharger.cs +++ b/NPCs/PlagueEnemies/PlagueCharger.cs @@ -153,7 +153,7 @@ namespace CalamityMod.NPCs.PlagueEnemies { Dust.NewDust(NPC.position, NPC.width, NPC.height, (int)CalamityDusts.Plague, hit.HitDirection, -1f, 0, default, 1f); } - if (Main.netMode != NetmodeID.Server) + if (!Main.dedServ) { Gore.NewGore(NPC.GetSource_Death(), NPC.position, NPC.velocity, Mod.Find("PlagueCharger").Type, 0.5f); Gore.NewGore(NPC.GetSource_Death(), NPC.position, NPC.velocity, Mod.Find("PlagueCharger2").Type, 0.5f); diff --git a/NPCs/PlagueEnemies/PlagueChargerLarge.cs b/NPCs/PlagueEnemies/PlagueChargerLarge.cs index 3511ff8ffc..dad5fb445f 100644 --- a/NPCs/PlagueEnemies/PlagueChargerLarge.cs +++ b/NPCs/PlagueEnemies/PlagueChargerLarge.cs @@ -148,7 +148,7 @@ namespace CalamityMod.NPCs.PlagueEnemies { Dust.NewDust(NPC.position, NPC.width, NPC.height, (int)CalamityDusts.Plague, hit.HitDirection, -1f, 0, default, 1f); } - if (Main.netMode != NetmodeID.Server) + if (!Main.dedServ) { Gore.NewGore(NPC.GetSource_Death(), NPC.position, NPC.velocity, Mod.Find("PlagueCharger").Type, 0.75f); Gore.NewGore(NPC.GetSource_Death(), NPC.position, NPC.velocity, Mod.Find("PlagueCharger2").Type, 0.75f); diff --git a/NPCs/PlagueEnemies/PlaguebringerMiniboss.cs b/NPCs/PlagueEnemies/PlaguebringerMiniboss.cs index 42aaffb6f7..db13bc4c31 100644 --- a/NPCs/PlagueEnemies/PlaguebringerMiniboss.cs +++ b/NPCs/PlagueEnemies/PlaguebringerMiniboss.cs @@ -370,7 +370,7 @@ namespace CalamityMod.NPCs.PlagueEnemies } } - if (Main.netMode == NetmodeID.Server) + if (Main.dedServ) NetMessage.SendData(MessageID.SyncNPC, -1, -1, null, NPC.whoAmI); } diff --git a/NPCs/PlagueEnemies/Plagueshell.cs b/NPCs/PlagueEnemies/Plagueshell.cs index c13bcb2203..9e5acf2b08 100644 --- a/NPCs/PlagueEnemies/Plagueshell.cs +++ b/NPCs/PlagueEnemies/Plagueshell.cs @@ -73,7 +73,7 @@ namespace CalamityMod.NPCs.PlagueEnemies { Dust.NewDust(NPC.position, NPC.width, NPC.height, (int)CalamityDusts.Plague, hit.HitDirection, -1f, 0, default, 1f); } - if (Main.netMode != NetmodeID.Server) + if (!Main.dedServ) { Gore.NewGore(NPC.GetSource_Death(), NPC.position, NPC.velocity, Mod.Find("Plagueshell").Type, 1f); Gore.NewGore(NPC.GetSource_Death(), NPC.position, NPC.velocity, Mod.Find("Plagueshell2").Type, 1f); diff --git a/NPCs/PlagueEnemies/Viruling.cs b/NPCs/PlagueEnemies/Viruling.cs index c3ea3971ac..d2c2f4d31f 100644 --- a/NPCs/PlagueEnemies/Viruling.cs +++ b/NPCs/PlagueEnemies/Viruling.cs @@ -200,7 +200,7 @@ namespace CalamityMod.NPCs.PlagueEnemies { Dust.NewDust(NPC.position, NPC.width, NPC.height, (int)CalamityDusts.Plague, hit.HitDirection, -1f, 0, default, 1f); } - if (Main.netMode != NetmodeID.Server) + if (!Main.dedServ) { Gore.NewGore(NPC.GetSource_Death(), NPC.position, NPC.velocity, Mod.Find("Viruling").Type, 1f); Gore.NewGore(NPC.GetSource_Death(), NPC.position, NPC.velocity, Mod.Find("Viruling2").Type, 1f); diff --git a/NPCs/PlaguebringerGoliath/PlaguebringerGoliath.cs b/NPCs/PlaguebringerGoliath/PlaguebringerGoliath.cs index f30c1fad8d..b58379bc2f 100644 --- a/NPCs/PlaguebringerGoliath/PlaguebringerGoliath.cs +++ b/NPCs/PlaguebringerGoliath/PlaguebringerGoliath.cs @@ -1206,7 +1206,7 @@ namespace CalamityMod.NPCs.PlaguebringerGoliath if (NPC.life <= 0) { - if (Main.netMode != NetmodeID.Server) + if (!Main.dedServ) { for (int i = 1; i < 7; i++) Gore.NewGore(NPC.GetSource_Death(), NPC.position, NPC.velocity, Mod.Find("PlaguebringerGoliathGore" + i).Type, NPC.scale); diff --git a/NPCs/Polterghast/PolterPhantom.cs b/NPCs/Polterghast/PolterPhantom.cs index 5364fb0369..a4edf865e1 100644 --- a/NPCs/Polterghast/PolterPhantom.cs +++ b/NPCs/Polterghast/PolterPhantom.cs @@ -429,7 +429,7 @@ namespace CalamityMod.NPCs.Polterghast if (NPC.netSpam > 10) NPC.netSpam = 10; - if (Main.netMode == NetmodeID.Server) + if (Main.dedServ) NetMessage.SendData(MessageID.SyncNPC, -1, -1, null, NPC.whoAmI, 0f, 0f, 0f, 0, 0, 0); } } diff --git a/NPCs/Polterghast/Polterghast.cs b/NPCs/Polterghast/Polterghast.cs index d260773234..05b54428c9 100644 --- a/NPCs/Polterghast/Polterghast.cs +++ b/NPCs/Polterghast/Polterghast.cs @@ -662,7 +662,7 @@ namespace CalamityMod.NPCs.Polterghast if (NPC.netSpam > 10) NPC.netSpam = 10; - if (Main.netMode == NetmodeID.Server) + if (Main.dedServ) NetMessage.SendData(MessageID.SyncNPC, -1, -1, null, NPC.whoAmI, 0f, 0f, 0f, 0, 0, 0); } @@ -746,7 +746,7 @@ namespace CalamityMod.NPCs.Polterghast SoundEngine.PlaySound(P2Sound, NPC.Center); - if (Main.netMode != NetmodeID.Server) + if (!Main.dedServ) { Gore.NewGore(NPC.GetSource_FromAI(), NPC.position, NPC.velocity, Mod.Find("Polt").Type, 1f); Gore.NewGore(NPC.GetSource_FromAI(), NPC.position, NPC.velocity, Mod.Find("Polt2").Type, 1f); @@ -867,7 +867,7 @@ namespace CalamityMod.NPCs.Polterghast SoundEngine.PlaySound(P3Sound, NPC.Center); - if (Main.netMode != NetmodeID.Server) + if (!Main.dedServ) { Gore.NewGore(NPC.GetSource_FromAI(), NPC.position, NPC.velocity, Mod.Find("Polt").Type, 1f); Gore.NewGore(NPC.GetSource_FromAI(), NPC.position, NPC.velocity, Mod.Find("Polt2").Type, 1f); diff --git a/NPCs/PrimordialWyrm/PrimordialWyrmBody.cs b/NPCs/PrimordialWyrm/PrimordialWyrmBody.cs index eaf87ad7e4..b635cbdc8f 100644 --- a/NPCs/PrimordialWyrm/PrimordialWyrmBody.cs +++ b/NPCs/PrimordialWyrm/PrimordialWyrmBody.cs @@ -191,7 +191,7 @@ namespace CalamityMod.NPCs.PrimordialWyrm for (int k = 0; k < 10; k++) Dust.NewDust(NPC.position, NPC.width, NPC.height, DustID.TintableDust, hit.HitDirection, -1f, 0, default, 1f); - if (Main.netMode != NetmodeID.Server) + if (!Main.dedServ) { Gore.NewGore(NPC.GetSource_Death(), NPC.Center, NPC.velocity, Mod.Find("PrimordialWyrm2").Type, 1f); } diff --git a/NPCs/PrimordialWyrm/PrimordialWyrmBodyAlt.cs b/NPCs/PrimordialWyrm/PrimordialWyrmBodyAlt.cs index c6b9ee2bd8..9a0da979d5 100644 --- a/NPCs/PrimordialWyrm/PrimordialWyrmBodyAlt.cs +++ b/NPCs/PrimordialWyrm/PrimordialWyrmBodyAlt.cs @@ -190,7 +190,7 @@ namespace CalamityMod.NPCs.PrimordialWyrm for (int k = 0; k < 10; k++) Dust.NewDust(NPC.position, NPC.width, NPC.height, DustID.TintableDust, hit.HitDirection, -1f, 0, default, 1f); - if (Main.netMode != NetmodeID.Server) + if (!Main.dedServ) { Gore.NewGore(NPC.GetSource_Death(), NPC.Center, NPC.velocity, Mod.Find("PrimordialWyrm3").Type, 1f); } diff --git a/NPCs/PrimordialWyrm/PrimordialWyrmHead.cs b/NPCs/PrimordialWyrm/PrimordialWyrmHead.cs index 6314210647..76d4d11e0d 100644 --- a/NPCs/PrimordialWyrm/PrimordialWyrmHead.cs +++ b/NPCs/PrimordialWyrm/PrimordialWyrmHead.cs @@ -1469,7 +1469,7 @@ namespace CalamityMod.NPCs.PrimordialWyrm public override void HitEffect(NPC.HitInfo hit) { // Create gore and dust hit effects. - if (Main.netMode == NetmodeID.Server) + if (Main.dedServ) return; for (int k = 0; k < 15; k++) diff --git a/NPCs/PrimordialWyrm/PrimordialWyrmTail.cs b/NPCs/PrimordialWyrm/PrimordialWyrmTail.cs index b77c37a7da..5cdbb2c483 100644 --- a/NPCs/PrimordialWyrm/PrimordialWyrmTail.cs +++ b/NPCs/PrimordialWyrm/PrimordialWyrmTail.cs @@ -152,7 +152,7 @@ namespace CalamityMod.NPCs.PrimordialWyrm for (int k = 0; k < 10; k++) Dust.NewDust(NPC.position, NPC.width, NPC.height, DustID.TintableDust, hit.HitDirection, -1f, 0, default, 1f); - if (Main.netMode != NetmodeID.Server) + if (!Main.dedServ) { Gore.NewGore(NPC.GetSource_Death(), NPC.Center, NPC.velocity, Mod.Find("PrimordialWyrm4").Type, 1f); } diff --git a/NPCs/ProfanedGuardians/ProfanedGuardianCommander.cs b/NPCs/ProfanedGuardians/ProfanedGuardianCommander.cs index 2b8c31ad55..82243838f3 100644 --- a/NPCs/ProfanedGuardians/ProfanedGuardianCommander.cs +++ b/NPCs/ProfanedGuardians/ProfanedGuardianCommander.cs @@ -1289,7 +1289,7 @@ namespace CalamityMod.NPCs.ProfanedGuardians if (NPC.life <= 0) { - if (Main.netMode != NetmodeID.Server) + if (!Main.dedServ) { Gore.NewGore(NPC.GetSource_Death(), NPC.position, NPC.velocity, Mod.Find("ProfanedGuardianBossA").Type, 1f); Gore.NewGore(NPC.GetSource_Death(), NPC.position, NPC.velocity, Mod.Find("ProfanedGuardianBossA2").Type, 1f); diff --git a/NPCs/ProfanedGuardians/ProfanedGuardianDefender.cs b/NPCs/ProfanedGuardians/ProfanedGuardianDefender.cs index e9edd8fa51..d15b591dfc 100644 --- a/NPCs/ProfanedGuardians/ProfanedGuardianDefender.cs +++ b/NPCs/ProfanedGuardians/ProfanedGuardianDefender.cs @@ -974,7 +974,7 @@ namespace CalamityMod.NPCs.ProfanedGuardians if (NPC.life <= 0) { - if (Main.netMode != NetmodeID.Server) + if (!Main.dedServ) { Gore.NewGore(NPC.GetSource_Death(), NPC.position, NPC.velocity, Mod.Find("ProfanedGuardianBossT").Type, 1f); Gore.NewGore(NPC.GetSource_Death(), NPC.position, NPC.velocity, Mod.Find("ProfanedGuardianBossT2").Type, 1f); diff --git a/NPCs/ProfanedGuardians/ProfanedGuardianHealer.cs b/NPCs/ProfanedGuardians/ProfanedGuardianHealer.cs index 7b1e989a5b..1ea8449522 100644 --- a/NPCs/ProfanedGuardians/ProfanedGuardianHealer.cs +++ b/NPCs/ProfanedGuardians/ProfanedGuardianHealer.cs @@ -581,7 +581,7 @@ namespace CalamityMod.NPCs.ProfanedGuardians if (NPC.life <= 0) { - if (Main.netMode != NetmodeID.Server) + if (!Main.dedServ) { Gore.NewGore(NPC.GetSource_Death(), NPC.position, NPC.velocity, Mod.Find("ProfanedGuardianBossH").Type, 1f); Gore.NewGore(NPC.GetSource_Death(), NPC.position, NPC.velocity, Mod.Find("ProfanedGuardianBossH2").Type, 1f); diff --git a/NPCs/ProfanedGuardians/ProfanedRocks.cs b/NPCs/ProfanedGuardians/ProfanedRocks.cs index 51c9797dd8..cf2bb60939 100644 --- a/NPCs/ProfanedGuardians/ProfanedRocks.cs +++ b/NPCs/ProfanedGuardians/ProfanedRocks.cs @@ -375,7 +375,7 @@ namespace CalamityMod.NPCs.ProfanedGuardians if (NPC.life <= 0) { - if (Main.netMode != NetmodeID.Server) + if (!Main.dedServ) { int npcType = (int)NPC.ai[2]; Gore.NewGore(NPC.GetSource_Death(), NPC.position, NPC.velocity, Mod.Find("ProfanedRocksGore" + npcType.ToString()).Type, NPC.scale); diff --git a/NPCs/Providence/ProvSpawnDefense.cs b/NPCs/Providence/ProvSpawnDefense.cs index 50032de198..378213ad2d 100644 --- a/NPCs/Providence/ProvSpawnDefense.cs +++ b/NPCs/Providence/ProvSpawnDefense.cs @@ -179,7 +179,7 @@ namespace CalamityMod.NPCs.Providence if (NPC.life <= 0) { - if (Main.netMode != NetmodeID.Server) + if (!Main.dedServ) { Gore.NewGore(NPC.GetSource_Death(), NPC.position, NPC.velocity, Mod.Find("ProfanedGuardianBossT").Type, 1f); Gore.NewGore(NPC.GetSource_Death(), NPC.position, NPC.velocity, Mod.Find("ProfanedGuardianBossT2").Type, 1f); diff --git a/NPCs/Providence/ProvSpawnHealer.cs b/NPCs/Providence/ProvSpawnHealer.cs index f17852ea4c..a89548e32b 100644 --- a/NPCs/Providence/ProvSpawnHealer.cs +++ b/NPCs/Providence/ProvSpawnHealer.cs @@ -188,7 +188,7 @@ namespace CalamityMod.NPCs.Providence if (NPC.life <= 0) { - if (Main.netMode != NetmodeID.Server) + if (!Main.dedServ) { Gore.NewGore(NPC.GetSource_Death(), NPC.position, NPC.velocity, Mod.Find("ProfanedGuardianBossH").Type, 1f); Gore.NewGore(NPC.GetSource_Death(), NPC.position, NPC.velocity, Mod.Find("ProfanedGuardianBossH2").Type, 1f); diff --git a/NPCs/Providence/ProvSpawnOffense.cs b/NPCs/Providence/ProvSpawnOffense.cs index 926df177f7..2466f1a134 100644 --- a/NPCs/Providence/ProvSpawnOffense.cs +++ b/NPCs/Providence/ProvSpawnOffense.cs @@ -181,7 +181,7 @@ namespace CalamityMod.NPCs.Providence if (NPC.life <= 0) { - if (Main.netMode != NetmodeID.Server) + if (!Main.dedServ) { Gore.NewGore(NPC.GetSource_Death(), NPC.position, NPC.velocity, Mod.Find("ProfanedGuardianBossA").Type, 1f); Gore.NewGore(NPC.GetSource_Death(), NPC.position, NPC.velocity, Mod.Find("ProfanedGuardianBossA2").Type, 1f); diff --git a/NPCs/Providence/Providence.cs b/NPCs/Providence/Providence.cs index bb26b3efe7..940b325702 100644 --- a/NPCs/Providence/Providence.cs +++ b/NPCs/Providence/Providence.cs @@ -328,7 +328,7 @@ namespace CalamityMod.NPCs.Providence NPC.Calamity().newAI[i] = reader.ReadSingle(); // Be sure to inform clients of the fact that Providence is dying if only the server recieved this packet. - if (Main.netMode == NetmodeID.Server && !wasDyingBefore && Dying) + if (Main.dedServ && !wasDyingBefore && Dying) { NPC.netSpam = 0; NPC.netUpdate = true; @@ -1415,7 +1415,7 @@ namespace CalamityMod.NPCs.Providence // Inflict Icarus Folly if (NPC.ai[3] >= (phaseTime * 2f)) { - if (Main.netMode != NetmodeID.Server) + if (!Main.dedServ) { Player player2 = Main.player[Main.myPlayer]; bool inLiquid = (player2.wet || player2.honeyWet) && !player2.lavaWet; @@ -1825,7 +1825,7 @@ namespace CalamityMod.NPCs.Providence // Play an animation sound immediately. Also delete various projectiles. if (DeathAnimationTimer == 1f) { - if (Main.netMode != NetmodeID.Server && Main.LocalPlayer.WithinRange(NPC.Center, 4800f)) + if (!Main.dedServ && Main.LocalPlayer.WithinRange(NPC.Center, 4800f)) SoundEngine.PlaySound(DeathAnimationSound with { Volume = 1.65f }); DespawnSpecificProjectiles(); @@ -1900,7 +1900,7 @@ namespace CalamityMod.NPCs.Providence } // Do periodic syncs. - if (Main.netMode == NetmodeID.Server && DeathAnimationTimer % 45f == 44f) + if (Main.dedServ && DeathAnimationTimer % 45f == 44f) { NPC.netUpdate = true; @@ -2668,7 +2668,7 @@ namespace CalamityMod.NPCs.Providence if (NPC.life <= 0) { - if (Main.netMode != NetmodeID.Server) + if (!Main.dedServ) { float randomSpread = Main.rand.Next(-200, 201) / 100f; Gore.NewGore(NPC.GetSource_Death(), NPC.position, NPC.velocity * randomSpread * Main.rand.NextFloat(), Mod.Find("Providence").Type, NPC.scale); diff --git a/NPCs/Ravager/RavagerBody.cs b/NPCs/Ravager/RavagerBody.cs index 55c78cf3b1..ecdd062587 100644 --- a/NPCs/Ravager/RavagerBody.cs +++ b/NPCs/Ravager/RavagerBody.cs @@ -229,7 +229,7 @@ namespace CalamityMod.NPCs.Ravager NPC.dontTakeDamage = true; if (bossRush) { - if (Main.netMode != NetmodeID.Server) + if (!Main.dedServ) { if (!Main.player[Main.myPlayer].dead && Main.player[Main.myPlayer].active && revenge) Main.player[Main.myPlayer].AddBuff(ModContent.BuffType(), 2); @@ -239,7 +239,7 @@ namespace CalamityMod.NPCs.Ravager else { NPC.dontTakeDamage = false; - if (Main.netMode != NetmodeID.Server) + if (!Main.dedServ) { if (!Main.player[Main.myPlayer].dead && Main.player[Main.myPlayer].active && revenge) Main.player[Main.myPlayer].AddBuff(ModContent.BuffType(), 2); @@ -666,7 +666,7 @@ namespace CalamityMod.NPCs.Ravager Main.dust[stompDust].velocity *= 0.2f; } - if (Main.netMode != NetmodeID.Server) + if (!Main.dedServ) { int stompGore = Gore.NewGore(NPC.GetSource_FromAI(), new Vector2(stompDustArea - 30, NPC.position.Y + NPC.height - 12f), default, Main.rand.Next(61, 64), 1f); Main.gore[stompGore].velocity *= 0.4f; @@ -925,7 +925,7 @@ namespace CalamityMod.NPCs.Ravager } if (NPC.life <= 0) { - if (Main.netMode != NetmodeID.Server) + if (!Main.dedServ) { Gore.NewGore(NPC.GetSource_Death(), NPC.position, NPC.velocity, Mod.Find("ScavengerBody").Type, 1f); Gore.NewGore(NPC.GetSource_Death(), NPC.position, NPC.velocity, Mod.Find("ScavengerBody2").Type, 1f); diff --git a/NPCs/Ravager/RavagerClawLeft.cs b/NPCs/Ravager/RavagerClawLeft.cs index f637a501b5..d891497c47 100644 --- a/NPCs/Ravager/RavagerClawLeft.cs +++ b/NPCs/Ravager/RavagerClawLeft.cs @@ -335,7 +335,7 @@ namespace CalamityMod.NPCs.Ravager } else { - if (Main.netMode != NetmodeID.Server) + if (!Main.dedServ) { Gore.NewGore(NPC.GetSource_Death(), NPC.position, NPC.velocity, Mod.Find("ScavengerClawLeft").Type, 1f); Gore.NewGore(NPC.GetSource_Death(), NPC.position, NPC.velocity, Mod.Find("ScavengerClawLeft2").Type, 1f); diff --git a/NPCs/Ravager/RavagerClawRight.cs b/NPCs/Ravager/RavagerClawRight.cs index 981aad45b2..731b46802d 100644 --- a/NPCs/Ravager/RavagerClawRight.cs +++ b/NPCs/Ravager/RavagerClawRight.cs @@ -336,7 +336,7 @@ namespace CalamityMod.NPCs.Ravager } else { - if (Main.netMode != NetmodeID.Server) + if (!Main.dedServ) { Gore.NewGore(NPC.GetSource_Death(), NPC.position, NPC.velocity, Mod.Find("ScavengerClawRight").Type, 1f); Gore.NewGore(NPC.GetSource_Death(), NPC.position, NPC.velocity, Mod.Find("ScavengerClawRight2").Type, 1f); diff --git a/NPCs/Ravager/RavagerHead2.cs b/NPCs/Ravager/RavagerHead2.cs index 376ffdb2d5..f33e45eb6e 100644 --- a/NPCs/Ravager/RavagerHead2.cs +++ b/NPCs/Ravager/RavagerHead2.cs @@ -198,7 +198,7 @@ namespace CalamityMod.NPCs.Ravager } if (NPC.life <= 0) { - if (Main.netMode != NetmodeID.Server) + if (!Main.dedServ) { Gore.NewGore(NPC.GetSource_Death(), NPC.position, NPC.velocity, Mod.Find("ScavengerHead").Type, 1f); Gore.NewGore(NPC.GetSource_Death(), NPC.position, NPC.velocity, Mod.Find("ScavengerHead2").Type, 1f); diff --git a/NPCs/Ravager/RavagerLegLeft.cs b/NPCs/Ravager/RavagerLegLeft.cs index f344ab45ce..14e5723fe7 100644 --- a/NPCs/Ravager/RavagerLegLeft.cs +++ b/NPCs/Ravager/RavagerLegLeft.cs @@ -81,7 +81,7 @@ namespace CalamityMod.NPCs.Ravager } if (NPC.life <= 0) { - if (Main.netMode != NetmodeID.Server) + if (!Main.dedServ) { Gore.NewGore(NPC.GetSource_Death(), NPC.position, NPC.velocity, Mod.Find("ScavengerLegLeft").Type, 1f); Gore.NewGore(NPC.GetSource_Death(), NPC.position, NPC.velocity, Mod.Find("ScavengerLegLeft2").Type, 1f); diff --git a/NPCs/Ravager/RavagerLegRight.cs b/NPCs/Ravager/RavagerLegRight.cs index 31aed5da5b..b3be683e4a 100644 --- a/NPCs/Ravager/RavagerLegRight.cs +++ b/NPCs/Ravager/RavagerLegRight.cs @@ -83,7 +83,7 @@ namespace CalamityMod.NPCs.Ravager } if (NPC.life <= 0) { - if (Main.netMode != NetmodeID.Server) + if (!Main.dedServ) { Gore.NewGore(NPC.GetSource_Death(), NPC.position, NPC.velocity, Mod.Find("ScavengerLegRight").Type, 1f); Gore.NewGore(NPC.GetSource_Death(), NPC.position, NPC.velocity, Mod.Find("ScavengerLegRight2").Type, 1f); diff --git a/NPCs/Ravager/RockPillar.cs b/NPCs/Ravager/RockPillar.cs index 547b6ffe4a..4170c15cf3 100644 --- a/NPCs/Ravager/RockPillar.cs +++ b/NPCs/Ravager/RockPillar.cs @@ -178,7 +178,7 @@ namespace CalamityMod.NPCs.Ravager Main.dust[rockDust2].velocity *= 2f; } - if (Main.netMode != NetmodeID.Server) + if (!Main.dedServ) { float y = NPC.height / 6f; float randomVelocityScale = 0.25f; diff --git a/NPCs/Signus/Signus.cs b/NPCs/Signus/Signus.cs index 764e71dba2..344b2dbdec 100644 --- a/NPCs/Signus/Signus.cs +++ b/NPCs/Signus/Signus.cs @@ -392,21 +392,21 @@ namespace CalamityMod.NPCs.Signus SoundEngine.PlaySound(SoundID.Item122, NPC.Center); int cosmicMineSpawn = NPC.NewNPC(NPC.GetSource_FromAI(), (int)(player.position.X + 750f), (int)player.position.Y, ModContent.NPCType()); - if (Main.netMode == NetmodeID.Server) + if (Main.dedServ) NetMessage.SendData(MessageID.SyncNPC, -1, -1, null, cosmicMineSpawn, 0f, 0f, 0f, 0, 0, 0); int cosmicMineSpawn2 = NPC.NewNPC(NPC.GetSource_FromAI(), (int)(player.position.X - 750f), (int)player.position.Y, ModContent.NPCType()); - if (Main.netMode == NetmodeID.Server) + if (Main.dedServ) NetMessage.SendData(MessageID.SyncNPC, -1, -1, null, cosmicMineSpawn2, 0f, 0f, 0f, 0, 0, 0); if (stealthTimer >= maxStealth) { int stealthCosmicMine = NPC.NewNPC(NPC.GetSource_FromAI(), (int)(player.position.X + 950f), (int)player.position.Y, ModContent.NPCType()); - if (Main.netMode == NetmodeID.Server) + if (Main.dedServ) NetMessage.SendData(MessageID.SyncNPC, -1, -1, null, stealthCosmicMine, 0f, 0f, 0f, 0, 0, 0); int stealthCosmicMine2 = NPC.NewNPC(NPC.GetSource_FromAI(), (int)(player.position.X - 950f), (int)player.position.Y, ModContent.NPCType()); - if (Main.netMode == NetmodeID.Server) + if (Main.dedServ) NetMessage.SendData(MessageID.SyncNPC, -1, -1, null, stealthCosmicMine2, 0f, 0f, 0f, 0, 0, 0); SoundEngine.PlaySound(RaidersTalisman.StealthHitSound, NPC.Center); @@ -590,21 +590,21 @@ namespace CalamityMod.NPCs.Signus type = ModContent.NPCType(); } int cosmicMineSpawn = NPC.NewNPC(NPC.GetSource_FromAI(), (int)(player.position.X + spawnX), (int)(player.position.Y + spawnY), type); - if (Main.netMode == NetmodeID.Server) + if (Main.dedServ) NetMessage.SendData(MessageID.SyncNPC, -1, -1, null, cosmicMineSpawn, 0f, 0f, 0f, 0, 0, 0); int cosmicMineSpawn2 = NPC.NewNPC(NPC.GetSource_FromAI(), (int)(player.position.X - spawnX), (int)(player.position.Y + spawnY), type); - if (Main.netMode == NetmodeID.Server) + if (Main.dedServ) NetMessage.SendData(MessageID.SyncNPC, -1, -1, null, cosmicMineSpawn2, 0f, 0f, 0f, 0, 0, 0); if (buffed) { int stealthCosmicMine = NPC.NewNPC(NPC.GetSource_FromAI(), (int)(player.position.X + spawnX + spawnX / 2), (int)(player.position.Y + spawnY), ModContent.NPCType()); - if (Main.netMode == NetmodeID.Server) + if (Main.dedServ) NetMessage.SendData(MessageID.SyncNPC, -1, -1, null, stealthCosmicMine, 0f, 0f, 0f, 0, 0, 0); int stealthCosmicMine2 = NPC.NewNPC(NPC.GetSource_FromAI(), (int)(player.position.X - spawnX - spawnX / 2), (int)(player.position.Y + spawnY), ModContent.NPCType()); - if (Main.netMode == NetmodeID.Server) + if (Main.dedServ) NetMessage.SendData(MessageID.SyncNPC, -1, -1, null, stealthCosmicMine2, 0f, 0f, 0f, 0, 0, 0); } @@ -1019,7 +1019,7 @@ namespace CalamityMod.NPCs.Signus teleportDust2 = Dust.NewDust(NPC.position, NPC.width, NPC.height, (int)CalamityDusts.PurpleCosmilite, 0f, 0f, 100, default, 2f); Main.dust[teleportDust2].velocity *= 2f; } - if (Main.netMode != NetmodeID.Server) + if (!Main.dedServ) { float randomSpread = Main.rand.Next(-200, 201) / 100f; Gore.NewGore(NPC.GetSource_Death(), NPC.position, NPC.velocity * randomSpread, Mod.Find("Signus").Type, 1f); diff --git a/NPCs/SlimeGod/CrimulanPaladin.cs b/NPCs/SlimeGod/CrimulanPaladin.cs index 313f3ef9b4..a91575514b 100644 --- a/NPCs/SlimeGod/CrimulanPaladin.cs +++ b/NPCs/SlimeGod/CrimulanPaladin.cs @@ -795,7 +795,7 @@ namespace CalamityMod.NPCs.SlimeGod Main.npc[slimeSpawn].velocity.Y = (float)Main.rand.Next(-30, 1) * 0.1f; Main.npc[slimeSpawn].ai[0] = (float)(-1000 * Main.rand.Next(3)); Main.npc[slimeSpawn].ai[1] = 0f; - if (Main.netMode == NetmodeID.Server && slimeSpawn < Main.maxNPCs) + if (Main.dedServ && slimeSpawn < Main.maxNPCs) NetMessage.SendData(MessageID.SyncNPC, -1, -1, null, slimeSpawn, 0f, 0f, 0f, 0, 0, 0); } } diff --git a/NPCs/SlimeGod/EbonianPaladin.cs b/NPCs/SlimeGod/EbonianPaladin.cs index a0a6ddea2b..47c4f0e1cf 100644 --- a/NPCs/SlimeGod/EbonianPaladin.cs +++ b/NPCs/SlimeGod/EbonianPaladin.cs @@ -498,7 +498,7 @@ namespace CalamityMod.NPCs.SlimeGod Main.npc[slimeSpawn].velocity.Y = (float)Main.rand.Next(-30, 1) * 0.1f; Main.npc[slimeSpawn].ai[0] = (float)(-1000 * Main.rand.Next(3)); Main.npc[slimeSpawn].ai[1] = 0f; - if (Main.netMode == NetmodeID.Server && slimeSpawn < Main.maxNPCs) + if (Main.dedServ && slimeSpawn < Main.maxNPCs) NetMessage.SendData(MessageID.SyncNPC, -1, -1, null, slimeSpawn); } } diff --git a/NPCs/SlimeGod/SplitCrimulanPaladin.cs b/NPCs/SlimeGod/SplitCrimulanPaladin.cs index ecdcd2f6f5..0de260db20 100644 --- a/NPCs/SlimeGod/SplitCrimulanPaladin.cs +++ b/NPCs/SlimeGod/SplitCrimulanPaladin.cs @@ -743,7 +743,7 @@ namespace CalamityMod.NPCs.SlimeGod Main.npc[slimeSpawn].velocity.Y = (float)Main.rand.Next(-30, 1) * 0.1f; Main.npc[slimeSpawn].ai[0] = (float)(-1000 * Main.rand.Next(3)); Main.npc[slimeSpawn].ai[1] = 0f; - if (Main.netMode == NetmodeID.Server && slimeSpawn < Main.maxNPCs) + if (Main.dedServ && slimeSpawn < Main.maxNPCs) NetMessage.SendData(MessageID.SyncNPC, -1, -1, null, slimeSpawn, 0f, 0f, 0f, 0, 0, 0); } } diff --git a/NPCs/SlimeGod/SplitEbonianPaladin.cs b/NPCs/SlimeGod/SplitEbonianPaladin.cs index 6429f58f7f..727a4065b5 100644 --- a/NPCs/SlimeGod/SplitEbonianPaladin.cs +++ b/NPCs/SlimeGod/SplitEbonianPaladin.cs @@ -787,7 +787,7 @@ namespace CalamityMod.NPCs.SlimeGod Main.npc[slimeSpawn].velocity.Y = (float)Main.rand.Next(-30, 1) * 0.1f; Main.npc[slimeSpawn].ai[0] = (float)(-1000 * Main.rand.Next(3)); Main.npc[slimeSpawn].ai[1] = 0f; - if (Main.netMode == NetmodeID.Server && slimeSpawn < Main.maxNPCs) + if (Main.dedServ && slimeSpawn < Main.maxNPCs) NetMessage.SendData(MessageID.SyncNPC, -1, -1, null, slimeSpawn, 0f, 0f, 0f, 0, 0, 0); } } diff --git a/NPCs/StormWeaver/StormWeaverBody.cs b/NPCs/StormWeaver/StormWeaverBody.cs index 409b7a4294..90e0b51f13 100644 --- a/NPCs/StormWeaver/StormWeaverBody.cs +++ b/NPCs/StormWeaver/StormWeaverBody.cs @@ -124,7 +124,7 @@ namespace CalamityMod.NPCs.StormWeaver NPC.Calamity().VulnerableToCold = true; NPC.Calamity().VulnerableToSickness = true; - if (Main.netMode != NetmodeID.Server) + if (!Main.dedServ) { Gore.NewGore(NPC.GetSource_FromAI(), NPC.position, NPC.velocity, Mod.Find("SWArmorBody1").Type, NPC.scale); Gore.NewGore(NPC.GetSource_FromAI(), NPC.position, NPC.velocity, Mod.Find("SWArmorBody2").Type, NPC.scale); @@ -329,7 +329,7 @@ namespace CalamityMod.NPCs.StormWeaver if (NPC.life <= 0) { - if (Main.netMode != NetmodeID.Server) + if (!Main.dedServ) { Gore.NewGore(NPC.GetSource_Death(), NPC.position, NPC.velocity, Mod.Find("SWNudeBody1").Type, NPC.scale); Gore.NewGore(NPC.GetSource_Death(), NPC.position, NPC.velocity, Mod.Find("SWNudeBody2").Type, NPC.scale); diff --git a/NPCs/StormWeaver/StormWeaverHead.cs b/NPCs/StormWeaver/StormWeaverHead.cs index a3e45d207f..1d4f47cbf9 100644 --- a/NPCs/StormWeaver/StormWeaverHead.cs +++ b/NPCs/StormWeaver/StormWeaverHead.cs @@ -201,7 +201,7 @@ namespace CalamityMod.NPCs.StormWeaver NPC.Calamity().VulnerableToCold = true; NPC.Calamity().VulnerableToSickness = true; - if (Main.netMode != NetmodeID.Server) + if (!Main.dedServ) Gore.NewGore(NPC.GetSource_FromAI(), NPC.position, NPC.velocity, Mod.Find("SWArmorHead1").Type, NPC.scale); SoundEngine.PlaySound(ArmorShedSound, NPC.Center); @@ -370,7 +370,7 @@ namespace CalamityMod.NPCs.StormWeaver if (phase3 && !useTornadoes) { // Let it snow while able to use the frost wave attack - if (Main.netMode != NetmodeID.Server) + if (!Main.dedServ) { Vector2 scaledSize = Main.Camera.ScaledSize; Vector2 scaledPosition = Main.Camera.ScaledPosition; @@ -448,7 +448,7 @@ namespace CalamityMod.NPCs.StormWeaver // Lightning strike if (!Main.DisableIntenseVisualEffects) { - if (Main.netMode != NetmodeID.Server) + if (!Main.dedServ) { if (lightningSpeed == 0f) { @@ -792,7 +792,7 @@ namespace CalamityMod.NPCs.StormWeaver if (phase4) { // Adjust lightning flash variables when in phase 3 - if (Main.netMode != NetmodeID.Server) + if (!Main.dedServ) { if (lightningSpeed > 0f) { @@ -902,7 +902,7 @@ namespace CalamityMod.NPCs.StormWeaver if (NPC.life <= 0) { - if (Main.netMode != NetmodeID.Server) + if (!Main.dedServ) { Gore.NewGore(NPC.GetSource_Death(), NPC.position, NPC.velocity, Mod.Find("SWNudeHead1").Type, NPC.scale); Gore.NewGore(NPC.GetSource_Death(), NPC.position, NPC.velocity, Mod.Find("SWNudeHead2").Type, NPC.scale); diff --git a/NPCs/StormWeaver/StormWeaverTail.cs b/NPCs/StormWeaver/StormWeaverTail.cs index d2bb8f811a..13bc6f7fc9 100644 --- a/NPCs/StormWeaver/StormWeaverTail.cs +++ b/NPCs/StormWeaver/StormWeaverTail.cs @@ -130,7 +130,7 @@ namespace CalamityMod.NPCs.StormWeaver NPC.Calamity().VulnerableToCold = true; NPC.Calamity().VulnerableToSickness = true; - if (Main.netMode != NetmodeID.Server) + if (!Main.dedServ) { Gore.NewGore(NPC.GetSource_FromAI(), NPC.position, NPC.velocity, Mod.Find("SWArmorTail1").Type, NPC.scale); Gore.NewGore(NPC.GetSource_FromAI(), NPC.position, NPC.velocity, Mod.Find("SWArmorTail2").Type, NPC.scale); @@ -328,7 +328,7 @@ namespace CalamityMod.NPCs.StormWeaver if (NPC.life <= 0) { - if (Main.netMode != NetmodeID.Server) + if (!Main.dedServ) { Gore.NewGore(NPC.GetSource_Death(), NPC.position, NPC.velocity, Mod.Find("SWNudeTail1").Type, NPC.scale); Gore.NewGore(NPC.GetSource_Death(), NPC.position, NPC.velocity, Mod.Find("SWNudeTail2").Type, NPC.scale); diff --git a/NPCs/SulphurousSea/AnthozoanCrab.cs b/NPCs/SulphurousSea/AnthozoanCrab.cs index bcbe51c764..2c4804bbdd 100644 --- a/NPCs/SulphurousSea/AnthozoanCrab.cs +++ b/NPCs/SulphurousSea/AnthozoanCrab.cs @@ -237,7 +237,7 @@ namespace CalamityMod.NPCs.SulphurousSea { Dust.NewDust(NPC.position, NPC.width, NPC.height, (int)CalamityDusts.SulphurousSeaAcid, hit.HitDirection, -1f, 0, default, 1f); } - if (Main.netMode != NetmodeID.Server) + if (!Main.dedServ) { Gore.NewGore(NPC.GetSource_Death(), NPC.position, NPC.velocity, Mod.Find("AnthozoanCrabGore").Type, NPC.scale); Gore.NewGore(NPC.GetSource_Death(), NPC.position, NPC.velocity, Mod.Find("AnthozoanCrabGore2").Type, NPC.scale); diff --git a/NPCs/SulphurousSea/AquaticUrchin.cs b/NPCs/SulphurousSea/AquaticUrchin.cs index 32373edccd..be52ddff23 100644 --- a/NPCs/SulphurousSea/AquaticUrchin.cs +++ b/NPCs/SulphurousSea/AquaticUrchin.cs @@ -165,7 +165,7 @@ namespace CalamityMod.NPCs.SulphurousSea { Dust.NewDust(NPC.position, NPC.width, NPC.height, DustID.Blood, hit.HitDirection, -1f, 0, default, 1f); } - if (Main.netMode != NetmodeID.Server) + if (!Main.dedServ) { Gore.NewGore(NPC.GetSource_Death(), NPC.position, NPC.velocity, Mod.Find("AquaticUrchin").Type, 1f); Gore.NewGore(NPC.GetSource_Death(), NPC.position, NPC.velocity, Mod.Find("AquaticUrchin2").Type, 1f); diff --git a/NPCs/SulphurousSea/BelchingCoral.cs b/NPCs/SulphurousSea/BelchingCoral.cs index 8a8a865748..4034dc9a41 100644 --- a/NPCs/SulphurousSea/BelchingCoral.cs +++ b/NPCs/SulphurousSea/BelchingCoral.cs @@ -119,7 +119,7 @@ namespace CalamityMod.NPCs.SulphurousSea { Dust.NewDust(NPC.position, NPC.width, NPC.height, (int)CalamityDusts.SulphurousSeaAcid, hit.HitDirection, -1f, 0, default, 1f); } - if (Main.netMode != NetmodeID.Server) + if (!Main.dedServ) { Gore.NewGore(NPC.GetSource_Death(), NPC.position, NPC.velocity, Mod.Find("BelchingCoralGore").Type, NPC.scale); Gore.NewGore(NPC.GetSource_Death(), NPC.position, NPC.velocity, Mod.Find("BelchingCoralGore2").Type, NPC.scale); diff --git a/NPCs/SulphurousSea/Gnasher.cs b/NPCs/SulphurousSea/Gnasher.cs index 2220541c8f..4c7bda3af5 100644 --- a/NPCs/SulphurousSea/Gnasher.cs +++ b/NPCs/SulphurousSea/Gnasher.cs @@ -188,7 +188,7 @@ namespace CalamityMod.NPCs.SulphurousSea for (int k = 0; k < 15; k++) Dust.NewDust(NPC.position, NPC.width, NPC.height, DustID.Blood, hit.HitDirection, -1f, 0, default, 1f); - if (Main.netMode != NetmodeID.Server) + if (!Main.dedServ) { Gore.NewGore(NPC.GetSource_Death(), NPC.position, NPC.velocity, Mod.Find("Gnasher").Type, 1f); Gore.NewGore(NPC.GetSource_Death(), NPC.position, NPC.velocity, Mod.Find("Gnasher2").Type, 1f); diff --git a/NPCs/SulphurousSea/Sulflounder.cs b/NPCs/SulphurousSea/Sulflounder.cs index 8caf72e232..fcf3f4e3d8 100644 --- a/NPCs/SulphurousSea/Sulflounder.cs +++ b/NPCs/SulphurousSea/Sulflounder.cs @@ -166,7 +166,7 @@ namespace CalamityMod.NPCs.SulphurousSea { Dust.NewDust(NPC.position, NPC.width, NPC.height, DustID.Blood, hit.HitDirection, -1f, 0, default, 1f); } - if (Main.netMode != NetmodeID.Server) + if (!Main.dedServ) { Gore.NewGore(NPC.GetSource_Death(), NPC.position, NPC.velocity, Mod.Find("Sulflounder").Type, 1f); Gore.NewGore(NPC.GetSource_Death(), NPC.position, NPC.velocity, Mod.Find("Sulflounder2").Type, 1f); diff --git a/NPCs/SulphurousSea/Toxicatfish.cs b/NPCs/SulphurousSea/Toxicatfish.cs index 10f1f085e9..70e1136ec5 100644 --- a/NPCs/SulphurousSea/Toxicatfish.cs +++ b/NPCs/SulphurousSea/Toxicatfish.cs @@ -127,7 +127,7 @@ namespace CalamityMod.NPCs.SulphurousSea { Dust.NewDust(NPC.position, NPC.width, NPC.height, DustID.Blood, hit.HitDirection, -1f, 0, default, 1f); } - if (Main.netMode != NetmodeID.Server) + if (!Main.dedServ) { Gore.NewGore(NPC.GetSource_Death(), NPC.position, NPC.velocity, Mod.Find("Toxicatfish").Type, 1f); Gore.NewGore(NPC.GetSource_Death(), NPC.position, NPC.velocity, Mod.Find("Toxicatfish2").Type, 1f); diff --git a/NPCs/SulphurousSea/Trasher.cs b/NPCs/SulphurousSea/Trasher.cs index d289e3d104..ff89752344 100644 --- a/NPCs/SulphurousSea/Trasher.cs +++ b/NPCs/SulphurousSea/Trasher.cs @@ -382,7 +382,7 @@ namespace CalamityMod.NPCs.SulphurousSea { Dust.NewDust(NPC.position, NPC.width, NPC.height, DustID.Blood, hit.HitDirection, -1f, 0, default, 1f); } - if (Main.netMode != NetmodeID.Server) + if (!Main.dedServ) { Gore.NewGore(NPC.GetSource_Death(), NPC.position, NPC.velocity, Mod.Find("Trasher").Type, 1f); Gore.NewGore(NPC.GetSource_Death(), NPC.position, NPC.velocity, Mod.Find("Trasher2").Type, 1f); diff --git a/NPCs/SunkenSea/BlindedAngler.cs b/NPCs/SunkenSea/BlindedAngler.cs index 3bf3fb1d27..208e5043c2 100644 --- a/NPCs/SunkenSea/BlindedAngler.cs +++ b/NPCs/SunkenSea/BlindedAngler.cs @@ -141,7 +141,7 @@ namespace CalamityMod.NPCs.SunkenSea { Dust.NewDust(NPC.position, NPC.width, NPC.height, DustID.BlueCrystalShard, hit.HitDirection, -1f, 0, default, 1f); } - if (Main.netMode != NetmodeID.Server) + if (!Main.dedServ) { Gore.NewGore(NPC.GetSource_Death(), NPC.position, NPC.velocity, Mod.Find("BlindAnglerGore1").Type, 1f); Gore.NewGore(NPC.GetSource_Death(), NPC.position, NPC.velocity, Mod.Find("BlindAnglerGore2").Type, 1f); diff --git a/NPCs/SunkenSea/Clam.cs b/NPCs/SunkenSea/Clam.cs index f1215cedbe..de57dfa6b1 100644 --- a/NPCs/SunkenSea/Clam.cs +++ b/NPCs/SunkenSea/Clam.cs @@ -228,7 +228,7 @@ namespace CalamityMod.NPCs.SunkenSea { Dust.NewDust(NPC.position, NPC.width, NPC.height, DustID.Obsidian, hit.HitDirection, -1f, 0, default, 1f); } - if (Main.netMode != NetmodeID.Server) + if (!Main.dedServ) { Gore.NewGore(NPC.GetSource_Death(), NPC.position, NPC.velocity, Mod.Find("Clam1").Type, 1f); Gore.NewGore(NPC.GetSource_Death(), NPC.position, NPC.velocity, Mod.Find("Clam2").Type, 1f); diff --git a/NPCs/SunkenSea/EutrophicRay.cs b/NPCs/SunkenSea/EutrophicRay.cs index d220440e7f..48e4ebabed 100644 --- a/NPCs/SunkenSea/EutrophicRay.cs +++ b/NPCs/SunkenSea/EutrophicRay.cs @@ -228,7 +228,7 @@ namespace CalamityMod.NPCs.SunkenSea { Dust.NewDust(NPC.position, NPC.width, NPC.height, DustID.BlueCrystalShard, hit.HitDirection, -1f, 0, default, 1f); } - if (Main.netMode != NetmodeID.Server) + if (!Main.dedServ) { Gore.NewGore(NPC.GetSource_Death(), NPC.position, NPC.velocity, Mod.Find("RayGore1").Type, 1f); Gore.NewGore(NPC.GetSource_Death(), NPC.position, NPC.velocity, Mod.Find("RayGore2").Type, 1f); diff --git a/NPCs/SunkenSea/GiantClam.cs b/NPCs/SunkenSea/GiantClam.cs index 51a1e51500..0f3fb7b17c 100644 --- a/NPCs/SunkenSea/GiantClam.cs +++ b/NPCs/SunkenSea/GiantClam.cs @@ -136,7 +136,7 @@ namespace CalamityMod.NPCs.SunkenSea if (hitAmount == 5) { - if (Main.netMode != NetmodeID.Server) + if (!Main.dedServ) { if (!Main.player[NPC.target].dead && Main.player[NPC.target].active) player.AddBuff(ModContent.BuffType(), 2); //CLAM INVASION @@ -276,7 +276,7 @@ namespace CalamityMod.NPCs.SunkenSea NPC.noGravity = false; attack = -1; SoundEngine.PlaySound(SlamSound, NPC.Center); - if (Main.netMode != NetmodeID.Server) + if (!Main.dedServ) { for (int stompDustArea = (int)NPC.position.X - 30; stompDustArea < (int)NPC.position.X + NPC.width + 60; stompDustArea += 30) { @@ -489,7 +489,7 @@ namespace CalamityMod.NPCs.SunkenSea { Dust.NewDust(NPC.position, NPC.width, NPC.height, DustID.Obsidian, hit.HitDirection, -1f, 0, default, 1f); } - if (Main.netMode != NetmodeID.Server) + if (!Main.dedServ) { Gore.NewGore(NPC.GetSource_Death(), NPC.position, NPC.velocity, Mod.Find("GiantClam1").Type, 1f); Gore.NewGore(NPC.GetSource_Death(), NPC.position, NPC.velocity, Mod.Find("GiantClam2").Type, 1f); diff --git a/NPCs/SunkenSea/HauntedChum.cs b/NPCs/SunkenSea/HauntedChum.cs index 57434671d4..dca664de84 100644 --- a/NPCs/SunkenSea/HauntedChum.cs +++ b/NPCs/SunkenSea/HauntedChum.cs @@ -223,13 +223,13 @@ namespace CalamityMod.NPCs.SunkenSea { VerletSimulatedSegment v = Segments[i]; int goreType = i < Segments.Count / 2 ? Mod.Find("ChumBone2").Type : Mod.Find("ChumBone1").Type; - if (Main.netMode != NetmodeID.Server) + if (!Main.dedServ) { Gore.NewGorePerfect(NPC.GetSource_Death(), v.position, new Vector2(Main.rand.NextFloat(-2, 2), -6), goreType); } } } - if (Main.netMode != NetmodeID.Server) + if (!Main.dedServ) { Gore.NewGore(NPC.GetSource_Death(), NPC.position, NPC.velocity, Mod.Find("HauntedChum").Type, 1f); Gore.NewGore(NPC.GetSource_Death(), NPC.position, NPC.velocity, Mod.Find("HauntedChumMouth").Type, 1f); diff --git a/NPCs/SunkenSea/PrismBack.cs b/NPCs/SunkenSea/PrismBack.cs index 1e643cb782..1c73fd7386 100644 --- a/NPCs/SunkenSea/PrismBack.cs +++ b/NPCs/SunkenSea/PrismBack.cs @@ -185,7 +185,7 @@ namespace CalamityMod.NPCs.SunkenSea } if (NPC.life <= 0) { - if (Main.netMode != NetmodeID.Server) + if (!Main.dedServ) { Gore.NewGore(NPC.GetSource_Death(), NPC.position, NPC.velocity, Mod.Find("PrismTurtleGore1").Type, 1f); Gore.NewGore(NPC.GetSource_Death(), NPC.position, NPC.velocity, Mod.Find("PrismTurtleGore2").Type, 1f); diff --git a/NPCs/SunkenSea/SandProwler.cs b/NPCs/SunkenSea/SandProwler.cs index 46ec02e744..21e1ca1d13 100644 --- a/NPCs/SunkenSea/SandProwler.cs +++ b/NPCs/SunkenSea/SandProwler.cs @@ -573,7 +573,7 @@ namespace CalamityMod.NPCs.SunkenSea { Dust.NewDust(NPC.position, NPC.width, NPC.height, DustID.Coralstone, hit.HitDirection, -1f, 0, default, 1f); } - if (Main.netMode != NetmodeID.Server) + if (!Main.dedServ) { Gore.NewGore(NPC.GetSource_Death(), NPC.position, NPC.velocity, Mod.Find("SeaSerpentGore1").Type, 1f); } diff --git a/NPCs/SunkenSea/SandProwlerNested.cs b/NPCs/SunkenSea/SandProwlerNested.cs index bcee5bc704..9fee057a61 100644 --- a/NPCs/SunkenSea/SandProwlerNested.cs +++ b/NPCs/SunkenSea/SandProwlerNested.cs @@ -461,7 +461,7 @@ namespace CalamityMod.NPCs.SunkenSea { Dust.NewDust(NPC.position, NPC.width, NPC.height, DustID.Coralstone, hit.HitDirection, -1f, 0, default, 1f); } - if (NPC.life <= 0 && Main.netMode != NetmodeID.Server) + if (NPC.life <= 0 && !Main.dedServ) { for (int k = 0; k < 10; k++) { diff --git a/NPCs/SunkenSea/SeaFloaty.cs b/NPCs/SunkenSea/SeaFloaty.cs index 5446f78115..c4e8a83563 100644 --- a/NPCs/SunkenSea/SeaFloaty.cs +++ b/NPCs/SunkenSea/SeaFloaty.cs @@ -159,7 +159,7 @@ namespace CalamityMod.NPCs.SunkenSea { Dust.NewDust(NPC.position, NPC.width, NPC.height, DustID.BlueCrystalShard, hit.HitDirection, -1f, 0, default, 1f); } - if (Main.netMode != NetmodeID.Server) + if (!Main.dedServ) { Gore.NewGore(NPC.GetSource_Death(), NPC.position, NPC.velocity, Mod.Find("SeaFloatyGore1").Type, 1f); Gore.NewGore(NPC.GetSource_Death(), NPC.position, NPC.velocity, Mod.Find("SeaFloatyGore2").Type, 1f); diff --git a/NPCs/SupremeCalamitas/BrimstoneHeart.cs b/NPCs/SupremeCalamitas/BrimstoneHeart.cs index 1939c891d7..74feec36d7 100644 --- a/NPCs/SupremeCalamitas/BrimstoneHeart.cs +++ b/NPCs/SupremeCalamitas/BrimstoneHeart.cs @@ -139,7 +139,7 @@ namespace CalamityMod.NPCs.SupremeCalamitas { if (NPC.life <= 0) { - if (Main.netMode != NetmodeID.Server) + if (!Main.dedServ) { for (int i = 1; i <= 2; i++) { diff --git a/NPCs/SupremeCalamitas/SepulcherArm.cs b/NPCs/SupremeCalamitas/SepulcherArm.cs index e68ca7c25f..ecc059ac8c 100644 --- a/NPCs/SupremeCalamitas/SepulcherArm.cs +++ b/NPCs/SupremeCalamitas/SepulcherArm.cs @@ -207,7 +207,7 @@ namespace CalamityMod.NPCs.SupremeCalamitas { if (NPC.life <= 0) { - if (Main.netMode != NetmodeID.Server) + if (!Main.dedServ) { Vector2 forearmGoreSpawnPosition = Limbs[0].Center + Main.rand.NextVector2Circular(6f, 6f); Vector2 armGoreSpawnPosition = Limbs[1].Center + Main.rand.NextVector2Circular(6f, 6f); diff --git a/NPCs/SupremeCalamitas/SepulcherBody.cs b/NPCs/SupremeCalamitas/SepulcherBody.cs index 6778daf3d9..9531e78aea 100644 --- a/NPCs/SupremeCalamitas/SepulcherBody.cs +++ b/NPCs/SupremeCalamitas/SepulcherBody.cs @@ -148,7 +148,7 @@ namespace CalamityMod.NPCs.SupremeCalamitas { if (NPC.life <= 0) { - if (Main.netMode != NetmodeID.Server) + if (!Main.dedServ) { int variant = (int)(NPC.localAI[3] / 2f % 2f); if (variant == 0) diff --git a/NPCs/SupremeCalamitas/SepulcherHead.cs b/NPCs/SupremeCalamitas/SepulcherHead.cs index 4be779a2fb..6041b0b4e5 100644 --- a/NPCs/SupremeCalamitas/SepulcherHead.cs +++ b/NPCs/SupremeCalamitas/SepulcherHead.cs @@ -170,7 +170,7 @@ namespace CalamityMod.NPCs.SupremeCalamitas } TailSpawned = true; } - if (!NPC.active && Main.netMode == NetmodeID.Server) + if (!NPC.active && Main.dedServ) { NetMessage.SendData(MessageID.DamageNPC, -1, -1, null, NPC.whoAmI, -1f, 0f, 0f, 0, 0, 0); } @@ -397,7 +397,7 @@ namespace CalamityMod.NPCs.SupremeCalamitas } if (NPC.life <= 0) { - if (Main.netMode != NetmodeID.Server) + if (!Main.dedServ) { for (int i = 1; i <= 3; i++) { diff --git a/NPCs/SupremeCalamitas/SepulcherTail.cs b/NPCs/SupremeCalamitas/SepulcherTail.cs index ea920d025f..21189ba860 100644 --- a/NPCs/SupremeCalamitas/SepulcherTail.cs +++ b/NPCs/SupremeCalamitas/SepulcherTail.cs @@ -183,7 +183,7 @@ namespace CalamityMod.NPCs.SupremeCalamitas } if (NPC.life <= 0) { - if (Main.netMode != NetmodeID.Server) + if (!Main.dedServ) { for (int i = 1; i <= 2; i++) { diff --git a/NPCs/SupremeCalamitas/SoulSeekerSupreme.cs b/NPCs/SupremeCalamitas/SoulSeekerSupreme.cs index 2bf50c9b9c..ce3a029a3b 100644 --- a/NPCs/SupremeCalamitas/SoulSeekerSupreme.cs +++ b/NPCs/SupremeCalamitas/SoulSeekerSupreme.cs @@ -252,7 +252,7 @@ namespace CalamityMod.NPCs.SupremeCalamitas Main.dust[brimDust2].velocity *= 2f; } - if (Main.netMode != NetmodeID.Server) + if (!Main.dedServ) { for (int i = 1; i <= 5; i++) Gore.NewGore(NPC.GetSource_Death(), NPC.position, NPC.velocity, Mod.Find($"SupremeSoulSeeker_Gore{i}").Type, NPC.scale); diff --git a/NPCs/SupremeCalamitas/SupremeCalamitas.cs b/NPCs/SupremeCalamitas/SupremeCalamitas.cs index 5684ebbbbc..07ed357e60 100644 --- a/NPCs/SupremeCalamitas/SupremeCalamitas.cs +++ b/NPCs/SupremeCalamitas/SupremeCalamitas.cs @@ -668,7 +668,7 @@ namespace CalamityMod.NPCs.SupremeCalamitas Main.tile[i + xoffset, j + yoffset].TileType = (ushort)ModContent.TileType(); Main.tile[i + xoffset, j + yoffset].Get().HasTile = true; } - if (Main.netMode == NetmodeID.Server) + if (Main.dedServ) { NetMessage.SendTileSquare(-1, i + xoffset, j + yoffset, 1, TileChangeType.None); } diff --git a/NPCs/TownNPCs/AndroombaFriendly.cs b/NPCs/TownNPCs/AndroombaFriendly.cs index f8837a9a2a..0a62a3a2f0 100644 --- a/NPCs/TownNPCs/AndroombaFriendly.cs +++ b/NPCs/TownNPCs/AndroombaFriendly.cs @@ -181,7 +181,7 @@ namespace CalamityMod.NPCs.TownNPCs npc.ai[0] = phase; npc.ai[1] = 0; npc.netUpdate = true; - if (Main.netMode == NetmodeID.Server) + if (Main.dedServ) NetMessage.SendData(MessageID.SyncNPC, -1, -1, null, index); } @@ -194,7 +194,7 @@ namespace CalamityMod.NPCs.TownNPCs npc.ai[3] = solutionType; npc.netUpdate = true; - if (Main.netMode == NetmodeID.Server) + if (Main.dedServ) NetMessage.SendData(MessageID.SyncNPC, -1, -1, null, index); } diff --git a/NPCs/TownNPCs/SEAHOE.cs b/NPCs/TownNPCs/SEAHOE.cs index 7ad7960bd0..b715421059 100644 --- a/NPCs/TownNPCs/SEAHOE.cs +++ b/NPCs/TownNPCs/SEAHOE.cs @@ -219,7 +219,7 @@ namespace CalamityMod.NPCs.TownNPCs { if (NPC.life <= 0) { - if (Main.netMode != NetmodeID.Server) + if (!Main.dedServ) { Gore.NewGore(NPC.GetSource_Death(), NPC.position, NPC.velocity, Mod.Find("Amidias").Type, 1f); Gore.NewGore(NPC.GetSource_Death(), NPC.position, NPC.velocity, Mod.Find("Amidias2").Type, 1f); diff --git a/NPCs/TownNPCs/THIEF.cs b/NPCs/TownNPCs/THIEF.cs index 8d3fbe9b86..c5c7be082b 100644 --- a/NPCs/TownNPCs/THIEF.cs +++ b/NPCs/TownNPCs/THIEF.cs @@ -329,7 +329,7 @@ namespace CalamityMod.NPCs.TownNPCs { if (NPC.life <= 0) { - if (Main.netMode != NetmodeID.Server) + if (!Main.dedServ) { Gore.NewGore(NPC.GetSource_Death(), NPC.position, NPC.velocity, Mod.Find("Bandit").Type, 1f); Gore.NewGore(NPC.GetSource_Death(), NPC.position, NPC.velocity, Mod.Find("Bandit2").Type, 1f); diff --git a/NPCs/VanillaNPCAIOverrides/Bosses/BrainOfCthulhuAI.cs b/NPCs/VanillaNPCAIOverrides/Bosses/BrainOfCthulhuAI.cs index b6c8b3d42f..0643e0861c 100644 --- a/NPCs/VanillaNPCAIOverrides/Bosses/BrainOfCthulhuAI.cs +++ b/NPCs/VanillaNPCAIOverrides/Bosses/BrainOfCthulhuAI.cs @@ -100,7 +100,7 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses npc.active = false; npc.life = 0; - if (Main.netMode == NetmodeID.Server) + if (Main.dedServ) NetMessage.SendData(MessageID.SyncNPC, -1, -1, null, npc.whoAmI, 0f, 0f, 0f, 0, 0, 0); } } @@ -118,7 +118,7 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses npc.localAI[2] = 1f; - if (Main.netMode != NetmodeID.Server) + if (!Main.dedServ) { Gore.NewGore(npc.GetSource_FromAI(), npc.position, new Vector2(Main.rand.Next(-30, 31) * 0.2f, Main.rand.Next(-30, 31) * 0.2f), 392, 1f); Gore.NewGore(npc.GetSource_FromAI(), npc.position, new Vector2(Main.rand.Next(-30, 31) * 0.2f, Main.rand.Next(-30, 31) * 0.2f), 393, 1f); @@ -316,7 +316,7 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses if (CalamityWorld.LegendaryMode) { - if (Main.netMode != NetmodeID.Server) + if (!Main.dedServ) { if (!Main.player[Main.myPlayer].dead && Main.player[Main.myPlayer].active && Vector2.Distance(Main.player[Main.myPlayer].Center, npc.Center) < CalamityGlobalNPC.CatchUpDistance350Tiles) Main.player[Main.myPlayer].AddBuff(BuffID.Confused, 90); @@ -1102,7 +1102,7 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses { npc.active = false; npc.life = 0; - if (Main.netMode == NetmodeID.Server) + if (Main.dedServ) NetMessage.SendData(MessageID.SyncNPC, -1, -1, null, npc.whoAmI); } } diff --git a/NPCs/VanillaNPCAIOverrides/Bosses/EaterOfWorldsAI.cs b/NPCs/VanillaNPCAIOverrides/Bosses/EaterOfWorldsAI.cs index b36f788adb..ae5187bf7a 100644 --- a/NPCs/VanillaNPCAIOverrides/Bosses/EaterOfWorldsAI.cs +++ b/NPCs/VanillaNPCAIOverrides/Bosses/EaterOfWorldsAI.cs @@ -302,7 +302,7 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses } // If for any reason this segment was deleted, send info to clients so they also see it die. - if (!npc.active && Main.netMode == NetmodeID.Server) + if (!npc.active && Main.dedServ) NetMessage.SendData(MessageID.DamageNPC, -1, -1, null, npc.whoAmI, -1f); } @@ -563,13 +563,13 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses Main.npc[segmentAmt].active = false; npc.life = 0; - if (Main.netMode == NetmodeID.Server) + if (Main.dedServ) NetMessage.SendData(MessageID.SyncNPC, -1, -1, null, segmentAmt, 0f, 0f, 0f, 0, 0, 0); segmentAmt = attachedSegments; } - if (Main.netMode == NetmodeID.Server) + if (Main.dedServ) NetMessage.SendData(MessageID.SyncNPC, -1, -1, null, npc.whoAmI, 0f, 0f, 0f, 0, 0, 0); } targetPosX = 0f; @@ -760,7 +760,7 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses } // Manually sync newAI because there is no GlobalNPC.SendExtraAI - if (npc.active && npc.netUpdate && Main.netMode == NetmodeID.Server) + if (npc.active && npc.netUpdate && Main.dedServ) { SyncCalamityNPCAIArrayPacket.Send(npc); } @@ -936,7 +936,7 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses npc.alpha = 0; } - if (!npc.active && Main.netMode == NetmodeID.Server) + if (!npc.active && Main.dedServ) NetMessage.SendData(MessageID.DamageNPC, -1, -1, null, npc.whoAmI, -1f); } @@ -1143,13 +1143,13 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses int num76 = (int)Main.npc[num75].ai[0]; Main.npc[num75].active = false; npc.life = 0; - if (Main.netMode == NetmodeID.Server) + if (Main.dedServ) NetMessage.SendData(MessageID.SyncNPC, -1, -1, null, num75); num75 = num76; } - if (Main.netMode == NetmodeID.Server) + if (Main.dedServ) NetMessage.SendData(MessageID.SyncNPC, -1, -1, null, npc.whoAmI); } diff --git a/NPCs/VanillaNPCAIOverrides/Bosses/EyeOfCthulhuAI.cs b/NPCs/VanillaNPCAIOverrides/Bosses/EyeOfCthulhuAI.cs index 48bc5cedc5..a0cf1d426f 100644 --- a/NPCs/VanillaNPCAIOverrides/Bosses/EyeOfCthulhuAI.cs +++ b/NPCs/VanillaNPCAIOverrides/Bosses/EyeOfCthulhuAI.cs @@ -196,7 +196,7 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses int eye = NPC.NewNPC(npc.GetSource_FromAI(), (int)servantSpawnCenter.X, (int)servantSpawnCenter.Y, NPCID.ServantofCthulhu, 0, 0f, 0f, enrageScale); Main.npc[eye].velocity = servantSpawnVelocity; - if (Main.netMode == NetmodeID.Server && eye < Main.maxNPCs) + if (Main.dedServ && eye < Main.maxNPCs) NetMessage.SendData(MessageID.SyncNPC, -1, -1, null, eye); } else @@ -361,7 +361,7 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses Main.npc[servantSpawn].velocity.X = servantSpawnVelocity.X; Main.npc[servantSpawn].velocity.Y = servantSpawnVelocity.Y; - if (Main.netMode == NetmodeID.Server && servantSpawn < Main.maxNPCs) + if (Main.dedServ && servantSpawn < Main.maxNPCs) NetMessage.SendData(MessageID.SyncNPC, -1, -1, null, servantSpawn); if (CalamityWorld.LegendaryMode) @@ -397,7 +397,7 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses { SoundEngine.PlaySound(SoundID.NPCHit1, npc.Center); - if (Main.netMode != NetmodeID.Server) + if (!Main.dedServ) { for (int phase2Gore = 0; phase2Gore < 2; phase2Gore++) { @@ -818,7 +818,7 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses Main.npc[eye].velocity.X = servantSpawnVelocity.X; Main.npc[eye].velocity.Y = servantSpawnVelocity.Y; - if (Main.netMode == NetmodeID.Server && eye < Main.maxNPCs) + if (Main.dedServ && eye < Main.maxNPCs) NetMessage.SendData(MessageID.SyncNPC, -1, -1, null, eye); } else if (!CalamityWorld.LegendaryMode) @@ -1165,7 +1165,7 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses int num22 = NPC.NewNPC(npc.GetSource_FromAI(), (int)vector2.X, (int)vector2.Y, NPCID.ServantofCthulhu); Main.npc[num22].velocity.X = vector3.X; Main.npc[num22].velocity.Y = vector3.Y; - if (Main.netMode == NetmodeID.Server && num22 < Main.maxNPCs) + if (Main.dedServ && num22 < Main.maxNPCs) NetMessage.SendData(MessageID.SyncNPC, -1, -1, null, num22); } @@ -1336,7 +1336,7 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses int num34 = NPC.NewNPC(npc.GetSource_FromAI(), (int)vector6.X, (int)vector6.Y, NPCID.ServantofCthulhu); Main.npc[num34].velocity.X = vector7.X; Main.npc[num34].velocity.Y = vector7.Y; - if (Main.netMode == NetmodeID.Server && num34 < Main.maxNPCs) + if (Main.dedServ && num34 < Main.maxNPCs) NetMessage.SendData(MessageID.SyncNPC, -1, -1, null, num34); } diff --git a/NPCs/VanillaNPCAIOverrides/Bosses/GolemAI.cs b/NPCs/VanillaNPCAIOverrides/Bosses/GolemAI.cs index 01ee2f4371..8b1d9bdf75 100644 --- a/NPCs/VanillaNPCAIOverrides/Bosses/GolemAI.cs +++ b/NPCs/VanillaNPCAIOverrides/Bosses/GolemAI.cs @@ -108,7 +108,7 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses if (Main.tile[j, k].TileType == TileID.Torches) { Main.tile[j, k].Get().HasTile = false; - if (Main.netMode == NetmodeID.Server) + if (Main.dedServ) NetMessage.SendTileSquare(-1, j, k); } } @@ -488,7 +488,7 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses Dust dust = Main.dust[fallDust]; dust.velocity *= 0.2f; } - if (Main.netMode != NetmodeID.Server) + if (!Main.dedServ) { int fallGore = Gore.NewGore(npc.GetSource_FromAI(), new Vector2(i - 20, npc.position.Y + npc.height - 8f), default, Main.rand.Next(61, 64), 1f); Gore gore = Main.gore[fallGore]; @@ -863,7 +863,7 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses if (Main.tile[j, k].TileType == TileID.Torches) { Main.tile[j, k].Get().HasTile = false; - if (Main.netMode == NetmodeID.Server) + if (Main.dedServ) NetMessage.SendTileSquare(-1, j, k); } } @@ -1625,7 +1625,7 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses if (Main.tile[j, k].TileType == TileID.Torches) { Main.tile[j, k].Get().HasTile = false; - if (Main.netMode == NetmodeID.Server) + if (Main.dedServ) NetMessage.SendTileSquare(-1, j, k); } } @@ -1997,7 +1997,7 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses if (Main.tile[j, k].TileType == TileID.Torches) { Main.tile[j, k].Get().HasTile = false; - if (Main.netMode == NetmodeID.Server) + if (Main.dedServ) NetMessage.SendTileSquare(-1, j, k); } } diff --git a/NPCs/VanillaNPCAIOverrides/Bosses/KingSlimeAI.cs b/NPCs/VanillaNPCAIOverrides/Bosses/KingSlimeAI.cs index dca7c85d7d..09256643a4 100644 --- a/NPCs/VanillaNPCAIOverrides/Bosses/KingSlimeAI.cs +++ b/NPCs/VanillaNPCAIOverrides/Bosses/KingSlimeAI.cs @@ -313,7 +313,7 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses if (npc.ai[0] >= 60f) teleported = true; - if (npc.ai[0] == 60f && Main.netMode != NetmodeID.Server) + if (npc.ai[0] == 60f && !Main.dedServ) Gore.NewGore(npc.GetSource_FromAI(), npc.Center + new Vector2(-40f, -(float)npc.height / 2), npc.velocity, 734, 1f); if (npc.ai[0] >= 60f && Main.netMode != NetmodeID.MultiplayerClient) @@ -639,7 +639,7 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses Main.npc[slimeSpawns].ai[0] = -1000 * Main.rand.Next(3); Main.npc[slimeSpawns].ai[1] = 0f; - if (Main.netMode == NetmodeID.Server && slimeSpawns < Main.maxNPCs) + if (Main.dedServ && slimeSpawns < Main.maxNPCs) NetMessage.SendData(MessageID.SyncNPC, -1, -1, null, slimeSpawns); } } @@ -1001,7 +1001,7 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses Main.npc[num260].velocity.Y = (float)Main.rand.Next(-30, 1) * 0.1f; Main.npc[num260].ai[0] = -1000 * Main.rand.Next(3); Main.npc[num260].ai[1] = 0f; - if (Main.netMode == NetmodeID.Server && num260 < Main.maxNPCs) + if (Main.dedServ && num260 < Main.maxNPCs) NetMessage.SendData(MessageID.SyncNPC, -1, -1, null, num260); } diff --git a/NPCs/VanillaNPCAIOverrides/Bosses/MoonLordAI.cs b/NPCs/VanillaNPCAIOverrides/Bosses/MoonLordAI.cs index a00ffc39e3..cd9481844a 100644 --- a/NPCs/VanillaNPCAIOverrides/Bosses/MoonLordAI.cs +++ b/NPCs/VanillaNPCAIOverrides/Bosses/MoonLordAI.cs @@ -522,7 +522,7 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses NetMessage.SendData(MessageID.SyncNPC, -1, -1, null, npc.whoAmI, 0f, 0f, 0f, 0, 0, 0); NPC.LunarApocalypseIsUp = false; - if (Main.netMode == NetmodeID.Server) + if (Main.dedServ) NetMessage.SendData(MessageID.WorldData, -1, -1, null, 0, 0f, 0f, 0f, 0, 0, 0); return false; diff --git a/NPCs/VanillaNPCAIOverrides/Bosses/PlanteraAI.cs b/NPCs/VanillaNPCAIOverrides/Bosses/PlanteraAI.cs index 5d51bbce89..f849a006f7 100644 --- a/NPCs/VanillaNPCAIOverrides/Bosses/PlanteraAI.cs +++ b/NPCs/VanillaNPCAIOverrides/Bosses/PlanteraAI.cs @@ -84,7 +84,7 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses { npc.active = false; npc.life = 0; - if (Main.netMode == NetmodeID.Server) + if (Main.dedServ) NetMessage.SendData(MessageID.SyncNPC, -1, -1, null, npc.whoAmI); } } @@ -782,7 +782,7 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses // Spawn gore if (npc.localAI[2] == 0f) { - if (Main.netMode != NetmodeID.Server) + if (!Main.dedServ) { Gore.NewGore(npc.GetSource_FromAI(), new Vector2(npc.position.X + Main.rand.Next(npc.width), npc.position.Y + Main.rand.Next(npc.height)), npc.velocity, 378, npc.scale); Gore.NewGore(npc.GetSource_FromAI(), new Vector2(npc.position.X + Main.rand.Next(npc.width), npc.position.Y + Main.rand.Next(npc.height)), npc.velocity, 379, npc.scale); diff --git a/NPCs/VanillaNPCAIOverrides/Bosses/QueenBeeAI.cs b/NPCs/VanillaNPCAIOverrides/Bosses/QueenBeeAI.cs index a2504b6643..34b383757a 100644 --- a/NPCs/VanillaNPCAIOverrides/Bosses/QueenBeeAI.cs +++ b/NPCs/VanillaNPCAIOverrides/Bosses/QueenBeeAI.cs @@ -923,7 +923,7 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses npc.SimpleFlyMovement(idealVelocity, stingerAttackAccel); } - if (Main.netMode == NetmodeID.Server) + if (Main.dedServ) NetMessage.SendData(MessageID.SyncNPC, -1, -1, null, npc.whoAmI, 0f, 0f, 0f, 0, 0, 0); npc.netSpam = 5; diff --git a/NPCs/VanillaNPCAIOverrides/Bosses/QueenSlimeAI.cs b/NPCs/VanillaNPCAIOverrides/Bosses/QueenSlimeAI.cs index 8a18971df1..ef5b7d0e3c 100644 --- a/NPCs/VanillaNPCAIOverrides/Bosses/QueenSlimeAI.cs +++ b/NPCs/VanillaNPCAIOverrides/Bosses/QueenSlimeAI.cs @@ -900,7 +900,7 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses Main.npc[slimeScale2].velocity.Y = Main.rand.Next(-30, 1) * 0.1f; Main.npc[slimeScale2].ai[0] = -500 * Main.rand.Next(3); Main.npc[slimeScale2].ai[1] = 0f; - if (Main.netMode == NetmodeID.Server && slimeScale2 < Main.maxNPCs) + if (Main.dedServ && slimeScale2 < Main.maxNPCs) NetMessage.SendData(MessageID.SyncNPC, -1, -1, null, slimeScale2); return false; @@ -1634,7 +1634,7 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses Main.npc[num33].velocity.Y = (float)Main.rand.Next(-30, 1) * 0.1f; Main.npc[num33].ai[0] = -500 * Main.rand.Next(3); Main.npc[num33].ai[1] = 0f; - if (Main.netMode == NetmodeID.Server && num33 < Main.maxNPCs) + if (Main.dedServ && num33 < Main.maxNPCs) NetMessage.SendData(MessageID.SyncNPC, -1, -1, null, num33); } diff --git a/NPCs/VanillaNPCAIOverrides/Bosses/SkeletronAI.cs b/NPCs/VanillaNPCAIOverrides/Bosses/SkeletronAI.cs index 8f6a5e1005..a26d087d4d 100644 --- a/NPCs/VanillaNPCAIOverrides/Bosses/SkeletronAI.cs +++ b/NPCs/VanillaNPCAIOverrides/Bosses/SkeletronAI.cs @@ -564,7 +564,7 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses if (!WorldGen.SolidTile(headYAcceleration, headYTopSpeed)) { int headXAcceleration = NPC.NewNPC(npc.GetSource_FromAI(), headYAcceleration * 16 + 8, headYTopSpeed * 16, NPCID.DarkCaster); - if (Main.netMode == NetmodeID.Server && headXAcceleration < Main.maxNPCs) + if (Main.dedServ && headXAcceleration < Main.maxNPCs) NetMessage.SendData(MessageID.SyncNPC, -1, -1, null, headXAcceleration); break; @@ -588,7 +588,7 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses if (!WorldGen.SolidTile(headYAcceleration, headYTopSpeed)) { int headXAcceleration = NPC.NewNPC(npc.GetSource_FromAI(), headYAcceleration * 16 + 8, headYTopSpeed * 16, NPCID.DiabolistWhite); - if (Main.netMode == NetmodeID.Server && headXAcceleration < Main.maxNPCs) + if (Main.dedServ && headXAcceleration < Main.maxNPCs) NetMessage.SendData(MessageID.SyncNPC, -1, -1, null, headXAcceleration); break; @@ -665,7 +665,7 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses if (!WorldGen.SolidTile(headYAcceleration, headYTopSpeed)) { int headXAcceleration = NPC.NewNPC(npc.GetSource_FromAI(), headYAcceleration * 16 + 8, headYTopSpeed * 16, NPCID.DarkCaster); - if (Main.netMode == NetmodeID.Server && headXAcceleration < Main.maxNPCs) + if (Main.dedServ && headXAcceleration < Main.maxNPCs) NetMessage.SendData(MessageID.SyncNPC, -1, -1, null, headXAcceleration); break; @@ -884,7 +884,7 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses if (!Main.npc[(int)npc.ai[1]].active || Main.npc[(int)npc.ai[1]].aiStyle != NPCAIStyleID.SkeletronHead) { npc.ai[2] += 10f; - if (npc.ai[2] > 50f || Main.netMode != NetmodeID.Server) + if (npc.ai[2] > 50f || !Main.dedServ) { npc.life = -1; npc.HitEffect(0, 10.0); @@ -1400,7 +1400,7 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses if (!WorldGen.SolidTile(num169, num170)) { int num171 = NPC.NewNPC(npc.GetSource_FromAI(), num169 * 16 + 8, num170 * 16, NPCID.DarkCaster); - if (Main.netMode == NetmodeID.Server && num171 < Main.maxNPCs) + if (Main.dedServ && num171 < Main.maxNPCs) NetMessage.SendData(MessageID.SyncNPC, -1, -1, null, num171); break; @@ -1537,7 +1537,7 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses if (!Main.npc[(int)npc.ai[1]].active || Main.npc[(int)npc.ai[1]].aiStyle != NPCAIStyleID.SkeletronHead) { npc.ai[2] += 10f; - if (npc.ai[2] > 50f || Main.netMode != NetmodeID.Server) + if (npc.ai[2] > 50f || !Main.dedServ) { npc.life = -1; npc.HitEffect(); diff --git a/NPCs/VanillaNPCAIOverrides/Bosses/SkeletronPrimeAI.cs b/NPCs/VanillaNPCAIOverrides/Bosses/SkeletronPrimeAI.cs index f98bc6c82d..ba1f02cef6 100644 --- a/NPCs/VanillaNPCAIOverrides/Bosses/SkeletronPrimeAI.cs +++ b/NPCs/VanillaNPCAIOverrides/Bosses/SkeletronPrimeAI.cs @@ -198,14 +198,14 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses Main.npc[destroyer].localAI[3] = 1f; Main.npc[destroyer].SyncVanillaLocalAI(); string typeName = Main.npc[destroyer].TypeName; - if (Main.netMode == NetmodeID.Server && destroyer < Main.maxNPCs) + if (Main.dedServ && destroyer < Main.maxNPCs) NetMessage.SendData(MessageID.SyncNPC, -1, -1, null, destroyer); AchievementsHelper.CheckMechaMayhem(); if (Main.netMode == NetmodeID.SinglePlayer) Main.NewText(Language.GetTextValue("Announcement.HasAwoken", typeName), 175, 75); - else if (Main.netMode == NetmodeID.Server) + else if (Main.dedServ) ChatHelper.BroadcastChatMessage(NetworkText.FromKey("Announcement.HasAwoken", Main.npc[destroyer].GetTypeNetName()), new Color(175, 75, 255)); } } @@ -230,14 +230,14 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses Main.npc[retinazer].localAI[3] = 1f; Main.npc[retinazer].SyncVanillaLocalAI(); string typeName = Main.npc[retinazer].TypeName; - if (Main.netMode == NetmodeID.Server && retinazer < Main.maxNPCs) + if (Main.dedServ && retinazer < Main.maxNPCs) NetMessage.SendData(MessageID.SyncNPC, -1, -1, null, retinazer); AchievementsHelper.CheckMechaMayhem(); if (Main.netMode == NetmodeID.SinglePlayer) Main.NewText(Lang.misc[48].Value, 175, 75); - else if (Main.netMode == NetmodeID.Server) + else if (Main.dedServ) ChatHelper.BroadcastChatMessage(Lang.misc[48].ToNetworkText(), new Color(175, 75, 255)); } } @@ -839,7 +839,7 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses if (!Main.npc[(int)npc.ai[1]].active || Main.npc[(int)npc.ai[1]].aiStyle != NPCAIStyleID.SkeletronPrimeHead) { npc.ai[2] += 10f; - if (npc.ai[2] > 50f || Main.netMode != NetmodeID.Server) + if (npc.ai[2] > 50f || !Main.dedServ) { npc.life = -1; npc.HitEffect(0, 10.0); @@ -1106,7 +1106,7 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses if (!Main.npc[(int)npc.ai[1]].active || Main.npc[(int)npc.ai[1]].aiStyle != NPCAIStyleID.SkeletronPrimeHead) { npc.ai[2] += 10f; - if (npc.ai[2] > 50f || Main.netMode != NetmodeID.Server) + if (npc.ai[2] > 50f || !Main.dedServ) { npc.life = -1; npc.HitEffect(0, 10.0); @@ -1403,7 +1403,7 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses if (!Main.npc[(int)npc.ai[1]].active || Main.npc[(int)npc.ai[1]].aiStyle != NPCAIStyleID.SkeletronPrimeHead) { npc.ai[2] += 10f; - if (npc.ai[2] > 50f || Main.netMode != NetmodeID.Server) + if (npc.ai[2] > 50f || !Main.dedServ) { npc.life = -1; npc.HitEffect(0, 10.0); @@ -1768,7 +1768,7 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses if (!Main.npc[(int)npc.ai[1]].active || Main.npc[(int)npc.ai[1]].aiStyle != NPCAIStyleID.SkeletronPrimeHead) { npc.ai[2] += 10f; - if (npc.ai[2] > 50f || Main.netMode != NetmodeID.Server) + if (npc.ai[2] > 50f || !Main.dedServ) { npc.life = -1; npc.HitEffect(0, 10.0); @@ -2385,7 +2385,7 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses if (!Main.npc[(int)npc.ai[1]].active || Main.npc[(int)npc.ai[1]].aiStyle != NPCAIStyleID.SkeletronPrimeHead) { npc.ai[2] += 10f; - if (npc.ai[2] > 50f || Main.netMode != NetmodeID.Server) + if (npc.ai[2] > 50f || !Main.dedServ) { npc.life = -1; npc.HitEffect(); @@ -2670,7 +2670,7 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses if (!Main.npc[(int)npc.ai[1]].active || Main.npc[(int)npc.ai[1]].aiStyle != NPCAIStyleID.SkeletronPrimeHead) { npc.ai[2] += 10f; - if (npc.ai[2] > 50f || Main.netMode != NetmodeID.Server) + if (npc.ai[2] > 50f || !Main.dedServ) { npc.life = -1; npc.HitEffect(); @@ -2945,7 +2945,7 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses if (!Main.npc[(int)npc.ai[1]].active || Main.npc[(int)npc.ai[1]].aiStyle != NPCAIStyleID.SkeletronPrimeHead) { npc.ai[2] += 10f; - if (npc.ai[2] > 50f || Main.netMode != NetmodeID.Server) + if (npc.ai[2] > 50f || !Main.dedServ) { npc.life = -1; npc.HitEffect(); @@ -3249,7 +3249,7 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses if (!Main.npc[(int)npc.ai[1]].active || Main.npc[(int)npc.ai[1]].aiStyle != NPCAIStyleID.SkeletronPrimeHead) { npc.ai[2] += 10f; - if (npc.ai[2] > 50f || Main.netMode != NetmodeID.Server) + if (npc.ai[2] > 50f || !Main.dedServ) { npc.life = -1; npc.HitEffect(); diff --git a/NPCs/VanillaNPCAIOverrides/Bosses/TwinsAI.cs b/NPCs/VanillaNPCAIOverrides/Bosses/TwinsAI.cs index 1bdc9d817e..1ba4788bab 100644 --- a/NPCs/VanillaNPCAIOverrides/Bosses/TwinsAI.cs +++ b/NPCs/VanillaNPCAIOverrides/Bosses/TwinsAI.cs @@ -414,7 +414,7 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses { SoundEngine.PlaySound(SoundID.NPCHit1, npc.Center); - if (Main.netMode != NetmodeID.Server) + if (!Main.dedServ) { for (int i = 0; i < 2; i++) { @@ -1166,7 +1166,7 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses { SoundEngine.PlaySound(SoundID.NPCHit1, npc.Center); - if (Main.netMode != NetmodeID.Server) + if (!Main.dedServ) { for (int i = 0; i < 2; i++) { diff --git a/NPCs/VanillaNPCAIOverrides/Bosses/WallOfFleshAI.cs b/NPCs/VanillaNPCAIOverrides/Bosses/WallOfFleshAI.cs index 26f7112402..94cc034852 100644 --- a/NPCs/VanillaNPCAIOverrides/Bosses/WallOfFleshAI.cs +++ b/NPCs/VanillaNPCAIOverrides/Bosses/WallOfFleshAI.cs @@ -69,7 +69,7 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses if (!WorldGen.SolidTile(targetTileX, targetTileY)) { int impSpawn = NPC.NewNPC(npc.GetSource_FromAI(), targetTileX * 16 + 8, targetTileY * 16, NPCID.FireImp); - if (Main.netMode == NetmodeID.Server && impSpawn < Main.maxNPCs) + if (Main.dedServ && impSpawn < Main.maxNPCs) NetMessage.SendData(MessageID.SyncNPC, -1, -1, null, impSpawn); break; @@ -944,7 +944,7 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses if (!WorldGen.SolidTile(num353, num354)) { int num355 = NPC.NewNPC(npc.GetSource_FromAI(), num353 * 16 + 8, num354 * 16, 24); - if (Main.netMode == NetmodeID.Server && num355 < Main.maxNPCs) + if (Main.dedServ && num355 < Main.maxNPCs) NetMessage.SendData(MessageID.SyncNPC, -1, -1, null, num355); break; diff --git a/NPCs/VanillaNPCAIOverrides/RegularEnemies/RevengeanceAndDeathAI.cs b/NPCs/VanillaNPCAIOverrides/RegularEnemies/RevengeanceAndDeathAI.cs index 7ec2bdf1e9..a050f29f7d 100644 --- a/NPCs/VanillaNPCAIOverrides/RegularEnemies/RevengeanceAndDeathAI.cs +++ b/NPCs/VanillaNPCAIOverrides/RegularEnemies/RevengeanceAndDeathAI.cs @@ -577,7 +577,7 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.RegularEnemies { MedusaHeadDustEffect(npc, time); } - if (Main.netMode != NetmodeID.Server) + if (!Main.dedServ) { Player player = Main.player[Main.myPlayer]; if (!player.dead && player.active && player.FindBuffIndex(BuffID.Stoned) == -1) @@ -3420,7 +3420,7 @@ PrepareToShoot: if (npcType == NPCID.GoblinPeon) { WorldGen.KillTile(x, y - 1, false, false, false); - if (Main.netMode == NetmodeID.Server) + if (Main.dedServ) { NetMessage.SendData(MessageID.TileManipulation, -1, -1, null, 0, (float)x, (float)(y - 1), 0f, 0, 0, 0); } @@ -3435,7 +3435,7 @@ PrepareToShoot: npc.ai[3] = (float)aiGateValue; npc.netUpdate = true; } - if (Main.netMode == NetmodeID.Server & canOpenDoor) + if (Main.dedServ & canOpenDoor) { NetMessage.SendData(MessageID.ToggleDoorState, -1, -1, null, 0, (float)x, (float)(y - 1), (float)npc.direction, 0, 0, 0); } @@ -3448,7 +3448,7 @@ PrepareToShoot: npc.ai[3] = (float)aiGateValue; npc.netUpdate = true; } - if (Main.netMode == NetmodeID.Server & canOpenTallGate) + if (Main.dedServ & canOpenTallGate) { NetMessage.SendData(MessageID.ToggleDoorState, -1, -1, null, 4, (float)x, (float)(y - 1), 0f, 0, 0, 0); } @@ -4599,7 +4599,7 @@ PrepareToShoot: } } - if (!npc.active && Main.netMode == NetmodeID.Server) + if (!npc.active && Main.dedServ) { NetMessage.SendData(MessageID.DamageNPC, -1, -1, null, npc.whoAmI, -1f, 0f, 0f, 0, 0, 0); } @@ -5072,13 +5072,13 @@ PrepareToShoot: int differentSegment = (int)Main.npc[q].ai[0]; Main.npc[q].active = false; npc.life = 0; - if (Main.netMode == NetmodeID.Server) + if (Main.dedServ) { NetMessage.SendData(MessageID.SyncNPC, -1, -1, null, q, 0f, 0f, 0f, 0, 0, 0); } q = differentSegment; } - if (Main.netMode == NetmodeID.Server) + if (Main.dedServ) { NetMessage.SendData(MessageID.SyncNPC, -1, -1, null, npc.whoAmI, 0f, 0f, 0f, 0, 0, 0); } @@ -8653,7 +8653,7 @@ PrepareToShoot: dust.noGravity = true; } - if (Main.netMode != NetmodeID.Server) + if (!Main.dedServ) { for (int j = 0; j < 4; j++) { diff --git a/Packets/MusicSystems/MusicEventSyncRequestPacket.cs b/Packets/MusicSystems/MusicEventSyncRequestPacket.cs index f2332bba2b..44b5425f09 100644 --- a/Packets/MusicSystems/MusicEventSyncRequestPacket.cs +++ b/Packets/MusicSystems/MusicEventSyncRequestPacket.cs @@ -30,7 +30,7 @@ namespace CalamityMod.Packets public override void HandlePacket(in BinaryReader packet, int sender) { // Only fulfill requests as the server host - if (Main.netMode != NetmodeID.Server) + if (!Main.dedServ) return; MusicEventSyncResponsePacket.Send(toClient: sender); diff --git a/Packets/MusicSystems/MusicEventSyncResponsePacket.cs b/Packets/MusicSystems/MusicEventSyncResponsePacket.cs index 4584f78089..adf9a3751e 100644 --- a/Packets/MusicSystems/MusicEventSyncResponsePacket.cs +++ b/Packets/MusicSystems/MusicEventSyncResponsePacket.cs @@ -20,7 +20,7 @@ namespace CalamityMod.Packets public static void Send(int toClient = -1, int ignoreClient = -1) { // Only Server should send Reponse to Clients - if (Main.netMode != NetmodeID.Server) + if (!Main.dedServ) return; var packet = Instance.CreateBasePacket(); diff --git a/Packets/Players/CooldownAdditionPacket.cs b/Packets/Players/CooldownAdditionPacket.cs index 831a0f1c3b..a5906855a9 100644 --- a/Packets/Players/CooldownAdditionPacket.cs +++ b/Packets/Players/CooldownAdditionPacket.cs @@ -53,7 +53,7 @@ namespace CalamityMod.Packets string id = CooldownRegistry.registry[instance.netID].ID; player.cooldowns[id] = instance; } - else if (Main.netMode == NetmodeID.Server) + else if (Main.dedServ) { // Server should NOT handle cooldown itself! // Server doesn't have information for cooldown netIDs! diff --git a/Packets/Players/CooldownRemovalPacket.cs b/Packets/Players/CooldownRemovalPacket.cs index bc65bf7636..1bcd2235f6 100644 --- a/Packets/Players/CooldownRemovalPacket.cs +++ b/Packets/Players/CooldownRemovalPacket.cs @@ -52,7 +52,7 @@ namespace CalamityMod.Packets player.cooldowns.Remove(CooldownRegistry.registry[netID].ID); } } - else if (Main.netMode == NetmodeID.Server) + else if (Main.dedServ) { // Server should NOT handle cooldown itself! // Server doesn't have information for cooldown netIDs! diff --git a/Packets/Players/SyncCooldownDictionaryPacket.cs b/Packets/Players/SyncCooldownDictionaryPacket.cs index b03393c755..ba8cf8b74b 100644 --- a/Packets/Players/SyncCooldownDictionaryPacket.cs +++ b/Packets/Players/SyncCooldownDictionaryPacket.cs @@ -100,7 +100,7 @@ namespace CalamityMod.Packets } } } - else if (Main.netMode == NetmodeID.Server) + else if (Main.dedServ) { // Server should NOT handle cooldown itself! // Server doesn't have information for cooldown netIDs! diff --git a/Particles/AresCannonChargeParticleSet.cs b/Particles/AresCannonChargeParticleSet.cs index 5e9b00f425..057d126e6d 100644 --- a/Particles/AresCannonChargeParticleSet.cs +++ b/Particles/AresCannonChargeParticleSet.cs @@ -50,7 +50,7 @@ namespace CalamityMod.Particles public override void Update() { // Don't perform any operations on the server. Doing so would be a waste of space as these sets are entirely based on drawcode. - if (Main.netMode == NetmodeID.Server) + if (Main.dedServ) return; if (bloom == null) diff --git a/Particles/BaseParticleSet.cs b/Particles/BaseParticleSet.cs index 16f6432ed3..29e4ad197e 100644 --- a/Particles/BaseParticleSet.cs +++ b/Particles/BaseParticleSet.cs @@ -48,7 +48,7 @@ namespace CalamityMod.Particles public virtual void Update() { // Don't perform any operations on the server. Doing so would be a waste of space as these sets are entirely based on drawcode. - if (Main.netMode == NetmodeID.Server) + if (Main.dedServ) return; //Spawn new particles if time remains @@ -74,7 +74,7 @@ namespace CalamityMod.Particles public virtual void DrawSet(Vector2 basePosition) { - if (Main.netMode == NetmodeID.Server) + if (Main.dedServ) return; IEnumerable orderedParticles = Particles; diff --git a/Particles/DeathAshParticle.cs b/Particles/DeathAshParticle.cs index eae6742705..9d7c9e5da7 100644 --- a/Particles/DeathAshParticle.cs +++ b/Particles/DeathAshParticle.cs @@ -36,7 +36,7 @@ namespace CalamityMod.Particles { get { - if (Main.netMode != NetmodeID.Server && basicShader is null) + if (!Main.dedServ && basicShader is null) { basicShader = new BasicEffect(Main.instance.GraphicsDevice) { @@ -88,7 +88,7 @@ namespace CalamityMod.Particles public static void CreateAshesFromNPC(NPC npc, Vector2 velocityOverride) { // Don't create ashes serverside. - if (Main.netMode == NetmodeID.Server) + if (Main.dedServ) return; VelOverride = velocityOverride; @@ -250,7 +250,7 @@ namespace CalamityMod.Particles public static void UpdateAll() { // Don't draw ashes serverside. - if (Main.netMode == NetmodeID.Server) + if (Main.dedServ) return; foreach (DeathAshParticle ash in Ashes) diff --git a/Particles/GeneralParticleHandler.cs b/Particles/GeneralParticleHandler.cs index d37925abd5..5edab9f428 100644 --- a/Particles/GeneralParticleHandler.cs +++ b/Particles/GeneralParticleHandler.cs @@ -85,7 +85,7 @@ namespace CalamityMod.Particles // Don't queue particles if the game is paused. // This precedent is established with how Dust instances are created. // Don't spawn particles if on the server either, or if the particles dictionary is somehow null. - if (Main.gamePaused || Main.netMode == NetmodeID.Server || particles == null) + if (Main.gamePaused || Main.dedServ || particles == null) return; if (particles.Count >= CalamityClientConfig.Instance.ParticleLimit && !particle.Important) @@ -100,7 +100,7 @@ namespace CalamityMod.Particles // Don't queue particles if the game is paused. // This precedent is established with how Dust instances are created. // Don't spawn particles if on the server side, or if the particles dictionary is somehow null. - if (Main.gamePaused || Main.netMode == NetmodeID.Server || particles == null) + if (Main.gamePaused || Main.dedServ || particles == null) return; particlesToSpawnNextFrame.Enqueue(particle); diff --git a/Projectiles/Boss/ApolloRocket.cs b/Projectiles/Boss/ApolloRocket.cs index 252450cd0d..7328a7f6e0 100644 --- a/Projectiles/Boss/ApolloRocket.cs +++ b/Projectiles/Boss/ApolloRocket.cs @@ -235,7 +235,7 @@ namespace CalamityMod.Projectiles.Boss Main.dust[dust].velocity *= 2f; } - if (Main.netMode != NetmodeID.Server) + if (!Main.dedServ) { Vector2 goreSource = Projectile.Center; int goreAmt = 3; diff --git a/Projectiles/Boss/AresGaussNukeProjectile.cs b/Projectiles/Boss/AresGaussNukeProjectile.cs index 32f0663f36..116e59a084 100644 --- a/Projectiles/Boss/AresGaussNukeProjectile.cs +++ b/Projectiles/Boss/AresGaussNukeProjectile.cs @@ -183,7 +183,7 @@ namespace CalamityMod.Projectiles.Boss // Nuke explosion sound. SoundEngine.PlaySound(AresGaussNuke.NukeExplosionSound, Projectile.Center); - if (Main.netMode != NetmodeID.Server) + if (!Main.dedServ) { // Nuke gores Gore.NewGore(Projectile.GetSource_Death(), Projectile.position, Projectile.velocity, Mod.Find("AresGaussNuke1").Type, 1f); diff --git a/Projectiles/Boss/FlareBomb.cs b/Projectiles/Boss/FlareBomb.cs index b46e89914d..0d9d4a4d21 100644 --- a/Projectiles/Boss/FlareBomb.cs +++ b/Projectiles/Boss/FlareBomb.cs @@ -134,7 +134,7 @@ namespace CalamityMod.Projectiles.Boss Main.dust[idx].velocity *= 2f; } - if (Main.netMode != NetmodeID.Server) + if (!Main.dedServ) { Vector2 goreSource = Projectile.Center; int goreAmt = 3; diff --git a/Projectiles/Boss/FlareDust.cs b/Projectiles/Boss/FlareDust.cs index 29eca0fc93..24a4917bfb 100644 --- a/Projectiles/Boss/FlareDust.cs +++ b/Projectiles/Boss/FlareDust.cs @@ -142,7 +142,7 @@ namespace CalamityMod.Projectiles.Boss Main.dust[idx].velocity *= 2f; } - if (Main.netMode != NetmodeID.Server) + if (!Main.dedServ) { Vector2 goreSource = Projectile.Center; int goreAmt = 3; diff --git a/Projectiles/Boss/FlareDust2.cs b/Projectiles/Boss/FlareDust2.cs index 0627b6fd6b..a2252c2bca 100644 --- a/Projectiles/Boss/FlareDust2.cs +++ b/Projectiles/Boss/FlareDust2.cs @@ -82,7 +82,7 @@ namespace CalamityMod.Projectiles.Boss Main.dust[idx].velocity *= 2f; } - if (Main.netMode != NetmodeID.Server) + if (!Main.dedServ) { Vector2 goreSource = Projectile.Center; int goreAmt = 3; diff --git a/Projectiles/Boss/HiveBombGoliath.cs b/Projectiles/Boss/HiveBombGoliath.cs index 0ebaf1fcc6..0f763d7085 100644 --- a/Projectiles/Boss/HiveBombGoliath.cs +++ b/Projectiles/Boss/HiveBombGoliath.cs @@ -129,7 +129,7 @@ namespace CalamityMod.Projectiles.Boss Main.dust[plagued2].velocity *= 2f; } - if (Main.netMode != NetmodeID.Server) + if (!Main.dedServ) { Vector2 goreSource = Projectile.Center; int goreAmt = 3; diff --git a/Projectiles/Boss/LeviathanSpawner.cs b/Projectiles/Boss/LeviathanSpawner.cs index 5bca369957..1826c1ba3e 100644 --- a/Projectiles/Boss/LeviathanSpawner.cs +++ b/Projectiles/Boss/LeviathanSpawner.cs @@ -50,7 +50,7 @@ namespace CalamityMod.Projectiles.Boss if (Projectile.timeLeft == 45) { - if (Main.netMode != NetmodeID.Server) + if (!Main.dedServ) { WaterShaderData ripple = (WaterShaderData)Filters.Scene["WaterDistortion"].GetShader(); Vector2 ripplePos = Projectile.Center; @@ -73,7 +73,7 @@ namespace CalamityMod.Projectiles.Boss public void CreateVisuals() { - if (Main.netMode == NetmodeID.Server) + if (Main.dedServ) return; WorldUtils.Find((Projectile.Center - Vector2.UnitY * 1200f).ToTileCoordinates(), Searches.Chain(new Searches.Down(150), new CustomConditions.IsWater()), out Point waterTop); diff --git a/Projectiles/Boss/OverlyDramaticDukeSummoner.cs b/Projectiles/Boss/OverlyDramaticDukeSummoner.cs index b0c177b13f..57c685ea48 100644 --- a/Projectiles/Boss/OverlyDramaticDukeSummoner.cs +++ b/Projectiles/Boss/OverlyDramaticDukeSummoner.cs @@ -139,7 +139,7 @@ namespace CalamityMod.Projectiles.Boss return; } - if (Main.netMode == NetmodeID.Server) + if (Main.dedServ) { ChatHelper.BroadcastChatMessage(NetworkText.FromKey("Announcement.HasAwoken", new object[] { diff --git a/Projectiles/Boss/ScavengerNuke.cs b/Projectiles/Boss/ScavengerNuke.cs index d06ad984ed..8da689fd1c 100644 --- a/Projectiles/Boss/ScavengerNuke.cs +++ b/Projectiles/Boss/ScavengerNuke.cs @@ -124,7 +124,7 @@ namespace CalamityMod.Projectiles.Boss Main.dust[nukeDust2].velocity *= 2f; } - if (Main.netMode != NetmodeID.Server) + if (!Main.dedServ) { Vector2 goreSource = Projectile.Center; int goreAmt = 3; diff --git a/Projectiles/CalamityGlobalProjectile.cs b/Projectiles/CalamityGlobalProjectile.cs index 681f239e72..5cef5d7970 100644 --- a/Projectiles/CalamityGlobalProjectile.cs +++ b/Projectiles/CalamityGlobalProjectile.cs @@ -1502,7 +1502,7 @@ namespace CalamityMod.Projectiles if (Main.rand.NextBool(10)) Dust.NewDust(projectile.position, projectile.width, projectile.height, DustID.Enchanted_Pink, projectile.velocity.X * 0.5f, projectile.velocity.Y * 0.5f, 150, default, 1.2f); - if (Main.rand.NextBool(20) && Main.netMode != NetmodeID.Server) + if (Main.rand.NextBool(20) && !Main.dedServ) Gore.NewGore(projectile.GetSource_FromAI(), projectile.position, projectile.velocity * 0.2f, Main.rand.Next(16, 18), 1f); } @@ -3989,7 +3989,7 @@ namespace CalamityMod.Projectiles confetti.velocity.X += Main.rand.Next(-50, 51) * 0.05f; confetti.velocity.Y += Main.rand.Next(-50, 51) * 0.05f; } - if (Main.rand.NextBool(40) && Main.netMode != NetmodeID.Server) + if (Main.rand.NextBool(40) && !Main.dedServ) { int Type = Main.rand.Next(276, 283); Gore confetti = Gore.NewGoreDirect(projectile.GetSource_FromAI(), projectile.position, velocity, Type, 1f); @@ -4333,7 +4333,7 @@ namespace CalamityMod.Projectiles // Create sparks on hit to hammer in the defense shredding. if (deepcoreBullet) { - if (Main.netMode != NetmodeID.Server) + if (!Main.dedServ) { Vector2 cen = Vector2.Lerp(projectile.Center, target.Center, 0.65f); int numSparks = Main.rand.Next(2, 5); diff --git a/Projectiles/Enemy/AstralMeteorProj.cs b/Projectiles/Enemy/AstralMeteorProj.cs index aa52ac2ac9..0f43d65bcf 100644 --- a/Projectiles/Enemy/AstralMeteorProj.cs +++ b/Projectiles/Enemy/AstralMeteorProj.cs @@ -63,7 +63,7 @@ namespace CalamityMod.Projectiles.Enemy } } - if (Main.netMode != NetmodeID.Server) + if (!Main.dedServ) { int goreCount = 3; Vector2 goreSource = Projectile.Center; diff --git a/Projectiles/Enemy/EarthRockBig.cs b/Projectiles/Enemy/EarthRockBig.cs index 9c6b8b2761..6d24b0c175 100644 --- a/Projectiles/Enemy/EarthRockBig.cs +++ b/Projectiles/Enemy/EarthRockBig.cs @@ -76,7 +76,7 @@ namespace CalamityMod.Projectiles.Enemy Main.dust[earthyDust2].velocity *= 2f; } - if (Main.netMode != NetmodeID.Server) + if (!Main.dedServ) { Vector2 goreSource = Projectile.Center; int goreAmt = 3; diff --git a/Projectiles/Enemy/EarthRockSmall.cs b/Projectiles/Enemy/EarthRockSmall.cs index 50fe80569b..3ce772af66 100644 --- a/Projectiles/Enemy/EarthRockSmall.cs +++ b/Projectiles/Enemy/EarthRockSmall.cs @@ -54,7 +54,7 @@ namespace CalamityMod.Projectiles.Enemy Main.dust[earthyDust2].velocity *= 2f; } - if (Main.netMode != NetmodeID.Server) + if (!Main.dedServ) { Vector2 goreSource = Projectile.Center; int goreAmt = 3; diff --git a/Projectiles/Magic/Asteroid.cs b/Projectiles/Magic/Asteroid.cs index 5d354632ee..f481a41547 100644 --- a/Projectiles/Magic/Asteroid.cs +++ b/Projectiles/Magic/Asteroid.cs @@ -85,7 +85,7 @@ namespace CalamityMod.Projectiles.Magic Main.dust[killDust].velocity *= 2f; Main.dust[killDust].noGravity = true; } - if (Main.netMode != NetmodeID.Server) + if (!Main.dedServ) { for (int k = 0; k < 2; k++) { diff --git a/Projectiles/Magic/AsteroidMolten.cs b/Projectiles/Magic/AsteroidMolten.cs index 5c1561bd7b..593186be24 100644 --- a/Projectiles/Magic/AsteroidMolten.cs +++ b/Projectiles/Magic/AsteroidMolten.cs @@ -81,7 +81,7 @@ namespace CalamityMod.Projectiles.Magic Main.dust[killFire].velocity *= 2f; Main.dust[killFire].noGravity = true; } - if (Main.netMode != NetmodeID.Server) + if (!Main.dedServ) { for (int k = 0; k < 2; k++) { diff --git a/Projectiles/Magic/AstralStarMagic.cs b/Projectiles/Magic/AstralStarMagic.cs index 5b201e4b1e..075eb98bf5 100644 --- a/Projectiles/Magic/AstralStarMagic.cs +++ b/Projectiles/Magic/AstralStarMagic.cs @@ -78,7 +78,7 @@ namespace CalamityMod.Projectiles.Magic Main.dust[idx].position = Projectile.Center + velocity * 6f; } - if (Main.rand.NextBool(24) && Main.netMode != NetmodeID.Server) + if (Main.rand.NextBool(24) && !Main.dedServ) { int idx = Gore.NewGore(Projectile.GetSource_FromAI(), Projectile.Center, Projectile.velocity * 0.1f, 16, 1f); Main.gore[idx].velocity *= 0.66f; @@ -108,7 +108,7 @@ namespace CalamityMod.Projectiles.Magic Dust.NewDust(Projectile.position, Projectile.width, Projectile.height, ModContent.DustType(), Projectile.velocity.X * 0.25f, Projectile.velocity.Y * 0.25f, 150); } - if (Main.rand.NextBool(10) && Main.netMode != NetmodeID.Server) + if (Main.rand.NextBool(10) && !Main.dedServ) Gore.NewGore(Projectile.GetSource_FromAI(), Projectile.position, Projectile.velocity * 0.1f, Main.rand.Next(16, 18), 1f); if (Projectile.ai[0] == 1f) @@ -176,7 +176,7 @@ namespace CalamityMod.Projectiles.Magic Main.dust[idx].velocity *= 2f; } - if (Main.netMode != NetmodeID.Server) + if (!Main.dedServ) { for (int i = 0; i < 3; i++) Gore.NewGore(Projectile.GetSource_Death(), Projectile.position, Projectile.velocity * 0.05f, Main.rand.Next(16, 18), 1f); diff --git a/Projectiles/Magic/BlindingLight.cs b/Projectiles/Magic/BlindingLight.cs index b4b206a6da..a5a5b0602b 100644 --- a/Projectiles/Magic/BlindingLight.cs +++ b/Projectiles/Magic/BlindingLight.cs @@ -42,7 +42,7 @@ namespace CalamityMod.Projectiles.Magic float progress = (float)Math.Sin(Projectile.ai[0] / Lifetime * MathHelper.Pi); if (Projectile.ai[0] > 55f) progress = MathHelper.Lerp(progress, 0f, (Projectile.ai[0] - 55f) / 5f); - if (Main.netMode != NetmodeID.Server && Projectile.ai[0] > 15f) // Otherwise a white flash appears, but it quickly disappears. + if (!Main.dedServ && Projectile.ai[0] > 15f) // Otherwise a white flash appears, but it quickly disappears. { if (!Filters.Scene["CalamityMod:LightBurst"].IsActive()) Filters.Scene.Activate("CalamityMod:LightBurst", Projectile.Center).GetShader().UseTargetPosition(Projectile.Center).UseProgress(0f); @@ -53,7 +53,7 @@ namespace CalamityMod.Projectiles.Magic public override void OnKill(int timeLeft) { - if (Main.netMode != NetmodeID.Server) + if (!Main.dedServ) Filters.Scene.Deactivate("CalamityMod:LightBurst"); } diff --git a/Projectiles/Magic/ClamorNoctusStar.cs b/Projectiles/Magic/ClamorNoctusStar.cs index 0930c2506c..ed88380a08 100644 --- a/Projectiles/Magic/ClamorNoctusStar.cs +++ b/Projectiles/Magic/ClamorNoctusStar.cs @@ -81,7 +81,7 @@ namespace CalamityMod.Projectiles.Magic brightDust2 = Dust.NewDust(Projectile.position, Projectile.width, Projectile.height, DustID.PurificationPowder, 0f, 0f, 100, default, 1f); Main.dust[brightDust2].velocity *= 2f; } - if (Main.netMode != NetmodeID.Server) + if (!Main.dedServ) { for (int k = 0; k < 3; k++) { diff --git a/Projectiles/Magic/ClamorNoctusWyvern.cs b/Projectiles/Magic/ClamorNoctusWyvern.cs index 3de2a503bc..8196533cc1 100644 --- a/Projectiles/Magic/ClamorNoctusWyvern.cs +++ b/Projectiles/Magic/ClamorNoctusWyvern.cs @@ -46,7 +46,7 @@ namespace CalamityMod.Projectiles.Magic { Dust.NewDust(Projectile.position + Projectile.velocity, Projectile.width, Projectile.height, DustID.Shadewood, Projectile.oldVelocity.X * 0.5f, Projectile.oldVelocity.Y * 0.5f); } - if (Main.netMode != NetmodeID.Server) + if (!Main.dedServ) { int head = Gore.NewGore(Projectile.GetSource_Death(), Projectile.Center, Projectile.velocity * 0.8f, Mod.Find("ClamorNoctusHead").Type); Main.gore[head].timeLeft /= 10; diff --git a/Projectiles/Magic/DarkSparkBeam.cs b/Projectiles/Magic/DarkSparkBeam.cs index aee980f024..242551db4a 100644 --- a/Projectiles/Magic/DarkSparkBeam.cs +++ b/Projectiles/Magic/DarkSparkBeam.cs @@ -161,7 +161,7 @@ namespace CalamityMod.Projectiles.Magic DelegateMethods.v3_1 = color.ToVector3() * 0.3f; Vector2 size = new Vector2(Projectile.velocity.Length() * Projectile.localAI[1], Projectile.width * Projectile.scale); float shaderLength = Projectile.velocity.ToRotation(); - if (Main.netMode != NetmodeID.Server) + if (!Main.dedServ) ((WaterShaderData)Filters.Scene["WaterDistortion"].GetShader()).QueueRipple(Projectile.position + new Vector2(size.X * 0.5f, 0f).RotatedBy(shaderLength), color, size, RippleShape.Square, shaderLength); Utils.PlotTileLine(Projectile.Center, Projectile.Center + Projectile.velocity * Projectile.localAI[1], Projectile.width * Projectile.scale, DelegateMethods.CastLight); diff --git a/Projectiles/Magic/MadAlchemistsCocktailAlt.cs b/Projectiles/Magic/MadAlchemistsCocktailAlt.cs index ea0c2e3dde..4bc6077cae 100644 --- a/Projectiles/Magic/MadAlchemistsCocktailAlt.cs +++ b/Projectiles/Magic/MadAlchemistsCocktailAlt.cs @@ -45,7 +45,7 @@ namespace CalamityMod.Projectiles.Magic SoundEngine.PlaySound(SoundID.Item20, Projectile.Center); SoundEngine.PlaySound(SoundID.Item107, Projectile.Center); - if (Main.netMode != NetmodeID.Server) + if (!Main.dedServ) { Gore.NewGore(Projectile.GetSource_Death(), Projectile.Center, -Projectile.oldVelocity * 0.2f, 704, 1f); Gore.NewGore(Projectile.GetSource_Death(), Projectile.Center, -Projectile.oldVelocity * 0.2f, 705, 1f); diff --git a/Projectiles/Magic/MadAlchemistsCocktailBlue.cs b/Projectiles/Magic/MadAlchemistsCocktailBlue.cs index a1a816d07b..1e5b83411e 100644 --- a/Projectiles/Magic/MadAlchemistsCocktailBlue.cs +++ b/Projectiles/Magic/MadAlchemistsCocktailBlue.cs @@ -39,7 +39,7 @@ namespace CalamityMod.Projectiles.Magic { SoundEngine.PlaySound(SoundID.Item107, Projectile.Center); - if (Main.netMode != NetmodeID.Server) + if (!Main.dedServ) { Gore.NewGore(Projectile.GetSource_Death(), Projectile.Center, -Projectile.oldVelocity * 0.2f, 704, 1f); Gore.NewGore(Projectile.GetSource_Death(), Projectile.Center, -Projectile.oldVelocity * 0.2f, 705, 1f); diff --git a/Projectiles/Magic/MadAlchemistsCocktailGreen.cs b/Projectiles/Magic/MadAlchemistsCocktailGreen.cs index 6114267a51..749b9ed2e1 100644 --- a/Projectiles/Magic/MadAlchemistsCocktailGreen.cs +++ b/Projectiles/Magic/MadAlchemistsCocktailGreen.cs @@ -40,7 +40,7 @@ namespace CalamityMod.Projectiles.Magic SoundEngine.PlaySound(SoundID.Item107, Projectile.Center); SoundEngine.PlaySound(SoundID.Item88, Projectile.Center); - if (Main.netMode != NetmodeID.Server) + if (!Main.dedServ) { Gore.NewGore(Projectile.GetSource_Death(), Projectile.Center, -Projectile.oldVelocity * 0.2f, 704, 1f); Gore.NewGore(Projectile.GetSource_Death(), Projectile.Center, -Projectile.oldVelocity * 0.2f, 705, 1f); diff --git a/Projectiles/Magic/MadAlchemistsCocktailPurple.cs b/Projectiles/Magic/MadAlchemistsCocktailPurple.cs index 3fc98ecb6c..222346e501 100644 --- a/Projectiles/Magic/MadAlchemistsCocktailPurple.cs +++ b/Projectiles/Magic/MadAlchemistsCocktailPurple.cs @@ -39,7 +39,7 @@ namespace CalamityMod.Projectiles.Magic { SoundEngine.PlaySound(SoundID.Item107, Projectile.Center); - if (Main.netMode != NetmodeID.Server) + if (!Main.dedServ) { Gore.NewGore(Projectile.GetSource_Death(), Projectile.Center, -Projectile.oldVelocity * 0.2f, 704, 1f); Gore.NewGore(Projectile.GetSource_Death(), Projectile.Center, -Projectile.oldVelocity * 0.2f, 705, 1f); diff --git a/Projectiles/Magic/MadAlchemistsCocktailRed.cs b/Projectiles/Magic/MadAlchemistsCocktailRed.cs index 9a7fb721b2..d449802240 100644 --- a/Projectiles/Magic/MadAlchemistsCocktailRed.cs +++ b/Projectiles/Magic/MadAlchemistsCocktailRed.cs @@ -40,7 +40,7 @@ namespace CalamityMod.Projectiles.Magic SoundEngine.PlaySound(SoundID.Item20, Projectile.Center); SoundEngine.PlaySound(SoundID.Item107, Projectile.Center); - if (Main.netMode != NetmodeID.Server) + if (!Main.dedServ) { Gore.NewGore(Projectile.GetSource_Death(), Projectile.Center, -Projectile.oldVelocity * 0.2f, 704, 1f); Gore.NewGore(Projectile.GetSource_Death(), Projectile.Center, -Projectile.oldVelocity * 0.2f, 705, 1f); diff --git a/Projectiles/Magic/MeteorStar.cs b/Projectiles/Magic/MeteorStar.cs index e983295e45..b1fc470aa9 100644 --- a/Projectiles/Magic/MeteorStar.cs +++ b/Projectiles/Magic/MeteorStar.cs @@ -44,7 +44,7 @@ namespace CalamityMod.Projectiles.Magic if (Main.rand.NextBool(4) || explodingSoon) SoundEngine.PlaySound(SoundID.Item9, Projectile.Center); } - if ((Main.rand.NextBool(12) || (explodingSoon && Main.rand.NextBool(3))) && Main.netMode != NetmodeID.Server) + if ((Main.rand.NextBool(12) || (explodingSoon && Main.rand.NextBool(3))) && !Main.dedServ) { Gore star = Gore.NewGoreDirect(Projectile.GetSource_FromAI(), Projectile.Center, Projectile.velocity * 0.2f, Main.rand.Next(16, 18), 1f); star.velocity *= 0.66f; @@ -142,7 +142,7 @@ namespace CalamityMod.Projectiles.Magic smoke.fadeIn = 1f + Main.rand.Next(10) * 0.1f; } } - if (Main.netMode != NetmodeID.Server) + if (!Main.dedServ) { for (int i = 0; i < 5; i++) { diff --git a/Projectiles/Magic/RancorFog.cs b/Projectiles/Magic/RancorFog.cs index 5ef1397d9e..af5e72d30e 100644 --- a/Projectiles/Magic/RancorFog.cs +++ b/Projectiles/Magic/RancorFog.cs @@ -38,7 +38,7 @@ namespace CalamityMod.Projectiles.Magic Projectile.velocity *= 0.985f; // 08DEC2023: Ozzatron: All below code does not run on dedicated servers as it requires clientside lighting information. - if (Main.netMode == NetmodeID.Server) + if (Main.dedServ) return; // Calculate light power. This checks below the position of the fog to check if this fog is underground. diff --git a/Projectiles/Magic/ValkyrieRayBeam.cs b/Projectiles/Magic/ValkyrieRayBeam.cs index c23a73f8d4..d1f2164ad8 100644 --- a/Projectiles/Magic/ValkyrieRayBeam.cs +++ b/Projectiles/Magic/ValkyrieRayBeam.cs @@ -94,7 +94,7 @@ namespace CalamityMod.Projectiles.Magic ProduceBeamDust(beamColor); // If the game is rendering (i.e. isn't a dedicated server), make the beam disturb water. - if (Main.netMode != NetmodeID.Server) + if (!Main.dedServ) { WaterShaderData wsd = (WaterShaderData)Filters.Scene["WaterDistortion"].GetShader(); // A universal time-based sinusoid which updates extremely rapidly. GlobalTimeWrappedHourly is 0 to 3600, measured in seconds. diff --git a/Projectiles/Magic/WyvernProjectile.cs b/Projectiles/Magic/WyvernProjectile.cs index 8900d5bdd0..e1e5c9c80a 100644 --- a/Projectiles/Magic/WyvernProjectile.cs +++ b/Projectiles/Magic/WyvernProjectile.cs @@ -45,7 +45,7 @@ namespace CalamityMod.Projectiles.Magic { Dust.NewDust(Projectile.position + Projectile.velocity, Projectile.width, Projectile.height, DustID.Cloud, Projectile.oldVelocity.X * 0.5f, Projectile.oldVelocity.Y * 0.5f); } - if (Main.netMode != NetmodeID.Server) + if (!Main.dedServ) { int head = Gore.NewGore(Projectile.GetSource_Death(), Projectile.Center, Projectile.velocity * 0.8f, Mod.Find("WyvernHead").Type); Main.gore[head].timeLeft /= 10; diff --git a/Projectiles/Magic/YharimsCrystalBeam.cs b/Projectiles/Magic/YharimsCrystalBeam.cs index 7c811c7501..105a0a852e 100644 --- a/Projectiles/Magic/YharimsCrystalBeam.cs +++ b/Projectiles/Magic/YharimsCrystalBeam.cs @@ -174,7 +174,7 @@ namespace CalamityMod.Projectiles.Magic ProduceBeamDust(beamColor); // If the game is rendering (i.e. isn't a dedicated server), make the beam disturb water. - if (Main.netMode != NetmodeID.Server) + if (!Main.dedServ) { WaterShaderData wsd = (WaterShaderData)Filters.Scene["WaterDistortion"].GetShader(); // A universal time-based sinusoid which updates extremely rapidly. GlobalTimeWrappedHourly is 0 to 3600, measured in seconds. diff --git a/Projectiles/Melee/AncientStar.cs b/Projectiles/Melee/AncientStar.cs index dfbfc0db3d..d798f5435c 100644 --- a/Projectiles/Melee/AncientStar.cs +++ b/Projectiles/Melee/AncientStar.cs @@ -73,7 +73,7 @@ namespace CalamityMod.Projectiles.Melee } } - if (Main.rand.NextBool(48) && Main.netMode != NetmodeID.Server) + if (Main.rand.NextBool(48) && !Main.dedServ) { int starGore = Gore.NewGore(Projectile.GetSource_FromAI(), Projectile.Center, new Vector2(Projectile.velocity.X * 0.2f, Projectile.velocity.Y * 0.2f), 16, 1f); Main.gore[starGore].velocity *= 0.66f; @@ -131,7 +131,7 @@ namespace CalamityMod.Projectiles.Melee GeneralParticleHandler.SpawnParticle(spark); } - if (Main.netMode != NetmodeID.Server) + if (!Main.dedServ) { for (int i = 0; i < 3; i++) { diff --git a/Projectiles/Melee/DragonRageFireball.cs b/Projectiles/Melee/DragonRageFireball.cs index ff741f31f5..40ea618ffa 100644 --- a/Projectiles/Melee/DragonRageFireball.cs +++ b/Projectiles/Melee/DragonRageFireball.cs @@ -96,7 +96,7 @@ namespace CalamityMod.Projectiles.Melee Main.dust[idx].velocity *= 2f; } - if (Main.netMode != NetmodeID.Server) + if (!Main.dedServ) { Vector2 goreSource = Projectile.Center; int goreAmt = 3; diff --git a/Projectiles/Melee/ElementalGlassStar.cs b/Projectiles/Melee/ElementalGlassStar.cs index 8c711f571f..940d229889 100644 --- a/Projectiles/Melee/ElementalGlassStar.cs +++ b/Projectiles/Melee/ElementalGlassStar.cs @@ -76,7 +76,7 @@ namespace CalamityMod.Projectiles.Melee } } - if (Main.rand.NextBool(48) && Main.netMode != NetmodeID.Server) + if (Main.rand.NextBool(48) && !Main.dedServ) { int starGore = Gore.NewGore(Projectile.GetSource_FromAI(), Projectile.Center, new Vector2(Projectile.velocity.X * 0.2f, Projectile.velocity.Y * 0.2f), 16, 1f); Main.gore[starGore].velocity *= 0.66f; @@ -132,7 +132,7 @@ namespace CalamityMod.Projectiles.Melee GeneralParticleHandler.SpawnParticle(spark); } - if (Main.netMode != NetmodeID.Server) + if (!Main.dedServ) { for (int i = 0; i < 3; i++) { diff --git a/Projectiles/Melee/GalileosPlanet.cs b/Projectiles/Melee/GalileosPlanet.cs index 5cf1d49137..5a1b7ac0d9 100644 --- a/Projectiles/Melee/GalileosPlanet.cs +++ b/Projectiles/Melee/GalileosPlanet.cs @@ -130,7 +130,7 @@ namespace CalamityMod.Projectiles.Melee } } - if (Main.netMode != NetmodeID.Server) + if (!Main.dedServ) { Vector2 goreSource = Projectile.Center; int goreAmt = 3; diff --git a/Projectiles/Melee/Spears/VulcaniteLanceProj.cs b/Projectiles/Melee/Spears/VulcaniteLanceProj.cs index 014132bc87..b2348aa66c 100644 --- a/Projectiles/Melee/Spears/VulcaniteLanceProj.cs +++ b/Projectiles/Melee/Spears/VulcaniteLanceProj.cs @@ -37,7 +37,7 @@ namespace CalamityMod.Projectiles.Melee.Spears Dust.NewDust(Projectile.position + Projectile.velocity, Projectile.width, Projectile.height, Main.rand.NextBool(3) ? 16 : 127, Projectile.velocity.X * 0.5f, Projectile.velocity.Y * 0.5f); Vector2 goreVec = Projectile.Center + Projectile.velocity; - if (Main.rand.NextBool(8) && Main.netMode != NetmodeID.Server) + if (Main.rand.NextBool(8) && !Main.dedServ) { int smoke = Gore.NewGore(Projectile.GetSource_FromAI(), goreVec, default, Main.rand.Next(375, 378), 1f); Main.gore[smoke].behindTiles = true; diff --git a/Projectiles/Melee/StreamGougePortal.cs b/Projectiles/Melee/StreamGougePortal.cs index 12c3f98945..f2eb585a16 100644 --- a/Projectiles/Melee/StreamGougePortal.cs +++ b/Projectiles/Melee/StreamGougePortal.cs @@ -96,7 +96,7 @@ namespace CalamityMod.Projectiles.Melee { target.AddBuff(ModContent.BuffType(), 300); SoundEngine.PlaySound(SoundID.Item74, target.Center); - if (Main.netMode == NetmodeID.Server) + if (Main.dedServ) return; Color impactColor = Color.Lerp(Color.Cyan, Color.White, Main.rand.NextFloat(0.3f, 0.64f)); diff --git a/Projectiles/Melee/ViolenceThrownProjectile.cs b/Projectiles/Melee/ViolenceThrownProjectile.cs index 9b2db2a9b5..5c8bc84c26 100644 --- a/Projectiles/Melee/ViolenceThrownProjectile.cs +++ b/Projectiles/Melee/ViolenceThrownProjectile.cs @@ -104,7 +104,7 @@ namespace CalamityMod.Projectiles.Melee public override void OnHitNPC(NPC target, NPC.HitInfo hit, int damageDone) { - if (Main.netMode != NetmodeID.Server) + if (!Main.dedServ) { // Play a splatter and impact sound. SoundEngine.PlaySound(SoundID.DD2_CrystalCartImpact, Projectile.Center); diff --git a/Projectiles/Melee/WulfrumScrew.cs b/Projectiles/Melee/WulfrumScrew.cs index 1f6bb696fc..2a245b5267 100644 --- a/Projectiles/Melee/WulfrumScrew.cs +++ b/Projectiles/Melee/WulfrumScrew.cs @@ -110,7 +110,7 @@ namespace CalamityMod.Projectiles.Melee } } - if (!screwRegained && Main.netMode != NetmodeID.Server) + if (!screwRegained && !Main.dedServ) { Gore screwGore = Gore.NewGorePerfect(Projectile.GetSource_Death(), Projectile.position, -Vector2.UnitY.RotatedByRandom(MathHelper.PiOver4) * Main.rand.NextFloat(4f, 6f) + Projectile.velocity * 0.7f, Mod.Find("WulfrumScrewGore").Type); screwGore.timeLeft = 20; @@ -127,7 +127,7 @@ namespace CalamityMod.Projectiles.Melee SoundEngine.PlaySound(CommonCalamitySounds.WulfrumNPCDeathSound, Projectile.Center); SoundEngine.PlaySound(WulfrumKnife.TileHitSound, Projectile.Center); - if (Main.netMode != NetmodeID.Server) + if (!Main.dedServ) { Gore screwGore = Gore.NewGorePerfect(Projectile.GetSource_Death(), Projectile.position, -Vector2.UnitY.RotatedByRandom(MathHelper.PiOver4) * Main.rand.NextFloat(1f, 3f) + Projectile.velocity * 0.7f, Mod.Find("WulfrumScrewGore").Type); screwGore.timeLeft = 20; diff --git a/Projectiles/Melee/Yoyos/FaultLineYoyo.cs b/Projectiles/Melee/Yoyos/FaultLineYoyo.cs index 0efc358a1f..8ffe1ba0b9 100644 --- a/Projectiles/Melee/Yoyos/FaultLineYoyo.cs +++ b/Projectiles/Melee/Yoyos/FaultLineYoyo.cs @@ -40,7 +40,7 @@ namespace CalamityMod.Projectiles.Melee.Yoyos if (Main.rand.NextBool(5)) Dust.NewDust(Projectile.position + Projectile.velocity, Projectile.width, Projectile.height, Main.rand.NextBool(3) ? 16 : 127, Projectile.velocity.X * 0.5f, Projectile.velocity.Y * 0.5f); - if (Main.rand.NextBool(8) && Main.netMode != NetmodeID.Server) + if (Main.rand.NextBool(8) && !Main.dedServ) { int smoke = Gore.NewGore(Projectile.GetSource_FromAI(), Projectile.position, default, Main.rand.Next(375, 378), 0.5f); Main.gore[smoke].behindTiles = true; diff --git a/Projectiles/Pets/ChibiiDoggo.cs b/Projectiles/Pets/ChibiiDoggo.cs index 95ea59780d..4d38d44c8c 100644 --- a/Projectiles/Pets/ChibiiDoggo.cs +++ b/Projectiles/Pets/ChibiiDoggo.cs @@ -175,7 +175,7 @@ IL_6899: //companion cube lighting check and stab // 08DEC2023: Ozzatron: All below code does not run on dedicated servers as it requires clientside lighting information. - if (Main.netMode == NetmodeID.Server) + if (Main.dedServ) return; Color color; diff --git a/Projectiles/Pets/LadShark.cs b/Projectiles/Pets/LadShark.cs index 314e849006..128d560148 100644 --- a/Projectiles/Pets/LadShark.cs +++ b/Projectiles/Pets/LadShark.cs @@ -55,7 +55,7 @@ namespace CalamityMod.Projectiles.Pets { if (Projectile.owner == Main.myPlayer) { - if (Main.netMode != NetmodeID.Server) + if (!Main.dedServ) { int heartCount = Main.rand.Next(20, 31); for (int i = 0; i < heartCount; i++) diff --git a/Projectiles/Ranged/AcidRocket.cs b/Projectiles/Ranged/AcidRocket.cs index dd0e6c6f0c..982bd2cb2c 100644 --- a/Projectiles/Ranged/AcidRocket.cs +++ b/Projectiles/Ranged/AcidRocket.cs @@ -62,7 +62,7 @@ namespace CalamityMod.Projectiles.Ranged { CalamityUtils.HomeInOnNPC(Projectile, true, 720f, 16f, Projectile.MaxUpdates * 20f); // Trailing effects, only applied when homing - if (Main.netMode != NetmodeID.Server && Projectile.FinalExtraUpdate() && Projectile.velocity.Length() > 3f) + if (!Main.dedServ && Projectile.FinalExtraUpdate() && Projectile.velocity.Length() > 3f) { Color color = new Color(136, 211, 113, 127); Color fadeColor = new Color(165, 165, 86); diff --git a/Projectiles/Ranged/AdamAcceleratorBeam.cs b/Projectiles/Ranged/AdamAcceleratorBeam.cs index cb36de16a4..84159ca526 100644 --- a/Projectiles/Ranged/AdamAcceleratorBeam.cs +++ b/Projectiles/Ranged/AdamAcceleratorBeam.cs @@ -94,7 +94,7 @@ namespace CalamityMod.Projectiles.Ranged Color beamColor = GetBeamColor(polarity); ProduceBeamDust(beamColor); // If the game is rendering (i.e. isn't a dedicated server), make the beam disturb water. - if (Main.netMode != NetmodeID.Server) + if (!Main.dedServ) { WaterShaderData wsd = (WaterShaderData)Filters.Scene["WaterDistortion"].GetShader(); // A universal time-based sinusoid which updates extremely rapidly. GlobalTimeWrappedHourly is 0 to 3600, measured in seconds. diff --git a/Projectiles/Ranged/AuroraFire.cs b/Projectiles/Ranged/AuroraFire.cs index afd3c9a209..42d6af0c6d 100644 --- a/Projectiles/Ranged/AuroraFire.cs +++ b/Projectiles/Ranged/AuroraFire.cs @@ -98,7 +98,7 @@ namespace CalamityMod.Projectiles.Ranged Projectile.Opacity = Utils.GetLerpValue(0f, 15f, Time, true) * Utils.GetLerpValue(450f, 360f, Time, true); // 08DEC2023: Ozzatron: All below code does not run on dedicated servers as it requires clientside lighting information. - if (Main.netMode == NetmodeID.Server) + if (Main.dedServ) return; // Calculate light power. This checks below the position of the fog to check if this fog is underground. diff --git a/Projectiles/Ranged/BlightFlames.cs b/Projectiles/Ranged/BlightFlames.cs index cf32ee4072..36e3556d39 100644 --- a/Projectiles/Ranged/BlightFlames.cs +++ b/Projectiles/Ranged/BlightFlames.cs @@ -105,7 +105,7 @@ namespace CalamityMod.Projectiles.Ranged } // 08DEC2023: Ozzatron: All below code does not run on dedicated servers as it requires clientside lighting information. - if (Main.netMode == NetmodeID.Server) + if (Main.dedServ) return; // Calculate light power. This checks below the position of the fog to check if this fog is underground. diff --git a/Projectiles/Ranged/CardDiamond.cs b/Projectiles/Ranged/CardDiamond.cs index 30ffcf5781..e6f934e331 100644 --- a/Projectiles/Ranged/CardDiamond.cs +++ b/Projectiles/Ranged/CardDiamond.cs @@ -78,7 +78,7 @@ namespace CalamityMod.Projectiles.Ranged Main.dust[paper].velocity *= 2f; } - if (Main.netMode != NetmodeID.Server) + if (!Main.dedServ) { Vector2 goreSource = Projectile.Center; int goreAmt = 3; diff --git a/Projectiles/Ranged/ElysianArrowProj.cs b/Projectiles/Ranged/ElysianArrowProj.cs index 57b5a81cfd..0e457db337 100644 --- a/Projectiles/Ranged/ElysianArrowProj.cs +++ b/Projectiles/Ranged/ElysianArrowProj.cs @@ -78,7 +78,7 @@ namespace CalamityMod.Projectiles.Ranged SoundStyle onKill = new("CalamityMod/Sounds/Custom/Providence/ProvidenceHolyBlastShoot"); SoundEngine.PlaySound(onKill with { Volume = 0.4f, Pitch = 0.4f }, Projectile.position); - if (Main.netMode != NetmodeID.Server) + if (!Main.dedServ) { for (int k = 0; k < 7; k++) { diff --git a/Projectiles/Ranged/FreedomStarBeam.cs b/Projectiles/Ranged/FreedomStarBeam.cs index f647654627..ed2c586152 100644 --- a/Projectiles/Ranged/FreedomStarBeam.cs +++ b/Projectiles/Ranged/FreedomStarBeam.cs @@ -130,7 +130,7 @@ namespace CalamityMod.Projectiles.Ranged ProduceBeamDust(beamColor); // If the game is rendering (i.e. isn't a dedicated server), make the beam disturb water. - if (Main.netMode != NetmodeID.Server) + if (!Main.dedServ) { WaterShaderData wsd = (WaterShaderData)Filters.Scene["WaterDistortion"].GetShader(); diff --git a/Projectiles/Ranged/GodSlayerSlugProj.cs b/Projectiles/Ranged/GodSlayerSlugProj.cs index 5e47ed764b..45dd067be9 100644 --- a/Projectiles/Ranged/GodSlayerSlugProj.cs +++ b/Projectiles/Ranged/GodSlayerSlugProj.cs @@ -31,7 +31,7 @@ namespace CalamityMod.Projectiles.Ranged ProjectileID.Sets.TrailCacheLength[Type] = 6; ProjectileID.Sets.TrailingMode[Type] = 0; - if (Main.netMode != NetmodeID.Server) + if (!Main.dedServ) TextureBlue = Mod.Assets.Request("Projectiles/Ranged/GodSlayerSlugBlue", AssetRequestMode.ImmediateLoad).Value; } diff --git a/Projectiles/Ranged/ImpactRound.cs b/Projectiles/Ranged/ImpactRound.cs index 97e1887874..9dae2a8086 100644 --- a/Projectiles/Ranged/ImpactRound.cs +++ b/Projectiles/Ranged/ImpactRound.cs @@ -41,7 +41,7 @@ namespace CalamityMod.Projectiles.Ranged { initialized = true; - if (Main.netMode != NetmodeID.Server) + if (!Main.dedServ) { SoundEngine.PlaySound(CommonCalamitySounds.LargeWeaponFireSound with { Volume = CommonCalamitySounds.LargeWeaponFireSound.Volume * 0.45f }, Projectile.Center); } diff --git a/Projectiles/Ranged/MaelstromHoldout.cs b/Projectiles/Ranged/MaelstromHoldout.cs index 4825992c84..88a747cb15 100644 --- a/Projectiles/Ranged/MaelstromHoldout.cs +++ b/Projectiles/Ranged/MaelstromHoldout.cs @@ -62,7 +62,7 @@ namespace CalamityMod.Projectiles.Ranged public void ShootProjectiles(Vector2 shootPosition) { // Create electric particles. - if (Main.netMode != NetmodeID.Server) + if (!Main.dedServ) { for (int i = 0; i < 16; i++) { diff --git a/Projectiles/Ranged/MagnomalyRocket.cs b/Projectiles/Ranged/MagnomalyRocket.cs index b46d7237e6..7408ace3d2 100644 --- a/Projectiles/Ranged/MagnomalyRocket.cs +++ b/Projectiles/Ranged/MagnomalyRocket.cs @@ -117,7 +117,7 @@ namespace CalamityMod.Projectiles.Ranged Main.dust[exo].velocity *= 2f; } - if (Main.netMode != NetmodeID.Server) + if (!Main.dedServ) { Vector2 goreSource = Projectile.Center; int goreAmt = 9; diff --git a/Projectiles/Ranged/MiniSharkron.cs b/Projectiles/Ranged/MiniSharkron.cs index 0f1e920e05..6f357a690c 100644 --- a/Projectiles/Ranged/MiniSharkron.cs +++ b/Projectiles/Ranged/MiniSharkron.cs @@ -33,7 +33,7 @@ namespace CalamityMod.Projectiles.Ranged Dust dust = Main.dust[idx]; dust.velocity /= 2f; } - if (Main.netMode != NetmodeID.Server) + if (!Main.dedServ) { int tail = Gore.NewGore(Projectile.GetSource_Death(), Projectile.Center, Projectile.velocity * 0.8f, 584, 1f); Main.gore[tail].timeLeft /= 10; diff --git a/Projectiles/Ranged/MortarRoundProj.cs b/Projectiles/Ranged/MortarRoundProj.cs index 95dee8af46..f84155a472 100644 --- a/Projectiles/Ranged/MortarRoundProj.cs +++ b/Projectiles/Ranged/MortarRoundProj.cs @@ -109,7 +109,7 @@ namespace CalamityMod.Projectiles.Ranged // Reused by Rubber Mortar Rounds. internal static void SpawnExplosionGores(Projectile p) { - if (Main.netMode == NetmodeID.Server) + if (Main.dedServ) return; Vector2 goreSource = p.Center; diff --git a/Projectiles/Ranged/PlagueTaintedDrone.cs b/Projectiles/Ranged/PlagueTaintedDrone.cs index 834053e7a0..c364af3ef6 100644 --- a/Projectiles/Ranged/PlagueTaintedDrone.cs +++ b/Projectiles/Ranged/PlagueTaintedDrone.cs @@ -159,7 +159,7 @@ namespace CalamityMod.Projectiles.Ranged Main.dust[dust2].velocity *= 2f; } - if (Main.netMode != NetmodeID.Server) + if (!Main.dedServ) { Vector2 goreSource = Projectile.Center; int goreAmt = 2; diff --git a/Projectiles/Ranged/PlasmaBlast.cs b/Projectiles/Ranged/PlasmaBlast.cs index 4c9fda47d3..af1049f2ba 100644 --- a/Projectiles/Ranged/PlasmaBlast.cs +++ b/Projectiles/Ranged/PlasmaBlast.cs @@ -71,7 +71,7 @@ namespace CalamityMod.Projectiles.Ranged Main.dust[extraDust].position = Projectile.Center + extraDustVel * 12f; } - if (Main.rand.NextBool(48) && Main.netMode != NetmodeID.Server) + if (Main.rand.NextBool(48) && !Main.dedServ) { int gore = Gore.NewGore(Projectile.GetSource_FromAI(), Projectile.Center, new Vector2(Projectile.velocity.X * 0.2f, Projectile.velocity.Y * 0.2f), 16, 1f); Main.gore[gore].velocity *= 0.66f; @@ -83,7 +83,7 @@ namespace CalamityMod.Projectiles.Ranged Projectile.light = 0.9f; if (Main.rand.NextBool(10)) Dust.NewDust(Projectile.position, Projectile.width, Projectile.height, DustID.FireworkFountain_Blue, Projectile.velocity.X * 0.5f, Projectile.velocity.Y * 0.5f, 150, default, 1f); - if (Main.rand.NextBool(20) && Main.netMode != NetmodeID.Server) + if (Main.rand.NextBool(20) && !Main.dedServ) Gore.NewGore(Projectile.GetSource_FromAI(), Projectile.position, new Vector2(Projectile.velocity.X * 0.2f, Projectile.velocity.Y * 0.2f), Main.rand.Next(16, 18), 1f); } diff --git a/Projectiles/Ranged/PristineSecondary.cs b/Projectiles/Ranged/PristineSecondary.cs index b796cff7d9..13d95204ca 100644 --- a/Projectiles/Ranged/PristineSecondary.cs +++ b/Projectiles/Ranged/PristineSecondary.cs @@ -82,7 +82,7 @@ namespace CalamityMod.Projectiles.Ranged Projectile.Opacity = Utils.GetLerpValue(280f, 135f, Projectile.timeLeft, true) * Utils.GetLerpValue(0f, 90f, Projectile.timeLeft, true); // 08DEC2023: Ozzatron: All below code does not run on dedicated servers as it requires clientside lighting information. - if (Main.netMode == NetmodeID.Server) + if (Main.dedServ) return; // Calculate light power. This checks below the position of the fog to check if this fog is underground. diff --git a/Projectiles/Ranged/ScorchedEarthRocket.cs b/Projectiles/Ranged/ScorchedEarthRocket.cs index 2e1a91320e..d806b0180c 100644 --- a/Projectiles/Ranged/ScorchedEarthRocket.cs +++ b/Projectiles/Ranged/ScorchedEarthRocket.cs @@ -69,7 +69,7 @@ namespace CalamityMod.Projectiles.Ranged Projectile.ExpandHitboxBy(300); SoundEngine.PlaySound(SoundID.Item14, Projectile.position); - if (Main.netMode != NetmodeID.Server) + if (!Main.dedServ) { Vector2 goreSource = Projectile.Center; int goreAmt = 10; diff --git a/Projectiles/Ranged/SputterComet.cs b/Projectiles/Ranged/SputterComet.cs index c0f6a38eb1..315818597a 100644 --- a/Projectiles/Ranged/SputterComet.cs +++ b/Projectiles/Ranged/SputterComet.cs @@ -67,7 +67,7 @@ namespace CalamityMod.Projectiles.Ranged { Dust.NewDust(Projectile.position + Projectile.velocity, Projectile.width, Projectile.height, ModContent.DustType(), Projectile.oldVelocity.X * 0.5f, Projectile.oldVelocity.Y * 0.5f); } - if (Main.netMode != NetmodeID.Server) + if (!Main.dedServ) { for (int i = 0; i < 3; i++) { diff --git a/Projectiles/Ranged/SputterCometBig.cs b/Projectiles/Ranged/SputterCometBig.cs index 99391f093e..7f227bbb77 100644 --- a/Projectiles/Ranged/SputterCometBig.cs +++ b/Projectiles/Ranged/SputterCometBig.cs @@ -76,7 +76,7 @@ namespace CalamityMod.Projectiles.Ranged { Dust.NewDust(Projectile.position + Projectile.velocity, Projectile.width, Projectile.height, ModContent.DustType(), Projectile.oldVelocity.X * 0.5f, Projectile.oldVelocity.Y * 0.5f); } - if (Main.netMode != NetmodeID.Server) + if (!Main.dedServ) { for (int i = 0; i < 3; i++) { diff --git a/Projectiles/Ranged/TheMaelstromExplosion.cs b/Projectiles/Ranged/TheMaelstromExplosion.cs index d4c0e99c0c..b2ae9a476e 100644 --- a/Projectiles/Ranged/TheMaelstromExplosion.cs +++ b/Projectiles/Ranged/TheMaelstromExplosion.cs @@ -40,7 +40,7 @@ namespace CalamityMod.Projectiles.Ranged Projectile.Opacity = Projectile.scale * Utils.GetLerpValue(0f, 30f, Projectile.timeLeft, true); // Emit sparks and dust. - if (Main.netMode != NetmodeID.Server) + if (!Main.dedServ) { int sparkLifetime = Main.rand.Next(22, 36); float sparkScale = Main.rand.NextFloat(1f, 1.3f); diff --git a/Projectiles/Ranged/TheMaelstromShark.cs b/Projectiles/Ranged/TheMaelstromShark.cs index 5bb5ecb83f..a9a4037ffe 100644 --- a/Projectiles/Ranged/TheMaelstromShark.cs +++ b/Projectiles/Ranged/TheMaelstromShark.cs @@ -70,7 +70,7 @@ namespace CalamityMod.Projectiles.Ranged { // Create death effects for the shark, including a death sound, gore, and some blood. SoundEngine.PlaySound(SoundID.NPCDeath1, Projectile.Center); - if (Main.netMode != NetmodeID.Server) + if (!Main.dedServ) { Gore.NewGore(Projectile.GetSource_Death(), Projectile.position, Projectile.velocity, Mod.Find("MaelstromReaperShark1").Type, Projectile.scale); Gore.NewGore(Projectile.GetSource_Death(), Projectile.position, Projectile.velocity, Mod.Find("MaelstromReaperShark2").Type, Projectile.scale); diff --git a/Projectiles/Ranged/UniversalGenesisStar.cs b/Projectiles/Ranged/UniversalGenesisStar.cs index 119517a572..9eabd1a422 100644 --- a/Projectiles/Ranged/UniversalGenesisStar.cs +++ b/Projectiles/Ranged/UniversalGenesisStar.cs @@ -44,7 +44,7 @@ namespace CalamityMod.Projectiles.Ranged } } Projectile.rotation += (Math.Abs(Projectile.velocity.X) + Math.Abs(Projectile.velocity.Y)) * 0.01f * Projectile.direction; - if (Main.rand.NextBool(48) && Main.netMode != NetmodeID.Server) + if (Main.rand.NextBool(48) && !Main.dedServ) { int idx = Gore.NewGore(Projectile.GetSource_FromAI(), Projectile.Center, Projectile.velocity * 0.2f, 16, 1f); Main.gore[idx].velocity *= 0.66f; @@ -54,7 +54,7 @@ namespace CalamityMod.Projectiles.Ranged { Dust.NewDust(Projectile.position, Projectile.width, Projectile.height, DustID.ShadowbeamStaff, Projectile.velocity.X * 0.5f, Projectile.velocity.Y * 0.5f, 150, default, 1.2f); } - if (Main.rand.NextBool(20) && Main.netMode != NetmodeID.Server) + if (Main.rand.NextBool(20) && !Main.dedServ) { Gore.NewGore(Projectile.GetSource_FromAI(), Projectile.position, new Vector2(Projectile.velocity.X * 0.2f, Projectile.velocity.Y * 0.2f), Main.rand.Next(16, 18), 1f); } @@ -88,7 +88,7 @@ namespace CalamityMod.Projectiles.Ranged Main.dust[idx].fadeIn = 1f + Main.rand.Next(10) * 0.1f; } } - if (Main.netMode != NetmodeID.Server) + if (!Main.dedServ) { for (int i = 0; i < 3; i++) { diff --git a/Projectiles/Ranged/UniversalGenesisStarcaller.cs b/Projectiles/Ranged/UniversalGenesisStarcaller.cs index 86c3d946d9..fc22e9fde8 100644 --- a/Projectiles/Ranged/UniversalGenesisStarcaller.cs +++ b/Projectiles/Ranged/UniversalGenesisStarcaller.cs @@ -120,7 +120,7 @@ namespace CalamityMod.Projectiles.Ranged { Dust.NewDust(Projectile.position + Projectile.velocity, Projectile.width, Projectile.height, DustID.ShadowbeamStaff, Projectile.oldVelocity.X * 0.5f, Projectile.oldVelocity.Y * 0.5f); } - if (Main.netMode != NetmodeID.Server) + if (!Main.dedServ) { for (int g = 0; g < 3; g++) { diff --git a/Projectiles/Ranged/Voidragon.cs b/Projectiles/Ranged/Voidragon.cs index 558e564049..ada7f27283 100644 --- a/Projectiles/Ranged/Voidragon.cs +++ b/Projectiles/Ranged/Voidragon.cs @@ -71,7 +71,7 @@ namespace CalamityMod.Projectiles.Ranged Main.dust[extraDust].velocity = value3 * 0.66f; Main.dust[extraDust].position = Projectile.Center + value3 * 12f; } - if (Main.rand.NextBool(48) && Main.netMode != NetmodeID.Server) + if (Main.rand.NextBool(48) && !Main.dedServ) { int voidGore = Gore.NewGore(Projectile.GetSource_FromAI(), Projectile.Center, new Vector2(Projectile.velocity.X * 0.2f, Projectile.velocity.Y * 0.2f), 16, 1f); Main.gore[voidGore].velocity *= 0.66f; @@ -84,7 +84,7 @@ namespace CalamityMod.Projectiles.Ranged { Dust.NewDust(Projectile.position, Projectile.width, Projectile.height, DustID.ShadowbeamStaff, Projectile.velocity.X * 0.5f, Projectile.velocity.Y * 0.5f, 150, default, 1.2f); } - if (Main.rand.NextBool(20) && Main.netMode != NetmodeID.Server) + if (Main.rand.NextBool(20) && !Main.dedServ) { Gore.NewGore(Projectile.GetSource_FromAI(), Projectile.position, new Vector2(Projectile.velocity.X * 0.2f, Projectile.velocity.Y * 0.2f), Main.rand.Next(16, 18), 1f); } diff --git a/Projectiles/Rogue/AuroradicalSplitter.cs b/Projectiles/Rogue/AuroradicalSplitter.cs index 519b63f719..be67889e6f 100644 --- a/Projectiles/Rogue/AuroradicalSplitter.cs +++ b/Projectiles/Rogue/AuroradicalSplitter.cs @@ -119,7 +119,7 @@ namespace CalamityMod.Projectiles.Rogue Main.dust[astral].velocity *= 2f; Main.dust[astral].noGravity = true; } - if (Main.netMode != NetmodeID.Server) + if (!Main.dedServ) { for (int g = 0; g < 3; g++) { diff --git a/Projectiles/Rogue/AuroradicalStar.cs b/Projectiles/Rogue/AuroradicalStar.cs index 2d471c304d..0970899e66 100644 --- a/Projectiles/Rogue/AuroradicalStar.cs +++ b/Projectiles/Rogue/AuroradicalStar.cs @@ -158,7 +158,7 @@ namespace CalamityMod.Projectiles.Rogue Main.dust[astral].velocity *= 2f; Main.dust[astral].noGravity = true; } - if (Main.netMode != NetmodeID.Server) + if (!Main.dedServ) { for (int g = 0; g < 3; g++) { diff --git a/Projectiles/Rogue/BallisticPoisonBombProj.cs b/Projectiles/Rogue/BallisticPoisonBombProj.cs index 6ef3ba74cc..828e638019 100644 --- a/Projectiles/Rogue/BallisticPoisonBombProj.cs +++ b/Projectiles/Rogue/BallisticPoisonBombProj.cs @@ -92,7 +92,7 @@ namespace CalamityMod.Projectiles.Rogue Main.dust[fire].velocity *= 2f; } - if (Main.netMode != NetmodeID.Server) + if (!Main.dedServ) { Vector2 goreSource = Projectile.Center; int goreAmt = 3; diff --git a/Projectiles/Rogue/CraniumSMASH.cs b/Projectiles/Rogue/CraniumSMASH.cs index ed0d560383..ba9217eadf 100644 --- a/Projectiles/Rogue/CraniumSMASH.cs +++ b/Projectiles/Rogue/CraniumSMASH.cs @@ -37,7 +37,7 @@ namespace CalamityMod.Projectiles.Rogue { SoundEngine.PlaySound(SoundID.Item14, Projectile.Center); - if (Main.netMode != NetmodeID.Server) + if (!Main.dedServ) { Vector2 goreSource = Projectile.Center; int goreAmt = 3; diff --git a/Projectiles/Rogue/CraniumSmasherExplosive.cs b/Projectiles/Rogue/CraniumSmasherExplosive.cs index c2a979ad62..ba7f842023 100644 --- a/Projectiles/Rogue/CraniumSmasherExplosive.cs +++ b/Projectiles/Rogue/CraniumSmasherExplosive.cs @@ -57,7 +57,7 @@ namespace CalamityMod.Projectiles.Rogue Projectile.Damage(); SoundEngine.PlaySound(SoundID.Item14, Projectile.position); - if (Main.netMode != NetmodeID.Server) + if (!Main.dedServ) { Vector2 goreSource = Projectile.Center; int goreAmt = 3; diff --git a/Projectiles/Rogue/CraniumSmasherStealth.cs b/Projectiles/Rogue/CraniumSmasherStealth.cs index fcba53b405..d530131132 100644 --- a/Projectiles/Rogue/CraniumSmasherStealth.cs +++ b/Projectiles/Rogue/CraniumSmasherStealth.cs @@ -72,7 +72,7 @@ namespace CalamityMod.Projectiles.Rogue Projectile.Damage(); SoundEngine.PlaySound(SoundID.Item14, Projectile.Center); - if (Main.netMode != NetmodeID.Server) + if (!Main.dedServ) { Vector2 goreSource = Projectile.Center; int goreAmt = 3; diff --git a/Projectiles/Rogue/DragonShit.cs b/Projectiles/Rogue/DragonShit.cs index 3946698d41..22ca91db72 100644 --- a/Projectiles/Rogue/DragonShit.cs +++ b/Projectiles/Rogue/DragonShit.cs @@ -117,7 +117,7 @@ namespace CalamityMod.Projectiles.Rogue Main.dust[idx].velocity *= 2f; } - if (Main.netMode != NetmodeID.Server) + if (!Main.dedServ) { Vector2 goreSource = Projectile.Center; int goreAmt = 3; diff --git a/Projectiles/Rogue/LeonidCometBig.cs b/Projectiles/Rogue/LeonidCometBig.cs index 0491cc876c..babf525421 100644 --- a/Projectiles/Rogue/LeonidCometBig.cs +++ b/Projectiles/Rogue/LeonidCometBig.cs @@ -68,7 +68,7 @@ namespace CalamityMod.Projectiles.Rogue dust2.velocity *= 2f; dust2.noGravity = true; } - if (Main.netMode != NetmodeID.Server) + if (!Main.dedServ) { for (int index1 = 0; index1 < 2; ++index1) { diff --git a/Projectiles/Rogue/LeonidStar.cs b/Projectiles/Rogue/LeonidStar.cs index fddf210ab3..69c9b1b43b 100644 --- a/Projectiles/Rogue/LeonidStar.cs +++ b/Projectiles/Rogue/LeonidStar.cs @@ -83,7 +83,7 @@ namespace CalamityMod.Projectiles.Rogue int dust = Dust.NewDust(Projectile.Center, 1, 1, dustType, Projectile.velocity.X, Projectile.velocity.Y, 0, CalamityUtils.ColorSwap(LeonidProgenitor.blueColor, LeonidProgenitor.purpleColor, 1f), 1.5f); Main.dust[dust].noGravity = true; } - if (Main.netMode != NetmodeID.Server) + if (!Main.dedServ) { for (int num480 = 0; num480 < 3; num480++) { diff --git a/Projectiles/Rogue/MeteorFistProj.cs b/Projectiles/Rogue/MeteorFistProj.cs index c572fa8a00..cc694bad98 100644 --- a/Projectiles/Rogue/MeteorFistProj.cs +++ b/Projectiles/Rogue/MeteorFistProj.cs @@ -148,7 +148,7 @@ namespace CalamityMod.Projectiles.Rogue Main.dust[boomDust2].velocity *= 2f; } - if (Main.netMode != NetmodeID.Server) + if (!Main.dedServ) { Vector2 source = new Vector2(Projectile.Center.X - 24f, Projectile.Center.Y - 24f); for (int g = 1; g <= 3; g++) diff --git a/Projectiles/Rogue/PlaguenadeProj.cs b/Projectiles/Rogue/PlaguenadeProj.cs index 8f8ff934e5..7e1a120629 100644 --- a/Projectiles/Rogue/PlaguenadeProj.cs +++ b/Projectiles/Rogue/PlaguenadeProj.cs @@ -111,7 +111,7 @@ namespace CalamityMod.Projectiles.Rogue Main.dust[fire].velocity *= 2f; } - if (Main.netMode != NetmodeID.Server) + if (!Main.dedServ) { Vector2 goreSource = Projectile.Center; int goreAmt = 3; diff --git a/Projectiles/Rogue/SeafoamBombProj.cs b/Projectiles/Rogue/SeafoamBombProj.cs index aef6b80960..2dc19aeb2d 100644 --- a/Projectiles/Rogue/SeafoamBombProj.cs +++ b/Projectiles/Rogue/SeafoamBombProj.cs @@ -49,7 +49,7 @@ namespace CalamityMod.Projectiles.Rogue Projectile.NewProjectile(Projectile.GetSource_FromThis(), posX, posY, 0f, 0f, ModContent.ProjectileType(), (int)((double)Projectile.damage * 0.4), 0f, Projectile.owner, 0f, 0f); } - if (Main.netMode != NetmodeID.Server) + if (!Main.dedServ) { Vector2 goreSource = Projectile.Center; int goreAmt = Projectile.Calamity().stealthStrike ? 6 : 3; diff --git a/Projectiles/Rogue/ShatteredSunScorchedBlade.cs b/Projectiles/Rogue/ShatteredSunScorchedBlade.cs index 60081d12c1..14c1948ae8 100644 --- a/Projectiles/Rogue/ShatteredSunScorchedBlade.cs +++ b/Projectiles/Rogue/ShatteredSunScorchedBlade.cs @@ -230,7 +230,7 @@ namespace CalamityMod.Projectiles.Rogue Main.dust[dusty].velocity *= 2f; } - if (Main.netMode != NetmodeID.Server) + if (!Main.dedServ) { Vector2 goreSource = Projectile.Center; int goreAmt = 3; diff --git a/Projectiles/Rogue/SphereBlue.cs b/Projectiles/Rogue/SphereBlue.cs index d2c7637ab4..4a9aeb4033 100644 --- a/Projectiles/Rogue/SphereBlue.cs +++ b/Projectiles/Rogue/SphereBlue.cs @@ -59,7 +59,7 @@ namespace CalamityMod.Projectiles.Rogue Projectile.damage /= 2; Projectile.Damage(); SoundEngine.PlaySound(SoundID.NPCDeath37, Projectile.position); - if (Main.netMode != NetmodeID.Server) + if (!Main.dedServ) { for (int i = 0; i < 3; i++) { diff --git a/Projectiles/Rogue/SubductionSlicerProj.cs b/Projectiles/Rogue/SubductionSlicerProj.cs index 8136bb01ce..429d657d1b 100644 --- a/Projectiles/Rogue/SubductionSlicerProj.cs +++ b/Projectiles/Rogue/SubductionSlicerProj.cs @@ -36,7 +36,7 @@ namespace CalamityMod.Projectiles.Rogue if (Main.rand.NextBool(5)) Dust.NewDust(Projectile.position + Projectile.velocity, Projectile.width, Projectile.height, Main.rand.NextBool(3) ? 16 : 127, Projectile.velocity.X * 0.5f, Projectile.velocity.Y * 0.5f); Vector2 goreVec = new Vector2(Projectile.position.X + Projectile.width / 2 + Projectile.velocity.X, Projectile.position.Y + Projectile.height / 2 + Projectile.velocity.Y); - if (Main.rand.NextBool(8) && Main.netMode != NetmodeID.Server) + if (Main.rand.NextBool(8) && !Main.dedServ) { int smoke = Gore.NewGore(Projectile.GetSource_FromAI(), goreVec, default, Main.rand.Next(375, 378), 0.75f); Main.gore[smoke].behindTiles = true; diff --git a/Projectiles/Summon/CosmicBlastBig.cs b/Projectiles/Summon/CosmicBlastBig.cs index 0706b0aca0..7cc8b704ca 100644 --- a/Projectiles/Summon/CosmicBlastBig.cs +++ b/Projectiles/Summon/CosmicBlastBig.cs @@ -47,7 +47,7 @@ namespace CalamityMod.Projectiles.Summon Main.dust[rainbowDust].velocity = value3 * 0.66f; Main.dust[rainbowDust].position = Projectile.Center + value3 * 12f; } - if (Main.rand.NextBool(24) && Main.netMode != NetmodeID.Server) + if (Main.rand.NextBool(24) && !Main.dedServ) { int rainbowGore = Gore.NewGore(Projectile.GetSource_FromAI(), Projectile.Center, new Vector2(Projectile.velocity.X * 0.2f, Projectile.velocity.Y * 0.2f), 16, 1f); Main.gore[rainbowGore].velocity *= 0.66f; @@ -60,7 +60,7 @@ namespace CalamityMod.Projectiles.Summon int rainbowDust = Dust.NewDust(Projectile.position, Projectile.width, Projectile.height, DustID.RainbowTorch, Projectile.velocity.X * 0.5f, Projectile.velocity.Y * 0.5f, 150, new Color(Main.DiscoR, Main.DiscoG, Main.DiscoB), 1.2f); Main.dust[rainbowDust].noGravity = true; } - if (Main.rand.NextBool(10) && Main.netMode != NetmodeID.Server) + if (Main.rand.NextBool(10) && !Main.dedServ) { Gore.NewGore(Projectile.GetSource_FromAI(), Projectile.position, new Vector2(Projectile.velocity.X * 0.2f, Projectile.velocity.Y * 0.2f), Main.rand.Next(16, 18), 1f); } diff --git a/Projectiles/Summon/Dreadmine.cs b/Projectiles/Summon/Dreadmine.cs index 6a71d0f425..cf476b8845 100644 --- a/Projectiles/Summon/Dreadmine.cs +++ b/Projectiles/Summon/Dreadmine.cs @@ -202,7 +202,7 @@ namespace CalamityMod.Projectiles.Summon Main.dust[dust2].velocity *= 2f; } - if (Main.netMode != NetmodeID.Server) + if (!Main.dedServ) { Vector2 goreSource = Projectile.Center; int goreAmt = 3; diff --git a/Projectiles/Summon/HallowedStarSummon.cs b/Projectiles/Summon/HallowedStarSummon.cs index e009601059..4bb33d179c 100644 --- a/Projectiles/Summon/HallowedStarSummon.cs +++ b/Projectiles/Summon/HallowedStarSummon.cs @@ -57,7 +57,7 @@ namespace CalamityMod.Projectiles.Summon Projectile.alpha = alphaMin; } Projectile.rotation += (Math.Abs(Projectile.velocity.X) + Math.Abs(Projectile.velocity.Y)) * 0.01f * Projectile.direction; - if (Main.rand.NextBool(48) && Main.netMode != NetmodeID.Server) + if (Main.rand.NextBool(48) && !Main.dedServ) { int idx = Gore.NewGore(Projectile.GetSource_FromAI(), Projectile.Center, Projectile.velocity * 0.2f, 16, 1f); Main.gore[idx].velocity *= 0.66f; @@ -70,7 +70,7 @@ namespace CalamityMod.Projectiles.Summon { Dust.NewDust(Projectile.position, Projectile.width, Projectile.height, ModContent.DustType(), Projectile.velocity.X * 0.5f, Projectile.velocity.Y * 0.5f, 150, default, 1.2f); } - if (Main.rand.NextBool(20) && Main.netMode != NetmodeID.Server) + if (Main.rand.NextBool(20) && !Main.dedServ) { Gore.NewGore(Projectile.GetSource_FromAI(), Projectile.position, new Vector2(Projectile.velocity.X * 0.2f, Projectile.velocity.Y * 0.2f), Main.rand.Next(16, 18), 1f); } @@ -102,7 +102,7 @@ namespace CalamityMod.Projectiles.Summon Main.dust[idx].fadeIn = 1f + Main.rand.Next(10) * 0.1f; } } - if (Main.netMode != NetmodeID.Server) + if (!Main.dedServ) { for (int i = 0; i < 3; i++) { diff --git a/Projectiles/Summon/HauntedDishes.cs b/Projectiles/Summon/HauntedDishes.cs index 6fc3619098..c37e9eca65 100644 --- a/Projectiles/Summon/HauntedDishes.cs +++ b/Projectiles/Summon/HauntedDishes.cs @@ -578,7 +578,7 @@ namespace CalamityMod.Projectiles.Summon public override void OnKill(int timeLeft) { - if (Main.netMode != NetmodeID.Server) + if (!Main.dedServ) { int index = Gore.NewGore(Projectile.GetSource_Death(), new Vector2(Projectile.position.X - (float)(Projectile.width / 2), Projectile.position.Y - (float)(Projectile.height / 2)), new Vector2(0.0f, 0.0f), Main.rand.Next(61, 64), Projectile.scale); Main.gore[index].velocity *= 0.1f; diff --git a/Projectiles/Summon/ProfanedSoulCrystalProjectiles.cs b/Projectiles/Summon/ProfanedSoulCrystalProjectiles.cs index 3b4ae0053b..2fe43d71ee 100644 --- a/Projectiles/Summon/ProfanedSoulCrystalProjectiles.cs +++ b/Projectiles/Summon/ProfanedSoulCrystalProjectiles.cs @@ -801,7 +801,7 @@ namespace CalamityMod.Projectiles.Summon if (Projectile.scale != 1.5f) return; - if (Main.netMode != NetmodeID.Server) + if (!Main.dedServ) { for (int num625 = 0; num625 < 3; num625++) { diff --git a/Projectiles/Summon/SmallAresArms/MinionPlasmaGas.cs b/Projectiles/Summon/SmallAresArms/MinionPlasmaGas.cs index 10a4fd4d31..3945b1d12d 100644 --- a/Projectiles/Summon/SmallAresArms/MinionPlasmaGas.cs +++ b/Projectiles/Summon/SmallAresArms/MinionPlasmaGas.cs @@ -49,7 +49,7 @@ namespace CalamityMod.Projectiles.Summon.SmallAresArms Time++; // 08DEC2023: Ozzatron: All below code does not run on dedicated servers as it requires clientside lighting information. - if (Main.netMode == NetmodeID.Server) + if (Main.dedServ) return; // Calculate light power. This checks below the position of the fog to check if this fog is underground. diff --git a/Projectiles/Summon/StormjawBaby.cs b/Projectiles/Summon/StormjawBaby.cs index 2d75e0c803..dfa4c71d3b 100644 --- a/Projectiles/Summon/StormjawBaby.cs +++ b/Projectiles/Summon/StormjawBaby.cs @@ -551,7 +551,7 @@ namespace CalamityMod.Projectiles.Summon public override void OnKill(int timeLeft) { - if (Main.netMode != NetmodeID.Server) + if (!Main.dedServ) { int index = Gore.NewGore(Projectile.GetSource_Death(), Projectile.Center, new Vector2(0f, 0f), Main.rand.Next(61, 64), Projectile.scale); Main.gore[index].velocity *= 0.1f; diff --git a/Projectiles/Summon/Umbrella/MagicHammer.cs b/Projectiles/Summon/Umbrella/MagicHammer.cs index dbfb69f4b1..5f939a93d9 100644 --- a/Projectiles/Summon/Umbrella/MagicHammer.cs +++ b/Projectiles/Summon/Umbrella/MagicHammer.cs @@ -275,7 +275,7 @@ namespace CalamityMod.Projectiles.Summon.Umbrella Main.dust[confetti].velocity.X += Main.rand.NextFloat(-2.5f, 2.5f); Main.dust[confetti].velocity.Y += Main.rand.NextFloat(-2.5f, 2.5f); Main.dust[confetti].scale *= Main.rand.NextFloat(0.7f, 1.3f); - if (Main.netMode != NetmodeID.Server && Main.rand.NextBool()) + if (!Main.dedServ && Main.rand.NextBool()) { int confettiGore = Main.rand.Next(276, 283); int idx = Gore.NewGore(Projectile.GetSource_FromThis(), target.Center, target.velocity, confettiGore, 1f); diff --git a/Projectiles/Summon/Umbrella/MagicTree.cs b/Projectiles/Summon/Umbrella/MagicTree.cs index 725df0f5ca..6eea005194 100644 --- a/Projectiles/Summon/Umbrella/MagicTree.cs +++ b/Projectiles/Summon/Umbrella/MagicTree.cs @@ -140,7 +140,7 @@ namespace CalamityMod.Projectiles.Summon.Umbrella break; } - if (Main.netMode != NetmodeID.Server) + if (!Main.dedServ) { for (int i = 0; i < 20; i++) { diff --git a/Projectiles/Typeless/AeroExplosive.cs b/Projectiles/Typeless/AeroExplosive.cs index b2526a6fd6..c5598f8f9a 100644 --- a/Projectiles/Typeless/AeroExplosive.cs +++ b/Projectiles/Typeless/AeroExplosive.cs @@ -104,7 +104,7 @@ namespace CalamityMod.Projectiles.Typeless Main.dust[fire].velocity *= 2f; } - if (Main.netMode != NetmodeID.Server) + if (!Main.dedServ) { Vector2 goreSource = Projectile.Center; int goreAmt = 3; diff --git a/Projectiles/Typeless/AstralStar.cs b/Projectiles/Typeless/AstralStar.cs index c393d028f3..3958cf21cd 100644 --- a/Projectiles/Typeless/AstralStar.cs +++ b/Projectiles/Typeless/AstralStar.cs @@ -69,7 +69,7 @@ namespace CalamityMod.Projectiles.Typeless Main.dust[astralDust].position = Projectile.Center + rotational * 12f; } - if (Main.rand.NextBool(48) && Main.netMode != NetmodeID.Server) + if (Main.rand.NextBool(48) && !Main.dedServ) { int starry = Gore.NewGore(Projectile.GetSource_FromAI(), Projectile.Center, new Vector2(Projectile.velocity.X * 0.2f, Projectile.velocity.Y * 0.2f), 16, 1f); Main.gore[starry].velocity *= 0.66f; @@ -81,7 +81,7 @@ namespace CalamityMod.Projectiles.Typeless Projectile.light = 0.9f; if (Main.rand.NextBool(10)) Dust.NewDust(Projectile.position, Projectile.width, Projectile.height, ModContent.DustType(), Projectile.velocity.X * 0.5f, Projectile.velocity.Y * 0.5f, 150, default, 1f); - if (Main.rand.NextBool(20) && Main.netMode != NetmodeID.Server) + if (Main.rand.NextBool(20) && !Main.dedServ) Gore.NewGore(Projectile.GetSource_FromAI(), Projectile.position, new Vector2(Projectile.velocity.X * 0.2f, Projectile.velocity.Y * 0.2f), Main.rand.Next(16, 18), 1f); } } @@ -129,7 +129,7 @@ namespace CalamityMod.Projectiles.Typeless starryDust2 = Dust.NewDust(Projectile.position, Projectile.width, Projectile.height, ModContent.DustType(), 0f, 0f, 100, default, 1f); Main.dust[starryDust2].velocity *= 2f; } - if (Main.netMode != NetmodeID.Server) + if (!Main.dedServ) { for (int k = 0; k < 3; k++) Gore.NewGore(Projectile.GetSource_Death(), Projectile.position, new Vector2(Projectile.velocity.X * 0.05f, Projectile.velocity.Y * 0.05f), Main.rand.Next(16, 18), 1f); diff --git a/Projectiles/Typeless/BabyCannonballProjectile.cs b/Projectiles/Typeless/BabyCannonballProjectile.cs index bbab48325b..15f00571b0 100644 --- a/Projectiles/Typeless/BabyCannonballProjectile.cs +++ b/Projectiles/Typeless/BabyCannonballProjectile.cs @@ -42,7 +42,7 @@ namespace CalamityMod.Projectiles.Ranged CalamityUtils.HomeInOnNPC(Projectile, true, 720f, 16f, Projectile.MaxUpdates * 20f); // Trailing effects - if (Main.netMode != NetmodeID.Server && Projectile.FinalExtraUpdate() && Projectile.velocity.Length() > 3f) + if (!Main.dedServ && Projectile.FinalExtraUpdate() && Projectile.velocity.Length() > 3f) { Color color = new Color(136, 211, 113, 127); Color fadeColor = new Color(165, 165, 86); diff --git a/Projectiles/Typeless/BossRushEffectThing.cs b/Projectiles/Typeless/BossRushEffectThing.cs index 7242715a11..7b91925a73 100644 --- a/Projectiles/Typeless/BossRushEffectThing.cs +++ b/Projectiles/Typeless/BossRushEffectThing.cs @@ -69,7 +69,7 @@ namespace CalamityMod.Projectiles.Typeless BossRushDialogueSystem.StartDialogue(DownedBossSystem.startedBossRushAtLeastOnce ? BossRushDialoguePhase.StartRepeat : BossRushDialoguePhase.Start); CalamityNetcode.SyncWorld(); - if (Main.netMode == NetmodeID.Server) + if (Main.dedServ) { BossRushStagePacket.Send(); } diff --git a/Projectiles/Typeless/BossRushEndEffectThing.cs b/Projectiles/Typeless/BossRushEndEffectThing.cs index 14e38d5403..67ad0a2a99 100644 --- a/Projectiles/Typeless/BossRushEndEffectThing.cs +++ b/Projectiles/Typeless/BossRushEndEffectThing.cs @@ -55,7 +55,7 @@ namespace CalamityMod.Projectiles.Typeless foreach (Player p in Main.ActivePlayers) { int rock = Item.NewItem(p.GetSource_Misc("CalamityMod_BossRushRock"), (int)p.position.X, (int)p.position.Y, p.width, p.height, ModContent.ItemType()); - if (rock < Main.maxItems && Main.netMode == NetmodeID.Server) + if (rock < Main.maxItems && Main.dedServ) { Main.timeItemSlotCannotBeReusedFor[rock] = 54000; NetMessage.SendData(MessageID.InstancedItem, p.whoAmI, -1, null, rock); diff --git a/Projectiles/Typeless/HydrothermalSmoke.cs b/Projectiles/Typeless/HydrothermalSmoke.cs index 7278015b26..7d0236bda1 100644 --- a/Projectiles/Typeless/HydrothermalSmoke.cs +++ b/Projectiles/Typeless/HydrothermalSmoke.cs @@ -46,7 +46,7 @@ namespace CalamityMod.Projectiles.Typeless } Vector2 goreVec = Projectile.position; - if (Main.rand.NextBool(8) && Main.netMode != NetmodeID.Server) + if (Main.rand.NextBool(8) && !Main.dedServ) { int smoke = Gore.NewGore(Projectile.GetSource_FromAI(), goreVec, default, Main.rand.Next(375, 378), 0.75f); Main.gore[smoke].behindTiles = true; diff --git a/Projectiles/Typeless/NanoFlare.cs b/Projectiles/Typeless/NanoFlare.cs index 9a7a34cff4..7d3096428b 100644 --- a/Projectiles/Typeless/NanoFlare.cs +++ b/Projectiles/Typeless/NanoFlare.cs @@ -56,7 +56,7 @@ namespace CalamityMod.Projectiles.Typeless Projectile.localNPCHitCooldown = 10; Projectile.Damage(); - if (Main.netMode != NetmodeID.Server) + if (!Main.dedServ) { Vector2 goreVec = new Vector2(Projectile.position.X + (float)(Projectile.width / 2) - 24f, Projectile.position.Y + (float)(Projectile.height / 2) - 24f); float smokeScale = 0.66f; diff --git a/Projectiles/Typeless/ShadeNimbusSpawner.cs b/Projectiles/Typeless/ShadeNimbusSpawner.cs index a29894b24e..d8328507a0 100644 --- a/Projectiles/Typeless/ShadeNimbusSpawner.cs +++ b/Projectiles/Typeless/ShadeNimbusSpawner.cs @@ -35,7 +35,7 @@ namespace CalamityMod.Projectiles.Typeless for (int k = 0; k < 20; k++) Dust.NewDust(Projectile.position, Projectile.width, Projectile.height, DustID.Glass, Projectile.velocity.X > 0f ? 1f : -1f, -1f); - if (Main.netMode != NetmodeID.Server) + if (!Main.dedServ) { Vector2 goreVelocity = new Vector2(Projectile.velocity.X, Projectile.velocity.Y * 0.4f); Gore.NewGore(Projectile.GetSource_Death(), Projectile.position, goreVelocity, Mod.Find("DankCreeperGore").Type); diff --git a/Projectiles/Typeless/SkyFlareFriendly.cs b/Projectiles/Typeless/SkyFlareFriendly.cs index 629bd290f6..dac01d5b9a 100644 --- a/Projectiles/Typeless/SkyFlareFriendly.cs +++ b/Projectiles/Typeless/SkyFlareFriendly.cs @@ -78,7 +78,7 @@ namespace CalamityMod.Projectiles.Typeless Main.dust[skyDust2].velocity *= 2f; } - if (Main.netMode != NetmodeID.Server) + if (!Main.dedServ) { Vector2 goreSource = Projectile.Center; int goreAmt = 3; diff --git a/Projectiles/Typeless/WulfrumDiggingTurtleProjectile.cs b/Projectiles/Typeless/WulfrumDiggingTurtleProjectile.cs index 46beb0c945..616ca734da 100644 --- a/Projectiles/Typeless/WulfrumDiggingTurtleProjectile.cs +++ b/Projectiles/Typeless/WulfrumDiggingTurtleProjectile.cs @@ -168,7 +168,7 @@ namespace CalamityMod.Projectiles.Typeless GeneralParticleHandler.SpawnParticle(smoke); } - if (Main.netMode != NetmodeID.Server) + if (!Main.dedServ) { for (int i = 0; i < 4; i++) { diff --git a/Projectiles/Typeless/WulfrumScaffoldKitHoldout.cs b/Projectiles/Typeless/WulfrumScaffoldKitHoldout.cs index cb061bacb7..a4d86d4de0 100644 --- a/Projectiles/Typeless/WulfrumScaffoldKitHoldout.cs +++ b/Projectiles/Typeless/WulfrumScaffoldKitHoldout.cs @@ -117,7 +117,7 @@ namespace CalamityMod.Projectiles.Typeless Owner.ConsumeItem(ModContent.ItemType()); Kit.storedScrap = WulfrumScaffoldKit.TilesPerScrap - 1; SoundEngine.PlaySound(SoundID.Item65); - if (Main.netMode != NetmodeID.Server) + if (!Main.dedServ) { Gore shard = Gore.NewGoreDirect(Projectile.GetSource_FromThis(), Owner.Center, Main.rand.NextVector2Circular(4f, 4f), Mod.Find("WulfrumPinger2").Type, Main.rand.NextFloat(0.5f, 1f)); shard.timeLeft = 10; diff --git a/Skies/AstralMonolithSky.cs b/Skies/AstralMonolithSky.cs index 07dad080e5..e486069cd3 100644 --- a/Skies/AstralMonolithSky.cs +++ b/Skies/AstralMonolithSky.cs @@ -43,7 +43,7 @@ namespace CalamityMod.Skies spriteBatch.Draw(SkyTextureRefs.AstralSky.Value, new Rectangle(0, 0, Main.screenWidth, Main.screenHeight), Color.White * opacity); // Terraria's conditions. - if (Main.netMode != NetmodeID.Server) + if (!Main.dedServ) { int bgTop = (int)((-Main.screenPosition.Y) / (Main.worldSurface * 16.0 - 600.0) * 200.0); float colorMult = 0.952f * opacity; diff --git a/Skies/AstralSky.cs b/Skies/AstralSky.cs index 3c8d2caa0c..3814134d1a 100644 --- a/Skies/AstralSky.cs +++ b/Skies/AstralSky.cs @@ -59,7 +59,7 @@ namespace CalamityMod.Skies spriteBatch.Draw(SkyTextureRefs.AstralSky.Value, new Rectangle(0, 0, Main.screenWidth, Main.screenHeight), Color.White * opacity); // Terraria's conditions. - if (Main.netMode != NetmodeID.Server) + if (!Main.dedServ) { int bgTop = (int)((-Main.screenPosition.Y) / (Main.worldSurface * 16.0 - 600.0) * 200.0); float colorMult = 0.952f * opacity; diff --git a/Skies/ExoMechsSky.cs b/Skies/ExoMechsSky.cs index efdc1eb8f9..0a873ca312 100644 --- a/Skies/ExoMechsSky.cs +++ b/Skies/ExoMechsSky.cs @@ -67,7 +67,7 @@ namespace CalamityMod.Skies public static void CreateLightningBolt(int count = 1, bool playSound = false) { - if (Main.netMode == NetmodeID.Server) + if (Main.dedServ) return; for (int i = 0; i < count; i++) diff --git a/Systems/World/WorldMiscUpdateSystem.cs b/Systems/World/WorldMiscUpdateSystem.cs index 5b2fe01fb1..ad3ac88db8 100644 --- a/Systems/World/WorldMiscUpdateSystem.cs +++ b/Systems/World/WorldMiscUpdateSystem.cs @@ -192,7 +192,7 @@ namespace CalamityMod.Systems WorldGen.SquareTileFrame(x, y2); WorldGen.SquareTileFrame(x + 2, y2); WorldGen.SquareTileFrame(x - 1, y2); - if (Main.tile[x, y2].TileType == TileID.PlanteraBulb && Main.netMode == NetmodeID.Server) + if (Main.tile[x, y2].TileType == TileID.PlanteraBulb && Main.dedServ) { NetMessage.SendTileSquare(-1, x, y2, 5); } @@ -225,7 +225,7 @@ namespace CalamityMod.Systems WorldGen.PlaceJunglePlant(x, y2, TileID.LifeFruit, WorldGen.genRand.Next(3), 0); WorldGen.SquareTileFrame(x, y2); WorldGen.SquareTileFrame(x + 1, y2 + 1); - if (Main.tile[x, y2].TileType == TileID.LifeFruit && Main.netMode == NetmodeID.Server) + if (Main.tile[x, y2].TileType == TileID.LifeFruit && Main.dedServ) { NetMessage.SendTileSquare(-1, x, y2, 4); } @@ -307,7 +307,7 @@ namespace CalamityMod.Systems WorldGen.SquareTileFrame(x, y); - if (Main.netMode == NetmodeID.Server) + if (Main.dedServ) NetMessage.SendTileSquare(-1, x, y, 1, TileChangeType.None); } } diff --git a/TileEntities/TECodebreaker.cs b/TileEntities/TECodebreaker.cs index 892883f846..78fcd95db6 100644 --- a/TileEntities/TECodebreaker.cs +++ b/TileEntities/TECodebreaker.cs @@ -215,7 +215,7 @@ namespace CalamityMod.TileEntities InitialCellCountBeforeDecrypting = 0; LearnFromHeldSchematic(out bool anythingChanged); - if (Main.netMode == NetmodeID.Server) + if (Main.dedServ) { SyncDecryptCountdown(); SyncContainedStuff(); @@ -255,7 +255,7 @@ namespace CalamityMod.TileEntities anythingChanged = true; } - if (Main.netMode == NetmodeID.Server && anythingChanged) + if (Main.dedServ && anythingChanged) CalamityNetcode.SyncWorld(); } diff --git a/Tiles/Abyss/AbyssGravel.cs b/Tiles/Abyss/AbyssGravel.cs index 11b173fd95..061e29abef 100644 --- a/Tiles/Abyss/AbyssGravel.cs +++ b/Tiles/Abyss/AbyssGravel.cs @@ -61,7 +61,7 @@ namespace CalamityMod.Tiles.Abyss up.TileFrameX = (short)(WorldGen.genRand.Next(16) * 18); WorldGen.SquareTileFrame(i, j - 1, true); - if (Main.netMode == NetmodeID.Server) + if (Main.dedServ) NetMessage.SendTileSquare(-1, i, j - 1, 3, TileChangeType.None); } } diff --git a/Tiles/Abyss/AbyssalPots.cs b/Tiles/Abyss/AbyssalPots.cs index 5e1366ea24..8e269c0357 100644 --- a/Tiles/Abyss/AbyssalPots.cs +++ b/Tiles/Abyss/AbyssalPots.cs @@ -34,7 +34,7 @@ namespace CalamityMod.Tiles.Abyss Tile tileAtPosition = CalamityUtils.ParanoidTileRetrieval(i, j); if (tileAtPosition.TileFrameX % 36 == 0 && tileAtPosition.TileFrameY % 36 == 0) { - if (Main.netMode != NetmodeID.Server) + if (!Main.dedServ) { int goreAmt = Main.rand.Next(1, 2 + 1); for (int k = 0; k < goreAmt; k++) diff --git a/Tiles/Abyss/AcidWoodTreeSapling.cs b/Tiles/Abyss/AcidWoodTreeSapling.cs index 28be3ad585..30a8bd2878 100644 --- a/Tiles/Abyss/AcidWoodTreeSapling.cs +++ b/Tiles/Abyss/AcidWoodTreeSapling.cs @@ -114,7 +114,7 @@ namespace CalamityMod.Tiles.Abyss bool isPlayerNear = WorldGen.PlayerLOS(i, j); WorldGen.RangeFrame(i - 2, trueStartingPositionY - treeHeight - 1, i + 2, trueStartingPositionY + 1); - if (Main.netMode == NetmodeID.Server) + if (Main.dedServ) NetMessage.SendTileSquare(-1, i, (int)((double)trueStartingPositionY - (double)treeHeight * 0.5), treeHeight + 1, TileChangeType.None); if (isPlayerNear) WorldGen.TreeGrowFXCheck(i, j); diff --git a/Tiles/Abyss/HardenedSulphurousSandstone.cs b/Tiles/Abyss/HardenedSulphurousSandstone.cs index f48079fad5..566169bb26 100644 --- a/Tiles/Abyss/HardenedSulphurousSandstone.cs +++ b/Tiles/Abyss/HardenedSulphurousSandstone.cs @@ -87,7 +87,7 @@ namespace CalamityMod.Tiles.Abyss Main.tile[vineX, vineY].TileType = (ushort)ModContent.TileType(); Main.tile[vineX, vineY].Get().HasTile = true; WorldGen.SquareTileFrame(vineX, vineY, true); - if (Main.netMode == NetmodeID.Server) + if (Main.dedServ) NetMessage.SendTileSquare(-1, vineX, vineY, 3, TileChangeType.None); } } diff --git a/Tiles/Abyss/PlantyMush.cs b/Tiles/Abyss/PlantyMush.cs index 76aa71e9e4..48bfde5d53 100644 --- a/Tiles/Abyss/PlantyMush.cs +++ b/Tiles/Abyss/PlantyMush.cs @@ -72,7 +72,7 @@ namespace CalamityMod.Tiles.Abyss up.TileFrameX = (short)(WorldGen.genRand.Next(7) * 18); WorldGen.SquareTileFrame(i, j - 1, true); - if (Main.netMode == NetmodeID.Server) + if (Main.dedServ) NetMessage.SendTileSquare(-1, i, j - 1, 3, TileChangeType.None); } @@ -109,7 +109,7 @@ namespace CalamityMod.Tiles.Abyss newVineTile.TileType = (ushort)ModContent.TileType(); newVineTile.Get().HasTile = true; WorldGen.SquareTileFrame(vineX, vineY, true); - if (Main.netMode == NetmodeID.Server) + if (Main.dedServ) NetMessage.SendTileSquare(-1, vineX, vineY, 3, TileChangeType.None); } } diff --git a/Tiles/Abyss/PyreMantle.cs b/Tiles/Abyss/PyreMantle.cs index 90da582ec4..f942d7bb15 100644 --- a/Tiles/Abyss/PyreMantle.cs +++ b/Tiles/Abyss/PyreMantle.cs @@ -63,7 +63,7 @@ namespace CalamityMod.Tiles.Abyss up.TileFrameX = (short)(WorldGen.genRand.Next(16) * 18); WorldGen.SquareTileFrame(i, j - 1, true); - if (Main.netMode == NetmodeID.Server) + if (Main.dedServ) NetMessage.SendTileSquare(-1, i, j - 1, 3, TileChangeType.None); } } diff --git a/Tiles/Abyss/PyreMantleMolten.cs b/Tiles/Abyss/PyreMantleMolten.cs index ea4522232d..a0f968d2e5 100644 --- a/Tiles/Abyss/PyreMantleMolten.cs +++ b/Tiles/Abyss/PyreMantleMolten.cs @@ -69,7 +69,7 @@ namespace CalamityMod.Tiles.Abyss up.TileFrameX = (short)(WorldGen.genRand.Next(16) * 18); WorldGen.SquareTileFrame(i, j - 1, true); - if (Main.netMode == NetmodeID.Server) + if (Main.dedServ) NetMessage.SendTileSquare(-1, i, j - 1, 3, TileChangeType.None); } } diff --git a/Tiles/Abyss/ShaleColumns.cs b/Tiles/Abyss/ShaleColumns.cs index ef89091409..aeb276c33a 100644 --- a/Tiles/Abyss/ShaleColumns.cs +++ b/Tiles/Abyss/ShaleColumns.cs @@ -52,7 +52,7 @@ namespace CalamityMod.Tiles.Abyss public override void KillMultiTile(int i, int j, int frameX, int frameY) { - if (Main.netMode == NetmodeID.Server) + if (Main.dedServ) return; } diff --git a/Tiles/Abyss/SulphurousColumn.cs b/Tiles/Abyss/SulphurousColumn.cs index 6cd644742d..285effeb6a 100644 --- a/Tiles/Abyss/SulphurousColumn.cs +++ b/Tiles/Abyss/SulphurousColumn.cs @@ -53,7 +53,7 @@ namespace CalamityMod.Tiles.Abyss public override void KillMultiTile(int i, int j, int frameX, int frameY) { - if (Main.netMode == NetmodeID.Server) + if (Main.dedServ) return; // Explode into a bunch of rocks when broken. diff --git a/Tiles/Abyss/SulphurousPots.cs b/Tiles/Abyss/SulphurousPots.cs index 99a5328bf9..147d91b787 100644 --- a/Tiles/Abyss/SulphurousPots.cs +++ b/Tiles/Abyss/SulphurousPots.cs @@ -37,7 +37,7 @@ namespace CalamityMod.Tiles.Abyss Tile tileAtPosition = CalamityUtils.ParanoidTileRetrieval(i, j); if (tileAtPosition.TileFrameX % 36 == 0 && tileAtPosition.TileFrameY % 36 == 0) { - if (Main.netMode != NetmodeID.Server) + if (!Main.dedServ) { int goreAmt = Main.rand.Next(1, 2 + 1); for (int k = 0; k < goreAmt; k++) diff --git a/Tiles/Abyss/SulphurousSand.cs b/Tiles/Abyss/SulphurousSand.cs index 3dbc1957d9..c1782766db 100644 --- a/Tiles/Abyss/SulphurousSand.cs +++ b/Tiles/Abyss/SulphurousSand.cs @@ -88,7 +88,7 @@ namespace CalamityMod.Tiles.Abyss Main.tile[i, tileLocationY - 4].LiquidAmount == 255) { WorldGen.PlaceTile(i, tileLocationY, 81, true, false, -1, 0); - if (Main.netMode == NetmodeID.Server && Main.tile[i, tileLocationY].HasTile) + if (Main.dedServ && Main.tile[i, tileLocationY].HasTile) NetMessage.SendTileSquare(-1, i, tileLocationY, 1, TileChangeType.None); } } @@ -108,7 +108,7 @@ namespace CalamityMod.Tiles.Abyss if (ambientObjectAmt < ambientObjectMax) { WorldGen.PlaceTile(i, tileLocationY, 324, true, false, -1, Main.rand.Next(2)); - if (Main.netMode == NetmodeID.Server && Main.tile[i, tileLocationY].HasTile) + if (Main.dedServ && Main.tile[i, tileLocationY].HasTile) NetMessage.SendTileSquare(-1, i, tileLocationY, 1, TileChangeType.None); } } @@ -162,7 +162,7 @@ namespace CalamityMod.Tiles.Abyss Main.tile[vineX, vineY].TileType = (ushort)ModContent.TileType(); Main.tile[vineX, vineY].Get().HasTile = true; WorldGen.SquareTileFrame(vineX, vineY, true); - if (Main.netMode == NetmodeID.Server) + if (Main.dedServ) NetMessage.SendTileSquare(-1, vineX, vineY, 3, TileChangeType.None); } Main.tile[i, j].Get().Slope = SlopeType.Solid; diff --git a/Tiles/Abyss/SulphurousSandstone.cs b/Tiles/Abyss/SulphurousSandstone.cs index 692a04edbc..716cfd62fb 100644 --- a/Tiles/Abyss/SulphurousSandstone.cs +++ b/Tiles/Abyss/SulphurousSandstone.cs @@ -88,7 +88,7 @@ namespace CalamityMod.Tiles.Abyss Main.tile[vineX, vineY].TileType = (ushort)ModContent.TileType(); Main.tile[vineX, vineY].Get().HasTile = true; WorldGen.SquareTileFrame(vineX, vineY, true); - if (Main.netMode == NetmodeID.Server) + if (Main.dedServ) NetMessage.SendTileSquare(-1, vineX, vineY, 3, TileChangeType.None); } Main.tile[i, j].Get().Slope = SlopeType.Solid; diff --git a/Tiles/Abyss/SulphurousShale.cs b/Tiles/Abyss/SulphurousShale.cs index 7b5000cd0a..1ecdc028b3 100644 --- a/Tiles/Abyss/SulphurousShale.cs +++ b/Tiles/Abyss/SulphurousShale.cs @@ -103,7 +103,7 @@ namespace CalamityMod.Tiles.Abyss Main.tile[vineX, vineY].TileType = (ushort)ModContent.TileType(); Main.tile[vineX, vineY].Get().HasTile = true; WorldGen.SquareTileFrame(vineX, vineY, true); - if (Main.netMode == NetmodeID.Server) + if (Main.dedServ) NetMessage.SendTileSquare(-1, vineX, vineY, 3, TileChangeType.None); } Main.tile[i, j].Get().Slope = SlopeType.Solid; @@ -127,7 +127,7 @@ namespace CalamityMod.Tiles.Abyss up.TileFrameX = (short)(WorldGen.genRand.Next(22) * 18); WorldGen.SquareTileFrame(i, j - 1, true); - if (Main.netMode == NetmodeID.Server) + if (Main.dedServ) NetMessage.SendTileSquare(-1, i, j - 1, 3, TileChangeType.None); } } diff --git a/Tiles/Abyss/SulphurousVines.cs b/Tiles/Abyss/SulphurousVines.cs index 7bde6900b1..58306e6d98 100644 --- a/Tiles/Abyss/SulphurousVines.cs +++ b/Tiles/Abyss/SulphurousVines.cs @@ -135,7 +135,7 @@ namespace CalamityMod.Tiles.Abyss WorldGen.SquareTileFrame(i, j, true); // Send update packets as needed. - if (Main.netMode == NetmodeID.Server) + if (Main.dedServ) NetMessage.SendTileSquare(-1, x, y, 3, TileChangeType.None); } } diff --git a/Tiles/Abyss/ViperVines.cs b/Tiles/Abyss/ViperVines.cs index adca8b1c5f..232125a4e6 100644 --- a/Tiles/Abyss/ViperVines.cs +++ b/Tiles/Abyss/ViperVines.cs @@ -96,7 +96,7 @@ namespace CalamityMod.Tiles.Abyss tileBelow.TileType = Type; tileBelow.HasTile = true; WorldGen.SquareTileFrame(i, j + 1, true); - if (Main.netMode == NetmodeID.Server) + if (Main.dedServ) { NetMessage.SendTileSquare(-1, i, j + 1, 3, TileChangeType.None); } diff --git a/Tiles/Abyss/Voidstone.cs b/Tiles/Abyss/Voidstone.cs index 70dfd6b0f2..e9ce5af903 100644 --- a/Tiles/Abyss/Voidstone.cs +++ b/Tiles/Abyss/Voidstone.cs @@ -78,7 +78,7 @@ namespace CalamityMod.Tiles.Abyss up.TileFrameX = (short)(WorldGen.genRand.Next(6) * 18); WorldGen.SquareTileFrame(i, j - 1, true); - if (Main.netMode == NetmodeID.Server) + if (Main.dedServ) NetMessage.SendTileSquare(-1, i, j - 1, 3, TileChangeType.None); } } diff --git a/Tiles/Astral/AstralGrass.cs b/Tiles/Astral/AstralGrass.cs index 6acc3ddd47..7239f09f05 100644 --- a/Tiles/Astral/AstralGrass.cs +++ b/Tiles/Astral/AstralGrass.cs @@ -58,7 +58,7 @@ namespace CalamityMod.Tiles.Astral up.TileFrameX = (short)(WorldGen.genRand.Next(20) * 18); WorldGen.SquareTileFrame(i, j - 1, true); - if (Main.netMode == NetmodeID.Server) + if (Main.dedServ) { NetMessage.SendTileSquare(-1, i, j - 1, 3, TileChangeType.None); } @@ -74,7 +74,7 @@ namespace CalamityMod.Tiles.Astral up.TileFrameX = (short)(WorldGen.genRand.Next(23) * 18); WorldGen.SquareTileFrame(i, j - 1, true); - if (Main.netMode == NetmodeID.Server) + if (Main.dedServ) { NetMessage.SendTileSquare(-1, i, j - 1, 3, TileChangeType.None); } diff --git a/Tiles/BaseTiles/BranchDrawer.cs b/Tiles/BaseTiles/BranchDrawer.cs index 9f331ddd07..0a5eb328b5 100644 --- a/Tiles/BaseTiles/BranchDrawer.cs +++ b/Tiles/BaseTiles/BranchDrawer.cs @@ -73,7 +73,7 @@ namespace CalamityMod.Tiles.BaseTiles { get { - if (Main.netMode != NetmodeID.Server && basicShader is null) + if (!Main.dedServ && basicShader is null) { basicShader = new BasicEffect(Main.instance.GraphicsDevice) { diff --git a/Tiles/BaseTiles/DynamicallyGrownTree.cs b/Tiles/BaseTiles/DynamicallyGrownTree.cs index a4f4a23084..a1b64d284f 100644 --- a/Tiles/BaseTiles/DynamicallyGrownTree.cs +++ b/Tiles/BaseTiles/DynamicallyGrownTree.cs @@ -66,7 +66,7 @@ namespace CalamityMod.Tiles.BaseTiles MaxCutoffBranchesPerBranch = MaxCutoffBranchesPerBranch }; - if (Main.netMode != NetmodeID.Server) + if (!Main.dedServ) BranchDrawer.BarkTexture = ModContent.Request(Texture, AssetRequestMode.ImmediateLoad).Value; } diff --git a/Tiles/CalamityGlobalTile.cs b/Tiles/CalamityGlobalTile.cs index d8b865f5d1..f5479a2a7a 100644 --- a/Tiles/CalamityGlobalTile.cs +++ b/Tiles/CalamityGlobalTile.cs @@ -237,7 +237,7 @@ namespace CalamityMod.Tiles { tile.Get().HasTile = false; WorldGen.KillTile(x, y, fail: false, effectOnly: false, noItem: true); - if (Main.netMode == NetmodeID.Server) + if (Main.dedServ) NetMessage.TrySendData(17, -1, -1, null, 20, x, y); } } @@ -248,7 +248,7 @@ namespace CalamityMod.Tiles { Projectile.NewProjectile(new EntitySource_TileBreak(i, j), i * 16 + 8, j * 16 + 8, 0f, 0.41f, projectileType, damage, 0f, Main.myPlayer); } - else if (Main.netMode == NetmodeID.Server) + else if (Main.dedServ) { int proj = Projectile.NewProjectile(new EntitySource_TileBreak(i, j), i * 16 + 8, j * 16 + 8, 0f, 0.41f, projectileType, damage, 0f, Main.myPlayer); Main.projectile[proj].netUpdate = true; diff --git a/Tiles/Crags/ScorchedRemainsGrass.cs b/Tiles/Crags/ScorchedRemainsGrass.cs index aaab2a3a01..9d48394481 100644 --- a/Tiles/Crags/ScorchedRemainsGrass.cs +++ b/Tiles/Crags/ScorchedRemainsGrass.cs @@ -82,7 +82,7 @@ namespace CalamityMod.Tiles.Crags up.TileFrameX = (short)(WorldGen.genRand.Next(20) * 18); WorldGen.SquareTileFrame(i, j - 1, true); - if (Main.netMode == NetmodeID.Server) + if (Main.dedServ) { NetMessage.SendTileSquare(-1, i, j - 1, 3, TileChangeType.None); } @@ -113,7 +113,7 @@ namespace CalamityMod.Tiles.Crags up.TileFrameX = (short)(WorldGen.genRand.Next(8) * 18); WorldGen.SquareTileFrame(i, j - 1, true); - if (Main.netMode == NetmodeID.Server) + if (Main.dedServ) { NetMessage.SendTileSquare(-1, i, j - 1, 3, TileChangeType.None); } diff --git a/Tiles/FloralParadise/LushVines.cs b/Tiles/FloralParadise/LushVines.cs index eeb8817853..5300739e3e 100644 --- a/Tiles/FloralParadise/LushVines.cs +++ b/Tiles/FloralParadise/LushVines.cs @@ -81,7 +81,7 @@ namespace CalamityMod.Tiles.FloralParadise Main.tile[i, below].Get().HasTile = true; WorldGen.SquareTileFrame(i, below, true); WorldGen.SquareTileFrame(i, below - 1, true); - if (Main.netMode == NetmodeID.Server) + if (Main.dedServ) { NetMessage.SendTileSquare(-1, i, below, 3, TileChangeType.None); NetMessage.SendTileSquare(-1, i, below - 1, 3, TileChangeType.None); diff --git a/Tiles/FloralParadise/PeatMoss.cs b/Tiles/FloralParadise/PeatMoss.cs index b92e58ecff..3824a28f8f 100644 --- a/Tiles/FloralParadise/PeatMoss.cs +++ b/Tiles/FloralParadise/PeatMoss.cs @@ -101,7 +101,7 @@ namespace CalamityMod.Tiles.FloralParadise Main.tile[i, belowY].TileType = (ushort)ModContent.TileType(); Main.tile[i, belowY].Get().HasTile = true; WorldGen.SquareTileFrame(i, belowY, true); - if (Main.netMode == NetmodeID.Server) + if (Main.dedServ) { NetMessage.SendTileSquare(-1, i, belowY, 3, TileChangeType.None); } diff --git a/Tiles/FloralParadise/SmallVines.cs b/Tiles/FloralParadise/SmallVines.cs index 8cdbfd28dd..c49c7b19b4 100644 --- a/Tiles/FloralParadise/SmallVines.cs +++ b/Tiles/FloralParadise/SmallVines.cs @@ -81,7 +81,7 @@ namespace CalamityMod.Tiles.FloralParadise Main.tile[i, below].Get().HasTile = true; WorldGen.SquareTileFrame(i, below, true); WorldGen.SquareTileFrame(i, below - 1, true); - if (Main.netMode == NetmodeID.Server) + if (Main.dedServ) { NetMessage.SendTileSquare(-1, i, below, 3, TileChangeType.None); NetMessage.SendTileSquare(-1, i, below - 1, 3, TileChangeType.None); diff --git a/Tiles/FloralParadise/WaterfallCreator.cs b/Tiles/FloralParadise/WaterfallCreator.cs index ad070df5af..9bda03602b 100644 --- a/Tiles/FloralParadise/WaterfallCreator.cs +++ b/Tiles/FloralParadise/WaterfallCreator.cs @@ -26,7 +26,7 @@ namespace CalamityMod.Tiles.FloralParadise public override void NearbyEffects(int i, int j, bool closer) { Tile tile = CalamityUtils.ParanoidTileRetrieval(i, j); - if (Main.netMode == NetmodeID.Server || !Main.rand.NextBool() || Main.gamePaused || tile.LiquidAmount > 0) + if (Main.dedServ || !Main.rand.NextBool() || Main.gamePaused || tile.LiquidAmount > 0) return; for (int k = 0; k < 16; k++) diff --git a/Tiles/Rubblemaker/Abyss/ShaleColumnsEcho.cs b/Tiles/Rubblemaker/Abyss/ShaleColumnsEcho.cs index e078ae2fd6..23fffb7d2b 100644 --- a/Tiles/Rubblemaker/Abyss/ShaleColumnsEcho.cs +++ b/Tiles/Rubblemaker/Abyss/ShaleColumnsEcho.cs @@ -46,7 +46,7 @@ namespace CalamityMod.Tiles.Rubblemaker.Abyss public override void KillMultiTile(int i, int j, int frameX, int frameY) { - if (Main.netMode == NetmodeID.Server) + if (Main.dedServ) return; } public override void NumDust(int i, int j, bool fail, ref int num) diff --git a/Tiles/Rubblemaker/SulphurousSea/SulphurousColumnEcho.cs b/Tiles/Rubblemaker/SulphurousSea/SulphurousColumnEcho.cs index 60c30ebb13..1fbefd2843 100644 --- a/Tiles/Rubblemaker/SulphurousSea/SulphurousColumnEcho.cs +++ b/Tiles/Rubblemaker/SulphurousSea/SulphurousColumnEcho.cs @@ -47,7 +47,7 @@ namespace CalamityMod.Tiles.Rubblemaker.SulphurousSea public override void KillMultiTile(int i, int j, int frameX, int frameY) { - if (Main.netMode == NetmodeID.Server) + if (Main.dedServ) return; // Explode into a bunch of rocks when broken. diff --git a/Tiles/SunkenSea/Ambient/DepthVines.cs b/Tiles/SunkenSea/Ambient/DepthVines.cs index faf1b14f81..7c5f36445d 100644 --- a/Tiles/SunkenSea/Ambient/DepthVines.cs +++ b/Tiles/SunkenSea/Ambient/DepthVines.cs @@ -77,7 +77,7 @@ namespace CalamityMod.Tiles.SunkenSea.Ambient tileBelow.TileType = Type; tileBelow.HasTile = true; WorldGen.SquareTileFrame(i, j + 1, true); - if (Main.netMode == NetmodeID.Server) + if (Main.dedServ) { NetMessage.SendTileSquare(-1, i, j + 1, 3, TileChangeType.None); } diff --git a/Tiles/SunkenSea/EutrophicSand.cs b/Tiles/SunkenSea/EutrophicSand.cs index 4bb35609b7..9638735706 100644 --- a/Tiles/SunkenSea/EutrophicSand.cs +++ b/Tiles/SunkenSea/EutrophicSand.cs @@ -71,7 +71,7 @@ namespace CalamityMod.Tiles.SunkenSea up.TileFrameX = (short)(WorldGen.genRand.Next(15) * 18); WorldGen.SquareTileFrame(i, j - 1, true); - if (Main.netMode == NetmodeID.Server) + if (Main.dedServ) { NetMessage.SendTileSquare(-1, i, j - 1, 3, TileChangeType.None); } diff --git a/Tiles/SunkenSea/Navystone.cs b/Tiles/SunkenSea/Navystone.cs index 445a4ae2a2..d982d24e92 100644 --- a/Tiles/SunkenSea/Navystone.cs +++ b/Tiles/SunkenSea/Navystone.cs @@ -54,7 +54,7 @@ namespace CalamityMod.Tiles.SunkenSea Below.TileType = (ushort)ModContent.TileType(); Below.HasTile = true; WorldGen.SquareTileFrame(i, j + 1, true); - if (Main.netMode == NetmodeID.Server) + if (Main.dedServ) { NetMessage.SendTileSquare(-1, i, j + 1, 3, TileChangeType.None); } diff --git a/Utilities/DropHelper.cs b/Utilities/DropHelper.cs index 9b1fce5a1a..6b19c38c64 100644 --- a/Utilities/DropHelper.cs +++ b/Utilities/DropHelper.cs @@ -1450,7 +1450,7 @@ namespace CalamityMod return; // If server-side, then the item must be spawned for each client individually. - if (Main.netMode == NetmodeID.Server) + if (Main.dedServ) { NPC npc = info.npc; int idx = Item.NewItem(npc.GetSource_Loot(), npc.Center, itemId, stack, true, -1); diff --git a/Utilities/MiscUtils.cs b/Utilities/MiscUtils.cs index 2407103f72..89973967e4 100644 --- a/Utilities/MiscUtils.cs +++ b/Utilities/MiscUtils.cs @@ -27,7 +27,7 @@ namespace CalamityMod if (Main.netMode == NetmodeID.SinglePlayer) Main.NewText(Language.GetTextValue(key), textColor.Value); - else if (Main.netMode == NetmodeID.Server || Main.netMode == NetmodeID.MultiplayerClient) + else if (Main.dedServ || Main.netMode == NetmodeID.MultiplayerClient) ChatHelper.BroadcastChatMessage(NetworkText.FromKey(key), textColor.Value); } @@ -139,7 +139,7 @@ namespace CalamityMod if (soundPos.X == -1f || soundPos.Y == -1f) volume = 1f; - else if (WorldGen.gen || Main.dedServ || Main.netMode == NetmodeID.Server) + else if (WorldGen.gen || Main.dedServ || Main.dedServ) volume = 0f; else { diff --git a/Utilities/NPCUtils.cs b/Utilities/NPCUtils.cs index 77b8af6dbd..7159ab6ce0 100644 --- a/Utilities/NPCUtils.cs +++ b/Utilities/NPCUtils.cs @@ -879,7 +879,7 @@ namespace CalamityMod { Main.NewText(Language.GetTextValue("Announcement.HasAwoken", typeName), new Color(175, 75, 255)); } - else if (Main.netMode == NetmodeID.Server) + else if (Main.dedServ) { ChatHelper.BroadcastChatMessage(NetworkText.FromKey("Announcement.HasAwoken", [Main.npc[npcIndex].GetTypeNetName()]), new Color(175, 75, 255)); } @@ -989,7 +989,7 @@ namespace CalamityMod npc.timeLeft *= 20; // Server Exclusive: Sync NPC Data - if (Main.netMode == NetmodeID.Server) + if (Main.dedServ) { NetMessage.SendData(MessageID.SyncNPC, -1, -1, null, spawnedNPCIdx); } @@ -1022,7 +1022,7 @@ namespace CalamityMod /// The index of the player who will spawn Old Duke. internal static void SpawnOldDuke(int playerIndex) { - if (Main.netMode != NetmodeID.Server) + if (!Main.dedServ) return; Player player = Main.player[playerIndex]; diff --git a/Utilities/PlayerUtils.cs b/Utilities/PlayerUtils.cs index 0230959ea1..83a425b6b3 100644 --- a/Utilities/PlayerUtils.cs +++ b/Utilities/PlayerUtils.cs @@ -697,7 +697,7 @@ namespace CalamityMod { CalamityPlayer mp = p.Calamity(); mp.cooldowns[id] = instance; - mp.SyncCooldownAddition(Main.netMode == NetmodeID.Server, instance); + mp.SyncCooldownAddition(Main.dedServ, instance); } return instance; diff --git a/Utilities/ProjectileUtils.cs b/Utilities/ProjectileUtils.cs index 23ccce13f9..592f3e067f 100644 --- a/Utilities/ProjectileUtils.cs +++ b/Utilities/ProjectileUtils.cs @@ -984,7 +984,7 @@ PostWallBlastLoop:; } // Smoke, which counts as a Gore - if (Main.netMode != NetmodeID.Server) + if (!Main.dedServ) { Vector2 goreSource = projectile.Center; int goreAmt = 3; diff --git a/Walls/AbyssGravelWall.cs b/Walls/AbyssGravelWall.cs index 6b2030d211..44e781e3a0 100644 --- a/Walls/AbyssGravelWall.cs +++ b/Walls/AbyssGravelWall.cs @@ -20,7 +20,7 @@ namespace CalamityMod.Walls Main.tile[i, j].Get().LiquidType = LiquidID.Water; Main.tile[i, j].LiquidAmount = byte.MaxValue; WorldGen.SquareTileFrame(i, j); - if (Main.netMode == NetmodeID.Server) + if (Main.dedServ) NetMessage.sendWater(i, j); } } diff --git a/Walls/EutrophicSandWall.cs b/Walls/EutrophicSandWall.cs index c7395af510..d6b6bb71c2 100644 --- a/Walls/EutrophicSandWall.cs +++ b/Walls/EutrophicSandWall.cs @@ -20,7 +20,7 @@ namespace CalamityMod.Walls Main.tile[i, j].Get().LiquidType = LiquidID.Water; Main.tile[i, j].LiquidAmount = byte.MaxValue; WorldGen.SquareTileFrame(i, j); - if (Main.netMode == NetmodeID.Server) + if (Main.dedServ) NetMessage.sendWater(i, j); } } diff --git a/Walls/PyreMantleWall.cs b/Walls/PyreMantleWall.cs index 6b03ce47fd..6ee73138b7 100644 --- a/Walls/PyreMantleWall.cs +++ b/Walls/PyreMantleWall.cs @@ -20,7 +20,7 @@ namespace CalamityMod.Walls Main.tile[i, j].Get().LiquidType = LiquidID.Water; Main.tile[i, j].LiquidAmount = byte.MaxValue; WorldGen.SquareTileFrame(i, j); - if (Main.netMode == NetmodeID.Server) + if (Main.dedServ) NetMessage.sendWater(i, j); } } diff --git a/Walls/VoidstoneWallUnsafe.cs b/Walls/VoidstoneWallUnsafe.cs index b67cd4a7ae..2b50eada3f 100644 --- a/Walls/VoidstoneWallUnsafe.cs +++ b/Walls/VoidstoneWallUnsafe.cs @@ -37,7 +37,7 @@ namespace CalamityMod.Walls Main.tile[i, j].Get().LiquidType = LiquidID.Water; Main.tile[i, j].LiquidAmount = byte.MaxValue; WorldGen.SquareTileFrame(i, j); - if (Main.netMode == NetmodeID.Server) + if (Main.dedServ) NetMessage.sendWater(i, j); } } diff --git a/World/Abyss.cs b/World/Abyss.cs index 7a62816fe9..359ef44311 100644 --- a/World/Abyss.cs +++ b/World/Abyss.cs @@ -1182,7 +1182,7 @@ namespace CalamityMod.World /// public static void UnlockAllAbyssChests() { - if (Main.netMode == NetmodeID.Server) + if (Main.dedServ) { UnlockAbyssChestsPacket.Send(); DoUnlockAllAbyssChests(); diff --git a/World/AerialiteOreGen.cs b/World/AerialiteOreGen.cs index 0df55e7229..9a487be65a 100644 --- a/World/AerialiteOreGen.cs +++ b/World/AerialiteOreGen.cs @@ -90,7 +90,7 @@ namespace CalamityMod.World WorldGen.SquareTileFrame(x, y); // Inform all clients of the tile change. - if (Main.netMode == NetmodeID.Server) + if (Main.dedServ) NetMessage.SendTileSquare(-1, x, y); } } diff --git a/World/AstralBiome.cs b/World/AstralBiome.cs index 274d345845..8ec21d15fd 100644 --- a/World/AstralBiome.cs +++ b/World/AstralBiome.cs @@ -1177,7 +1177,7 @@ namespace CalamityMod.World { WorldGen.SquareTileFrame(x, y, true); } - else if (Main.netMode == NetmodeID.Server) + else if (Main.dedServ) { NetMessage.SendTileSquare(-1, x, y, 1); } diff --git a/World/Planets/LuminitePlanet.cs b/World/Planets/LuminitePlanet.cs index 01a92face5..fccaf54011 100644 --- a/World/Planets/LuminitePlanet.cs +++ b/World/Planets/LuminitePlanet.cs @@ -88,7 +88,7 @@ namespace CalamityMod.World.Planets })); // And sync the entire thing. - if (Main.netMode == NetmodeID.Server) + if (Main.dedServ) NetMessage.SendTileSquare(-1, origin.X - radius - 16, origin.Y - radius - 16, radius * 2 + 16, radius * 2 + 16); } } diff --git a/World/Planets/LuminitePlanet2.cs b/World/Planets/LuminitePlanet2.cs index e1aaa76bfd..e9cd5f9204 100644 --- a/World/Planets/LuminitePlanet2.cs +++ b/World/Planets/LuminitePlanet2.cs @@ -94,7 +94,7 @@ namespace CalamityMod.World.Planets })); // And sync the entire thing. - if (Main.netMode == NetmodeID.Server) + if (Main.dedServ) NetMessage.SendTileSquare(-1, origin.X - radius - 36, origin.Y - radius - 36, radius * 2 + 36, radius * 2 + 36); } }