diff --git a/CalamityNetcode.cs b/CalamityNetcode.cs index a7039fe451..bcbac193f0 100644 --- a/CalamityNetcode.cs +++ b/CalamityNetcode.cs @@ -169,14 +169,6 @@ namespace CalamityMod NetMessage.SendData(MessageID.SyncNPC, toClient, ignoreClient, null, npcWhoAmI); } - public static void SyncCalamityWorldDifficulties(int sender) - { - if (Main.netMode == NetmodeID.SinglePlayer) - return; - - SyncDifficultiesPacket.Send(); - } - public static void NewNPC_ClientSide(Vector2 spawnPosition, int npcType, Player player) { if (Main.netMode == NetmodeID.SinglePlayer) @@ -256,7 +248,6 @@ namespace CalamityMod MousePositionSync, // World state sync - SyncDifficulties, SwitchToDifficulty, // Music events diff --git a/Packets/Worlds/SyncDifficultiesPacket.cs b/Packets/Worlds/SyncDifficultiesPacket.cs deleted file mode 100644 index d205f57d8a..0000000000 --- a/Packets/Worlds/SyncDifficultiesPacket.cs +++ /dev/null @@ -1,41 +0,0 @@ -using System; -using System.Collections.Generic; -using System.IO; -using System.Linq; -using System.Text; -using System.Threading.Tasks; -using CalamityMod.World; -using Terraria; - -namespace CalamityMod.Packets -{ - public sealed class SyncDifficultiesPacket : CalamityPacket - { - // MIGRATED COMMENTS FROM: 'CalamityNetcode.cs' - //TODO - Something so that other mods that hijack the difficulty ui can also use the remainder of the reader to have their own shit - - public static SyncDifficultiesPacket Instance { get; private set; } - - public override byte MessageType => (byte)CalamityModMessageType.SyncDifficulties; - - public static void Send(int toClient = -1, int ignoreClient = -1) - { - var packet = Instance.CreateBasePacket(); - var difficultyFlags = new BitsByte(); - difficultyFlags[0] = CalamityWorld.revenge; - difficultyFlags[1] = CalamityWorld.death; - packet.Write((byte)difficultyFlags); - packet.Send(toClient, ignoreClient); - } - - public override void HandlePacket(in BinaryReader packet, int sender) - { - var difficultyFlags = (BitsByte)packet.ReadByte(); - CalamityWorld.revenge = difficultyFlags[0]; - CalamityWorld.death = difficultyFlags[1]; - - if (Main.dedServ) - Send(ignoreClient: sender); - } - } -}