diff --git a/LootCache.cs b/LootCache.cs index c1eb652..92d72a4 100644 --- a/LootCache.cs +++ b/LootCache.cs @@ -377,11 +377,15 @@ private static void Reflect() MethodInfo setTextMethod = assembly.GetType("Terraria.ModLoader.UI.UILoadProgress").GetMethod("SetText", BindingFlags.Instance | BindingFlags.NonPublic); MethodInfo setProgressMethod = assembly.GetType("Terraria.ModLoader.UI.UILoadProgress").GetMethod("SetProgress", BindingFlags.Instance | BindingFlags.NonPublic); - MethodInfo setSubTextMethod = assembly.GetType("Terraria.ModLoader.UI.UILoadMods").GetMethod("SetSubProgressInit", BindingFlags.Instance | BindingFlags.NonPublic); setLoadProgressText = (string s) => setTextMethod.Invoke(loadProgressObject, new object[] { s }); setLoadProgressProgress = (float f) => setProgressMethod.Invoke(loadProgressObject, new object[] { f }); - setLoadSubProgressText = (string s) => setSubTextMethod.Invoke(loadModsObject, new object[] { s }); + + if (ModLoader.version >= new Version(0, 10, 1)) + { + MethodInfo setSubTextMethod = assembly.GetType("Terraria.ModLoader.UI.UILoadMods").GetMethod("SetSubProgressInit", BindingFlags.Instance | BindingFlags.NonPublic); + setLoadSubProgressText = (string s) => setSubTextMethod.Invoke(loadModsObject, new object[] { s }); + } } static int[] ignoreItemIDS = { ItemID.Heart, 1734, 1867, 184, 1735, 1868, ItemID.CopperCoin, ItemID.CopperCoin, ItemID.SilverCoin, ItemID.GoldCoin, ItemID.PlatinumCoin }; @@ -441,7 +445,7 @@ public class RecipeBrowserGlobalNPC : GlobalNPC { public override bool PreNPCLoot(NPC npc) { - if(LootCacheManager.LootCacheManagerActive) + if (LootCacheManager.LootCacheManagerActive) ((List)(NPCLoader.blockLoot)).AddRange(LootCacheManager.loots); return true; } diff --git a/build.txt b/build.txt index 97cf70d..e83b643 100644 --- a/build.txt +++ b/build.txt @@ -1,5 +1,5 @@ author = jopojelly -version = 0.4.0.1 +version = 0.4.0.2 displayName = Recipe Browser homepage = https://forums.terraria.org/index.php?threads/recipe-browser.62462/ buildIgnore = .vs\*, Properties\*, *.csproj, *.user, obj\*, bin\*, *.config, unused\*, .git\*,