Decompiled source of Insecticide v0.4.0

Mods/Insecticide.dll

Decompiled a month ago
using System;
using System.Diagnostics;
using System.Reflection;
using System.Resources;
using System.Runtime.CompilerServices;
using System.Runtime.Versioning;
using HarmonyLib;
using Il2CppCysharp.Threading.Tasks;
using Il2CppSLZ.Marrow.Forklift.Model;
using Il2CppSLZ.Marrow.Warehouse;
using Il2CppSystem.Collections.Generic;
using Insecticide;
using MelonLoader;
using Microsoft.CodeAnalysis;

[assembly: CompilationRelaxations(8)]
[assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)]
[assembly: Debuggable(DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints)]
[assembly: MelonInfo(typeof(Mod), "Insecticide", "0.4.0", "Millzy", null)]
[assembly: MelonGame("Stress Level Zero", "BONELAB")]
[assembly: MelonID("Millzy.Insecticide")]
[assembly: VerifyLoaderVersion("0.6.5")]
[assembly: HarmonyDontPatchAll]
[assembly: TargetFramework(".NETCoreApp,Version=v6.0", FrameworkDisplayName = ".NET 6.0")]
[assembly: AssemblyCompany("Insecticide")]
[assembly: AssemblyConfiguration("Release")]
[assembly: AssemblyCopyright("Copyright (c) 2024-present Frederick (Millzy) Mills")]
[assembly: AssemblyFileVersion("1.0.0.0")]
[assembly: AssemblyInformationalVersion("1.0.0+30c0479d59409cadce8ad26cb91ff4c5489b7a45")]
[assembly: AssemblyProduct("Insecticide")]
[assembly: AssemblyTitle("Insecticide")]
[assembly: NeutralResourcesLanguage("en")]
[assembly: AssemblyVersion("1.0.0.0")]
namespace Microsoft.CodeAnalysis
{
	[CompilerGenerated]
	[Microsoft.CodeAnalysis.Embedded]
	internal sealed class EmbeddedAttribute : Attribute
	{
	}
}
namespace System.Runtime.CompilerServices
{
	[CompilerGenerated]
	[Microsoft.CodeAnalysis.Embedded]
	[AttributeUsage(AttributeTargets.Class | AttributeTargets.Property | AttributeTargets.Field | AttributeTargets.Event | AttributeTargets.Parameter | AttributeTargets.ReturnValue | AttributeTargets.GenericParameter, AllowMultiple = false, Inherited = false)]
	internal sealed class NullableAttribute : Attribute
	{
		public readonly byte[] NullableFlags;

		public NullableAttribute(byte P_0)
		{
			NullableFlags = new byte[1] { P_0 };
		}

		public NullableAttribute(byte[] P_0)
		{
			NullableFlags = P_0;
		}
	}
	[CompilerGenerated]
	[Microsoft.CodeAnalysis.Embedded]
	[AttributeUsage(AttributeTargets.Class | AttributeTargets.Struct | AttributeTargets.Method | AttributeTargets.Interface | AttributeTargets.Delegate, AllowMultiple = false, Inherited = false)]
	internal sealed class NullableContextAttribute : Attribute
	{
		public readonly byte Flag;

		public NullableContextAttribute(byte P_0)
		{
			Flag = P_0;
		}
	}
}
namespace Insecticide
{
	public class Mod : MelonMod
	{
		public override void OnInitializeMelon()
		{
			((MelonBase)this).HarmonyInstance.PatchAll();
		}

		public override void OnDeinitializeMelon()
		{
			((MelonBase)this).HarmonyInstance.UnpatchSelf();
		}
	}
	internal static class BuildInfo
	{
		public const string Name = "Insecticide";

		public const string Author = "Millzy";

		public const string Version = "0.4.0";

		public const string Description = "A general bug fix mod for BONELAB.";

		public const string Id = "Millzy.Insecticide";
	}
}
namespace Insecticide.HarmonyPatches
{
	[HarmonyPatch(typeof(AssetWarehouse))]
	[HarmonyPatch("ReloadPallet")]
	internal static class AssetWarehouse_ReloadPallet
	{
		[HarmonyPrefix]
		private static bool Prefix(AssetWarehouse __instance, Barcode barcode)
		{
			Pallet val = default(Pallet);
			if (!__instance.TryGetScannable<Pallet>(barcode, ref val))
			{
				return false;
			}
			Dictionary<Barcode, PalletManifest> palletManifests = __instance.palletManifests;
			if (palletManifests == null)
			{
				return false;
			}
			PalletManifest val2 = default(PalletManifest);
			if (!palletManifests.TryGetValue(barcode, ref val2))
			{
				return false;
			}
			__instance.UnloadPallet(val);
			UniTaskExtensions.Forget<bool>(__instance.LoadPalletFromFolderAsync(val2._palletPath, true, (string)null, (ModListing)null));
			return false;
		}
	}
}