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 AutoRepair v0.0.1
AutoRepair.dll
Decompiled 14 hours agousing System; using System.Diagnostics; using System.Reflection; using System.Runtime.CompilerServices; using System.Runtime.InteropServices; using System.Runtime.Versioning; using BepInEx; using BepInEx.Logging; using HarmonyLib; 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("AutoRepair")] [assembly: AssemblyDescription("")] [assembly: AssemblyConfiguration("")] [assembly: AssemblyCompany("")] [assembly: AssemblyProduct("AutoRepair")] [assembly: AssemblyCopyright("Copyright © 2026")] [assembly: AssemblyTrademark("")] [assembly: ComVisible(false)] [assembly: Guid("7f98786e-0bb2-4664-9720-b8b80c418c49")] [assembly: AssemblyFileVersion("1.0.0.0")] [assembly: TargetFramework(".NETFramework,Version=v4.8", FrameworkDisplayName = ".NET Framework 4.8")] [assembly: AssemblyVersion("1.0.0.0")] namespace AutoRepair; [BepInPlugin("mtsukn.AutoRepair", "AutoRepair", "0.0.1")] public class Main : BaseUnityPlugin { [HarmonyPatch(typeof(CraftingStation), "Interact")] public static class CraftingPatch { public static void Postfix(CraftingStation __instance, Humanoid user, bool repeat, bool alt) { int num = 0; InventoryGui instance = InventoryGui.instance; MethodInfo methodInfo = AccessTools.Method(typeof(InventoryGui), "HaveRepairableItems", (Type[])null, (Type[])null); while ((bool)methodInfo.Invoke(instance, null)) { num++; AccessTools.Method(typeof(InventoryGui), "RepairOneItem", (Type[])null, (Type[])null).Invoke(instance, null); } if (num > 0) { ((Character)Player.m_localPlayer).Message((MessageType)2, " ", 0, (Sprite)null, false); logger.LogInfo((object)$"[AutoRepair] Repaired {num} objects!\n"); } } } private const string pluginGUID = "mtsukn.AutoRepair"; private const string pluginName = "AutoRepair"; private const string pluginVersion = "0.0.1"; private readonly Harmony HarmonyInstance = new Harmony("mtsukn.AutoRepair"); public static ManualLogSource logger = Logger.CreateLogSource("AutoRepair"); public void Awake() { Assembly executingAssembly = Assembly.GetExecutingAssembly(); HarmonyInstance.PatchAll(executingAssembly); } }