fix: get Service type correctly

This commit is contained in:
Anna 2021-08-22 17:53:37 -04:00
parent 7e7036a0db
commit 773e8ea712
2 changed files with 2 additions and 2 deletions

View File

@ -2,6 +2,7 @@
using System.Collections.Generic;
using System.Reflection;
using Dalamud.Game.Text.SeStringHandling;
using Dalamud.Plugin;
namespace XivCommon {
internal static class Util {
@ -39,7 +40,7 @@ namespace XivCommon {
}
internal static T GetService<T>() {
var service = Type.GetType("Dalamud.Service")!.MakeGenericType(typeof(T));
var service = typeof(IDalamudPlugin).Assembly.GetType("Dalamud.Service`1")!.MakeGenericType(typeof(T));
var get = service.GetMethod("Get", BindingFlags.Public | BindingFlags.Static)!;
return (T) get.Invoke(null, null)!;
}

View File

@ -1,5 +1,4 @@
using System;
using Dalamud.Plugin;
namespace XivCommon {
/// <summary>