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 Lareins AutoRepair v5.0.3
Lareins_AutoRepair.dll
Decompiled 12 hours agousing System; using System.Collections.Generic; using System.Diagnostics; using System.Reflection; using System.Runtime.CompilerServices; using System.Runtime.Versioning; using BepInEx; using BepInEx.Configuration; using HarmonyLib; using Lareins_Core; using UnityEngine; [assembly: CompilationRelaxations(8)] [assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)] [assembly: Debuggable(DebuggableAttribute.DebuggingModes.Default | DebuggableAttribute.DebuggingModes.DisableOptimizations | DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints | DebuggableAttribute.DebuggingModes.EnableEditAndContinue)] [assembly: TargetFramework(".NETFramework,Version=v4.7.2", FrameworkDisplayName = ".NET Framework 4.7.2")] [assembly: AssemblyVersion("0.0.0.0")] namespace Lareins_AutoRepair; [BepInPlugin("com.lareins.autorepair", "Lareins_AutoRepair", "5.0.0")] [BepInDependency(/*Could not decode attribute arguments.*/)] public class AutoRepairPlugin : BaseUnityPlugin { public const string ModGUID = "com.lareins.autorepair"; public const string ModName = "Lareins_AutoRepair"; public const string ModVersion = "5.0.0"; public static ConfigEntry<bool> ModAktif; public static ConfigEntry<bool> BildirimGoster; private void Awake() { //IL_007a: Unknown result type (might be due to invalid IL or missing references) ModAktif = ((BaseUnityPlugin)this).Config.Bind<bool>("Genel", "ModAktif", true, "Tezgah veya ocak acildiginda tum esyalari otomatik tamir eder"); BildirimGoster = ((BaseUnityPlugin)this).Config.Bind<bool>("Genel", "BildirimGoster", true, "Tamir yapildiginda ekranda bilgi mesaji gosterir"); CorePlugin.AyarEkle("Otomatik Tamir", "Mod Aktif", "Tezgah veya ocak acildiginda esyalari otomatik tamir eder.", ModAktif); CorePlugin.AyarEkle("Otomatik Tamir", "Tamir Bildirimi", "Kac esyanin tamir edildigini sol ustte gosterir.", BildirimGoster); new Harmony("com.lareins.autorepair").PatchAll(typeof(AutoRepairPlugin)); } [HarmonyPatch(typeof(InventoryGui), "Show")] [HarmonyPostfix] private static void TezgahAcilincaTamirEt(InventoryGui __instance) { //IL_012b: Unknown result type (might be due to invalid IL or missing references) //IL_0130: Unknown result type (might be due to invalid IL or missing references) //IL_013e: Unknown result type (might be due to invalid IL or missing references) //IL_0144: Unknown result type (might be due to invalid IL or missing references) if (!ModAktif.Value || (Object)(object)Player.m_localPlayer == (Object)null) { return; } Player localPlayer = Player.m_localPlayer; CraftingStation currentCraftingStation = localPlayer.GetCurrentCraftingStation(); if ((Object)(object)currentCraftingStation == (Object)null) { return; } Inventory inventory = ((Humanoid)localPlayer).GetInventory(); if (inventory == null) { return; } MethodInfo methodInfo = AccessTools.Method(typeof(InventoryGui), "CanRepair", (Type[])null, (Type[])null); if (methodInfo == null) { return; } int num = 0; List<ItemData> allItems = inventory.GetAllItems(); for (int i = 0; i < allItems.Count; i++) { ItemData val = allItems[i]; if (val != null && !(val.m_durability >= val.GetMaxDurability()) && (bool)methodInfo.Invoke(__instance, new object[1] { val })) { val.m_durability = val.GetMaxDurability(); num++; } } if (num > 0) { EffectList repairItemDoneEffects = currentCraftingStation.m_repairItemDoneEffects; if (repairItemDoneEffects != null) { repairItemDoneEffects.Create(((Component)currentCraftingStation).transform.position, Quaternion.identity, (Transform)null, 1f, -1, default(ZDOID)); } if (BildirimGoster.Value) { ((Character)localPlayer).Message((MessageType)1, $"Otomatik Tamir: {num} esya onarildi!", 0, (Sprite)null, false); } } } }