/// <summary>Get a copy of an asset from a mod folder.</summary> /// <typeparam name="T">The asset type.</typeparam> /// <param name="internalKey">The internal asset key.</param> /// <param name="contentManagerID">The unique name for the content manager which should load this asset.</param> /// <param name="relativePath">The internal SMAPI asset key.</param> /// <param name="language">The language code for which to load content.</param> public T LoadAndCloneManagedAsset <T>(string internalKey, string contentManagerID, string relativePath, LocalizedContentManager.LanguageCode language) { // get content manager IContentManager contentManager = this.ContentManagers.FirstOrDefault(p => p.Name == contentManagerID); if (contentManager == null) { throw new InvalidOperationException($"The '{contentManagerID}' prefix isn't handled by any mod."); } // get cloned asset T data = contentManager.Load <T>(internalKey, language); return(contentManager.CloneIfPossible(data)); }