public override void Serialize(BitStream stream, EndpointId forClient, MyTimeSpan timeStamp, byte packetId, int maxBitPosition) { base.Serialize(stream, forClient, timeStamp, packetId, maxBitPosition); if (stream.Writing) { MyCharacterNetState charNetState; Entity.GetNetState(out charNetState); charNetState.Serialize(stream); } else { var charNetState = new MyCharacterNetState(stream); if (!IsControlledLocally) { Entity.SetNetState(ref charNetState, true); } } }