Decompiled source of LongStackInserters v1.0.1

plugins/LongStackInserters.dll

Decompiled a year 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 HarmonyLib;
using LongStackInserters.Patches;

[assembly: CompilationRelaxations(8)]
[assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)]
[assembly: Debuggable(DebuggableAttribute.DebuggingModes.Default | DebuggableAttribute.DebuggingModes.DisableOptimizations | DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints | DebuggableAttribute.DebuggingModes.EnableEditAndContinue)]
[assembly: AssemblyTitle("LongStackInserters")]
[assembly: AssemblyDescription("")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("")]
[assembly: AssemblyProduct("LongStackInserters")]
[assembly: AssemblyCopyright("Copyright ©  2023")]
[assembly: AssemblyTrademark("")]
[assembly: ComVisible(false)]
[assembly: Guid("93eab5b6-4d35-4190-9259-a723797494c3")]
[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 LongStackInserters
{
	[BepInPlugin("net.hypexmon5ter.LongStackInserters", "LongStackInserters", "1.0.0")]
	public class LongStackInsertersPlugin : BaseUnityPlugin
	{
		private const string MyGUID = "net.hypexmon5ter.LongStackInserters";

		private const string PluginName = "LongStackInserters";

		private const string VersionString = "1.0.0";

		private static readonly Harmony Harmony = new Harmony("net.hypexmon5ter.LongStackInserters");

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

		private void Awake()
		{
			((BaseUnityPlugin)this).Logger.LogInfo((object)"PluginName: LongStackInserters, VersionString: 1.0.0 is loading...");
			Harmony.PatchAll();
			((BaseUnityPlugin)this).Logger.LogInfo((object)"PluginName: LongStackInserters, VersionString: 1.0.0 is loaded.");
			Log = ((BaseUnityPlugin)this).Logger;
			Harmony.CreateAndPatchAll(typeof(InserterDefinitionPatch), (string)null);
		}
	}
}
namespace LongStackInserters.Patches
{
	public class InserterDefinitionPatch
	{
		private static bool stackInserterUnlocked;

		[HarmonyPatch(typeof(InserterDefinition), "InitInstance")]
		[HarmonyPostfix]
		private static void setToStack(ref InserterInstance newInstance)
		{
			if (newInstance.armLength >= 2)
			{
				newInstance.isStack = true;
			}
		}
	}
}