TModLoader v1.4.4.9
TModLoader source code documentation
Loading...
Searching...
No Matches

◆ SendExtraAI()

virtual void Terraria.ModLoader.GlobalNPC.SendExtraAI ( NPC npc,
BitWriter bitWriter,
BinaryWriter binaryWriter )
inlinevirtualinherited

Use this judiciously to avoid straining the network.
Checks and methods such as M:Terraria.ModLoader.GlobalType`2.AppliesToEntity(`0,System.Boolean) can reduce how much data must be sent for how many projectiles.
Called whenever F:Terraria.ID.MessageID.SyncNPC is successfully sent, for example on NPC creation, on player join, or whenever NPC.netUpdate is set to true in the update loop for that tick.
Can be called on the server.

Parameters
npcThe NPC.
bitWriterThe compressible bit writer. Booleans written via this are compressed across all mods to improve multiplayer performance.
binaryWriterThe writer.

Definition at line 148 of file GlobalNPC.cs.

149 {
150 }