private ModPacket GetPacket(TerraSpiritMessageType type) { ModPacket packet = mod.GetPacket(); packet.Write((byte)MessageType.TerraSpirit); packet.Write(npc.whoAmI); packet.Write((byte)type); return(packet); }
public void HandlePacket(BinaryReader reader) { TerraSpiritMessageType type = (TerraSpiritMessageType)reader.ReadByte(); if (type == TerraSpiritMessageType.TerraPlayer) { byte lives = reader.ReadByte(); Player player = Main.player[Main.myPlayer]; player.GetModPlayer <BluemagicPlayer>(mod).terraLives = lives; Main.NewText("You have " + lives + " lives!"); } }