mirror of
https://github.com/goatcorp/Dalamud.git
synced 2025-12-12 18:27:23 +01:00
fix: Create() => CreateAsync(), fix custom plugin IoC
This commit is contained in:
parent
fc6aa528c9
commit
5870c91bb4
3 changed files with 3 additions and 3 deletions
|
|
@ -45,7 +45,7 @@ namespace Dalamud.IoC.Internal
|
|||
/// <param name="objectType">The type of object to create.</param>
|
||||
/// <param name="scopedObjects">Scoped objects to be included in the constructor.</param>
|
||||
/// <returns>The created object.</returns>
|
||||
public async Task<object?> Create(Type objectType, params object[] scopedObjects)
|
||||
public async Task<object?> CreateAsync(Type objectType, params object[] scopedObjects)
|
||||
{
|
||||
var ctor = this.FindApplicableCtor(objectType, scopedObjects);
|
||||
if (ctor == null)
|
||||
|
|
|
|||
|
|
@ -361,7 +361,7 @@ namespace Dalamud.Plugin
|
|||
realScopedObjects[0] = this;
|
||||
Array.Copy(scopedObjects, 0, realScopedObjects, 1, scopedObjects.Length);
|
||||
|
||||
return svcContainer.Create(typeof(T), realScopedObjects) as T;
|
||||
return (T)svcContainer.CreateAsync(typeof(T), realScopedObjects).GetAwaiter().GetResult();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
|
|
|
|||
|
|
@ -334,7 +334,7 @@ internal class LocalPlugin : IDisposable
|
|||
this.DalamudInterface = new DalamudPluginInterface(this.pluginAssembly.GetName().Name!, this.DllFile, reason, this.IsDev);
|
||||
|
||||
var ioc = Service<ServiceContainer>.Get();
|
||||
this.instance = ioc.Create(this.pluginType, this.DalamudInterface).GetAwaiter().GetResult() as IDalamudPlugin;
|
||||
this.instance = ioc.CreateAsync(this.pluginType, this.DalamudInterface).GetAwaiter().GetResult() as IDalamudPlugin;
|
||||
if (this.instance == null)
|
||||
{
|
||||
this.State = PluginState.LoadError;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue