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

◆ CopyClientState()

override void Terraria.ModLoader.Default.ConsumedStatIncreasesPlayer.CopyClientState ( ModPlayer targetCopy)
inlinevirtual


Allows you to copy information that you intend to sync between server and client to the targetCopy parameter.
You would then use the M:Terraria.ModLoader.ModPlayer.SendClientChanges(Terraria.ModLoader.ModPlayer) hook to compare against that data and decide what needs synchronizing.
This hook is called with every call of the M:Terraria.Player.clientClone method.

NOTE: For performance reasons, avoid deep cloning or copying any excessive information.
NOTE: Using M:Terraria.Item.CopyNetStateTo(Terraria.Item) is the recommended way of creating item snapshots.

Parameters
targetCopy

Reimplemented from Terraria.ModLoader.ModPlayer.

Definition at line 55 of file ConsumedStatIncreasesPlayer.cs.

56 {
57 Player source = base.Player;
58 Player player = targetCopy.Player;
59 player.ConsumedLifeCrystals = source.ConsumedLifeCrystals;
60 player.ConsumedLifeFruit = source.ConsumedLifeFruit;
61 player.ConsumedManaCrystals = source.ConsumedManaCrystals;
62 }
Player Player
The Player instance that this ModPlayer instance is attached to.
Definition ModPlayer.cs:29

References Terraria.Player.ConsumedLifeCrystals, Terraria.Player.ConsumedLifeFruit, and Terraria.Player.ConsumedManaCrystals.