Please disclose if any significant portion of your mod was created using AI tools by adding the 'AI Generated' category. Failing to do so may result in the mod being removed from Thunderstore.
Decompiled source of RangerBelt v1.0.0
Plugins/RangerBelt.dll
Decompiled 20 hours agousing System.Collections.Generic; using System.Diagnostics; using System.IO; using System.Linq; using System.Reflection; using System.Runtime.CompilerServices; using System.Runtime.InteropServices; using System.Runtime.Versioning; using BepInEx; using BepInEx.Logging; using HarmonyLib; using Jotunn.Configs; using Jotunn.Entities; using Jotunn.Managers; using UnityEngine; [assembly: CompilationRelaxations(8)] [assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)] [assembly: Debuggable(DebuggableAttribute.DebuggingModes.Default | DebuggableAttribute.DebuggingModes.DisableOptimizations | DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints | DebuggableAttribute.DebuggingModes.EnableEditAndContinue)] [assembly: AssemblyTitle("RangerBelt")] [assembly: AssemblyDescription("")] [assembly: AssemblyConfiguration("")] [assembly: AssemblyCompany("")] [assembly: AssemblyProduct("RangerBelt")] [assembly: AssemblyCopyright("Copyright © 2026")] [assembly: AssemblyTrademark("")] [assembly: ComVisible(false)] [assembly: Guid("27e9e75d-fccb-47a0-8c33-d765f7d28ca5")] [assembly: AssemblyFileVersion("1.0.0.0")] [assembly: TargetFramework(".NETFramework,Version=v4.8", FrameworkDisplayName = ".NET Framework 4.8")] [assembly: AssemblyVersion("1.0.0.0")] namespace RangerBeltMod; [BepInPlugin("durinson.RangerBelt", "Ranger Belt", "1.0.0")] [BepInDependency(/*Could not decode attribute arguments.*/)] public class RangerBeltPlugin : BaseUnityPlugin { [HarmonyPatch(typeof(Trader), "GetAvailableItems")] public static class Trader_GetAvailableItems_Patch { private static void Postfix(Trader __instance, ref List<TradeItem> __result) { if (!((Object)(object)__instance == (Object)null) && ((Object)__instance).name.Contains("Hildir") && rangerTradeItem != null && !__result.Any((TradeItem x) => (Object)(object)x.m_prefab != (Object)null && ((Object)x.m_prefab).name == "RangerBelt")) { __result.Add(rangerTradeItem); Log.LogInfo((object)"Ranger Belt added to Hildir list."); } } } public const string ModGUID = "durinson.RangerBelt"; public const string ModName = "Ranger Belt"; public const string ModVersion = "1.0.0"; internal static ManualLogSource Log; internal static TradeItem rangerTradeItem; private AssetBundle rangerBundle; private void Awake() { //IL_007d: Unknown result type (might be due to invalid IL or missing references) //IL_0083: Expected O, but got Unknown Log = ((BaseUnityPlugin)this).Logger; string text = Path.Combine(Path.GetDirectoryName(((BaseUnityPlugin)this).Info.Location), "rangerbelt"); rangerBundle = AssetBundle.LoadFromFile(text); if ((Object)(object)rangerBundle == (Object)null) { Log.LogError((object)"Failed to load AssetBundle!"); return; } PrefabManager.OnVanillaPrefabsAvailable += AddRangerBelt; Log.LogInfo((object)"Ranger Belt loaded."); Harmony val = new Harmony("durinson.RangerBelt"); val.PatchAll(); } private void AddRangerBelt() { //IL_0158: Unknown result type (might be due to invalid IL or missing references) //IL_015d: Unknown result type (might be due to invalid IL or missing references) //IL_0169: Unknown result type (might be due to invalid IL or missing references) //IL_0177: Expected O, but got Unknown //IL_017b: Unknown result type (might be due to invalid IL or missing references) //IL_0182: Expected O, but got Unknown //IL_01ad: Unknown result type (might be due to invalid IL or missing references) //IL_01b2: Unknown result type (might be due to invalid IL or missing references) //IL_01ba: Unknown result type (might be due to invalid IL or missing references) //IL_01c5: Unknown result type (might be due to invalid IL or missing references) //IL_01cc: Unknown result type (might be due to invalid IL or missing references) //IL_01dc: Expected O, but got Unknown //IL_00e9: Unknown result type (might be due to invalid IL or missing references) //IL_00f0: Expected O, but got Unknown PrefabManager.OnVanillaPrefabsAvailable -= AddRangerBelt; GameObject val = rangerBundle.LoadAsset<GameObject>("BeltRanger"); if ((Object)(object)val == (Object)null) { Log.LogError((object)"Failed to load RangerBelt prefab from bundle!"); return; } GameObject prefab = PrefabManager.Instance.GetPrefab("BeltStrength"); Renderer val2 = PrefabManager.Instance.GetPrefab("BeltStrength").GetComponentsInChildren<Renderer>(true).First((Renderer r) => (Object)(object)((Component)r).GetComponent<ParticleSystemRenderer>() == (Object)null); Material sharedMaterial = val2.sharedMaterial; Texture2D val3 = rangerBundle.LoadAsset<Texture2D>("rangerbelt_d"); Renderer[] componentsInChildren = val.GetComponentsInChildren<Renderer>(true); foreach (Renderer val4 in componentsInChildren) { if ((Object)(object)((Component)val4).GetComponent<ParticleSystemRenderer>() != (Object)null) { continue; } Material[] materials = val4.materials; for (int j = 0; j < materials.Length; j++) { Material val5 = new Material(sharedMaterial); if ((Object)(object)val3 != (Object)null && val5.HasProperty("_MainTex")) { val5.SetTexture("_MainTex", (Texture)(object)val3); } materials[j] = val5; } val4.materials = materials; } ItemConfig val6 = new ItemConfig { Name = "Ranger Belt", Description = "A dwarven-crafted belt made for those who roam far and move unseen." }; CustomItem val7 = new CustomItem(val, true, val6); ItemDrop component = val7.ItemPrefab.GetComponent<ItemDrop>(); ItemManager.Instance.AddItem(val7); Log.LogInfo((object)"Ranger Belt added."); rangerTradeItem = new TradeItem { m_prefab = component, m_price = 1500, m_stack = 1, m_requiredGlobalKey = "Hildir" }; } }