Decompiled source of CheapMechanicalComponents v2.0.0

plugins/CheapMechComps/CheapMechComps.dll

Decompiled 2 months ago
using System;
using System.Collections.Generic;
using System.Diagnostics;
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;
using System.Runtime.Versioning;
using BepInEx;
using BepInEx.Logging;
using EquinoxsModUtils;
using HarmonyLib;

[assembly: CompilationRelaxations(8)]
[assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)]
[assembly: Debuggable(DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints)]
[assembly: AssemblyTitle("CheapMechComps")]
[assembly: AssemblyDescription("")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("")]
[assembly: AssemblyProduct("CheapMechComps")]
[assembly: AssemblyCopyright("Copyright ©  2023")]
[assembly: AssemblyTrademark("")]
[assembly: ComVisible(false)]
[assembly: Guid("78e38407-4662-42b6-9466-d03a19ce56c6")]
[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")]
namespace CheaperMechanicalComponents;

[BepInPlugin("com.equinox.CheapMechComps", "CheaperMechanicalComponents", "2.0.0")]
public class CheapMechCompsPlugin : BaseUnityPlugin
{
	private const string MyGUID = "com.equinox.CheapMechComps";

	private const string PluginName = "CheaperMechanicalComponents";

	private const string VersionString = "2.0.0";

	private static readonly Harmony Harmony = new Harmony("com.equinox.CheapMechComps");

	public static ManualLogSource Log = new ManualLogSource("CheaperMechanicalComponents");

	private void Awake()
	{
		((BaseUnityPlugin)this).Logger.LogInfo((object)"PluginName: CheaperMechanicalComponents, VersionString: 2.0.0 is loading...");
		Harmony.PatchAll();
		ModUtils.GameDefinesLoaded += OnGameDefinesLoaded;
		((BaseUnityPlugin)this).Logger.LogInfo((object)"PluginName: CheaperMechanicalComponents, VersionString: 2.0.0 is loaded.");
		Log = ((BaseUnityPlugin)this).Logger;
	}

	private void OnGameDefinesLoaded(object sender, EventArgs e)
	{
		ResourceInfo resourceInfoByName = ModUtils.GetResourceInfoByName("Mechanical Components", false);
		ResourceInfo resourceInfoByName2 = ModUtils.GetResourceInfoByName("Copper Ingot", false);
		ResourceInfo resourceInfoByName3 = ModUtils.GetResourceInfoByName("Iron Ingot", false);
		List<int> obj = new List<int>
		{
			((UniqueIdScriptableObject)resourceInfoByName2).uniqueId,
			((UniqueIdScriptableObject)resourceInfoByName3).uniqueId
		};
		List<int> list = new List<int> { ((UniqueIdScriptableObject)resourceInfoByName).uniqueId };
		SchematicsRecipeData obj2 = ModUtils.TryFindRecipe(obj, list, false);
		obj2.ingQuantities[1] = 2;
		obj2.outputQuantities[0] *= 2;
	}
}