internal static void Initialize(IModHelper helper) { Helper = helper; CP = Helper.ModRegistry.GetApi <IContentPatcherApi>("Pathoschild.ContentPatcher"); if (CP is null) { Log.Alert("Content Patcher is not installed - RSV requires CP to run. Please install CP and restart your game."); return; } JA = Helper.ModRegistry.GetApi <IJsonAssetsApi>("spacechase0.JsonAssets"); if (JA == null) { Log.Warn("Json Assets API not found. This could lead to issues."); } MR = Helper.ModRegistry.GetApi <IWearMoreRingsApi>("bcmpinc.WearMoreRings"); if (MR == null) { Log.Trace("Wear More Rings API not found. Using base game ring slots only."); } SC = Helper.ModRegistry.GetApi <ISpaceCoreApi>("spacechase0.SpaceCore"); if (SC == null) { Log.Warn("SpaceCore API not found. This could lead to issues."); } QF = Helper.ModRegistry.GetApi <IQuestFrameworkApi>("purrplingcat.QuestFramework"); if (QF == null) { Log.Warn("Quest Framework API not found. This could lead to issues."); } }
public void OnGameLaunched(object sender, GameLaunchedEventArgs e) { ISpaceCoreApi api = Helper.ModRegistry.GetApi <ISpaceCoreApi>("spacechase0.SpaceCore"); if (api != null) { api.RegisterSerializerType(typeof(AutomatedEnchantment)); api.RegisterSerializerType(typeof(ExpertEnchantment)); api.RegisterSerializerType(typeof(HunterEnchantment)); api.RegisterSerializerType(typeof(MinerEnchantment)); api.RegisterSerializerType(typeof(PotentEnchantment)); api.RegisterSerializerType(typeof(PreciseEnchantment)); api.RegisterSerializerType(typeof(SwiftEnchantment)); api.RegisterSerializerType(typeof(Enchantments.BugKillerEnchantment)); api.RegisterSerializerType(typeof(Enchantments.PreservingEnchantment)); api.RegisterSerializerType(typeof(Enchantments.VampiricEnchantment)); } }