Decompiled source of MachineHugging v2.0.0

plugins/MachineHugging/MachineHugging.dll

Decompiled 2 weeks ago
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.Default | DebuggableAttribute.DebuggingModes.DisableOptimizations | DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints | DebuggableAttribute.DebuggingModes.EnableEditAndContinue)]
[assembly: AssemblyTitle("MachineHugging")]
[assembly: AssemblyDescription("")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("")]
[assembly: AssemblyProduct("MachineHugging")]
[assembly: AssemblyCopyright("Copyright ©  2023")]
[assembly: AssemblyTrademark("")]
[assembly: ComVisible(false)]
[assembly: Guid("ea2aa2cf-1edf-417b-8554-4827c8be8528")]
[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 MachineHugging;

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

	private const string PluginName = "MachineHugging";

	private const string VersionString = "2.0.0";

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

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

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

	private void OnGameDefinesLoaded()
	{
		foreach (ResourceInfo resource in GameDefines.instance.resources)
		{
			BuilderInfo val = (BuilderInfo)(object)((resource is BuilderInfo) ? resource : null);
			if (val != null)
			{
				val.gridClearance = 0;
			}
		}
	}
}