using System.Diagnostics;
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;
using System.Runtime.Versioning;
using BepInEx;
using BepInEx.Configuration;
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("DSPModRapidezEnCrafting")]
[assembly: AssemblyDescription("")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("")]
[assembly: AssemblyProduct("DSPModRapidezEnCrafting")]
[assembly: AssemblyCopyright("Copyright © 2025")]
[assembly: AssemblyTrademark("")]
[assembly: ComVisible(false)]
[assembly: Guid("be8ddbd3-578a-464f-9ea5-a51ffec925eb")]
[assembly: AssemblyFileVersion("1.0.0.0")]
[assembly: TargetFramework(".NETFramework,Version=v4.7.2", FrameworkDisplayName = ".NET Framework 4.7.2")]
[assembly: AssemblyVersion("1.0.0.0")]
[BepInPlugin("com.HMIMH.HMIMHFasterCraftingSpeed", "HMIMHFasterCraftingSpeed", "1.0.0")]
public class MechaForgeMod : BaseUnityPlugin
{
public static ConfigEntry<float> SpeedMultiplier;
private void Awake()
{
SpeedMultiplier = ((BaseUnityPlugin)this).Config.Bind<float>("General", "SpeedMultiplier", 10f, "Multiplier for crafting speed (1.0 = normal speed)");
Harmony.CreateAndPatchAll(typeof(MechaForgePatch), (string)null);
Debug.Log((object)"[Faster crafting speed] Mod loaded successfully.");
}
}
[HarmonyPatch(typeof(MechaForge), "GameTick")]
public class MechaForgePatch
{
private static void Postfix(MechaForge __instance, long time, float deltaTime)
{
if (__instance.tasks != null && __instance.tasks.Count > 0)
{
ForgeTask val = __instance.tasks[0];
if (val.tick < val.tickSpend)
{
val.tick = (int)((float)val.tick * MechaForgeMod.SpeedMultiplier.Value);
}
}
}
}