/// <summary>Get an API for the mod, and show a message if it can't be loaded.</summary> /// <typeparam name="TInterface">The API type.</typeparam> protected TInterface GetValidatedApi <TInterface>() where TInterface : class { var api = ModRegistry.GetApi <TInterface>(ModID); if (api == null) { Monitor.Log($"Detected {Label}, but couldn't fetch its API. Disabled integration with this mod.", LogLevel.Warn); return(null); } return(api); }