From e6bc30669197ca2c1a9c19ec640962b8da109118 Mon Sep 17 00:00:00 2001 From: Flowaria Date: Tue, 17 Sep 2024 23:26:14 +0900 Subject: [PATCH] WeakRef as Full ModSystem, Fixes Dependency Issues --- CalamityMod.cs | 3 --- ModSupport/WeakReferenceSupport.cs | 12 ++++++------ Systems/Mechanic/GraveyardBiomeSystem.cs | 2 +- Systems/Mechanic/MountsBalancingSystem.cs | 2 +- 4 files changed, 8 insertions(+), 11 deletions(-) diff --git a/CalamityMod.cs b/CalamityMod.cs index eedd074901..1f757687d1 100644 --- a/CalamityMod.cs +++ b/CalamityMod.cs @@ -139,9 +139,6 @@ namespace CalamityMod LoadClient(); PrimitiveRenderer.Initialize(); ForegroundDrawing.ForegroundManager.Load(); - - // Wikithis support - WeakReferenceSupport.WikiThisSupport(); } EnchantmentManager.LoadAllEnchantments(); diff --git a/ModSupport/WeakReferenceSupport.cs b/ModSupport/WeakReferenceSupport.cs index 1ab1bd5b2d..ae167ac5f7 100644 --- a/ModSupport/WeakReferenceSupport.cs +++ b/ModSupport/WeakReferenceSupport.cs @@ -197,16 +197,16 @@ namespace CalamityMod SummonersAssociationSupport(); ColoredDamageTypesSupport(); LuminanceSupport(); - // done here to assure that all other mods have already loaded so that Calamity can automatically grab any of these types they may have + if (!Main.dedServ) { - CooldownRegistry.RegisterModCooldowns(); + WikiThisSupport(); PopupGUIManager.LoadGUIs(); } } #region BiomeLava - public static void LavaStyleToBiomeLava() + private static void LavaStyleToBiomeLava() { CalamityMod calamity = GetInstance(); Mod biomelava = ExternalMods.biomeLava; @@ -255,7 +255,7 @@ namespace CalamityMod #region WikiThis // This is a separate function because it only runs clientside - public static void WikiThisSupport() + private static void WikiThisSupport() { // Wikithis is a clientside mod if (Main.netMode == NetmodeID.Server) @@ -1292,7 +1292,7 @@ namespace CalamityMod private static Color StealthDamageColor = new(185, 105, 250); private static Color StealthCritColor = new(144, 33, 235); - public static void ColoredDamageTypesSupport() + private static void ColoredDamageTypesSupport() { Mod coloredDamageTypes = ExternalMods.coloredDamageTypes; if (coloredDamageTypes is null) @@ -1319,7 +1319,7 @@ namespace CalamityMod private static void RegisterWorldInfoIcon(Mod luminance, string texturePath, string hoverTextKey, Func shouldAppear, byte priority) => luminance.Call("RegisterWorldInfoIcon", texturePath, hoverTextKey, shouldAppear, priority); - public static void LuminanceSupport() + private static void LuminanceSupport() { Mod luminance = ExternalMods.luminance; if (luminance is null) diff --git a/Systems/Mechanic/GraveyardBiomeSystem.cs b/Systems/Mechanic/GraveyardBiomeSystem.cs index 39fffc0b75..b1104f87ba 100644 --- a/Systems/Mechanic/GraveyardBiomeSystem.cs +++ b/Systems/Mechanic/GraveyardBiomeSystem.cs @@ -13,7 +13,7 @@ namespace CalamityMod.Systems // For now it literally adjust the graveyard count required for GraveyardBiome // But we can add something later on /shrug - public override void Load() + public override void OnModLoad() { // Make Graveyard biomes require more Gravestones SceneMetrics.GraveyardTileMax = 60; diff --git a/Systems/Mechanic/MountsBalancingSystem.cs b/Systems/Mechanic/MountsBalancingSystem.cs index 9a67d0890a..4a71442443 100644 --- a/Systems/Mechanic/MountsBalancingSystem.cs +++ b/Systems/Mechanic/MountsBalancingSystem.cs @@ -12,7 +12,7 @@ namespace CalamityMod.Systems { internal sealed class MountsBalancingSystem : ModSystem { - public override void Load() + public override void OnModLoad() { // Mount balancing occurs during runtime and is undone when Calamity is unloaded. Mount.mounts[MountID.Unicorn].dashSpeed *= CalamityPlayer.UnicornSpeedNerfPower;