Decompiled source of KeepInventory v1.0.0

KeepInventory.dll

Decompiled 2 days ago
using System.Diagnostics;
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.Versioning;
using System.Security;
using System.Security.Permissions;
using BepInEx;
using BepInEx.Core.Logging.Interpolation;
using BepInEx.Logging;
using BepInEx.Unity.IL2CPP;
using HarmonyLib;
using ProjectM.Gameplay.Systems;

[assembly: CompilationRelaxations(8)]
[assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)]
[assembly: Debuggable(/*Could not decode attribute arguments.*/)]
[assembly: TargetFramework(".NETCoreApp,Version=v8.0", FrameworkDisplayName = ".NET 8.0")]
[assembly: AssemblyCompany("KeepInventory")]
[assembly: AssemblyConfiguration("Debug")]
[assembly: AssemblyDescription("Scarlet Template")]
[assembly: AssemblyFileVersion("1.0.0.0")]
[assembly: AssemblyInformationalVersion("1.0.0")]
[assembly: AssemblyProduct("KeepInventory")]
[assembly: AssemblyTitle("KeepInventory")]
[assembly: SecurityPermission(8, SkipVerification = true)]
[assembly: AssemblyVersion("1.0.0.0")]
[module: UnverifiableCode]
[module: RefSafetyRules(11)]
namespace KeepInventory;

[BepInPlugin("KeepInventory", "KeepInventory", "1.0.0")]
public class Plugin : BasePlugin
{
	private static Harmony _harmony;

	public static Harmony Harmony => _harmony;

	[field: CompilerGenerated]
	[field: DebuggerBrowsable(/*Could not decode attribute arguments.*/)]
	public static Plugin Instance
	{
		[CompilerGenerated]
		get;
		[CompilerGenerated]
		private set;
	}

	public override void Load()
	{
		//IL_000d: Unknown result type (might be due to invalid IL or missing references)
		//IL_0013: Expected O, but got Unknown
		//IL_005f: Unknown result type (might be due to invalid IL or missing references)
		//IL_0069: Expected O, but got Unknown
		ManualLogSource log = ((BasePlugin)this).Log;
		bool flag = default(bool);
		BepInExInfoLogInterpolatedStringHandler val = new BepInExInfoLogInterpolatedStringHandler(27, 2, ref flag);
		if (flag)
		{
			((BepInExLogInterpolatedStringHandler)val).AppendLiteral("Plugin ");
			((BepInExLogInterpolatedStringHandler)val).AppendFormatted<string>("KeepInventory");
			((BepInExLogInterpolatedStringHandler)val).AppendLiteral(" version ");
			((BepInExLogInterpolatedStringHandler)val).AppendFormatted<string>("1.0.0");
			((BepInExLogInterpolatedStringHandler)val).AppendLiteral(" is loaded!");
		}
		log.LogInfo(val);
		_harmony = new Harmony("KeepInventory");
		_harmony.PatchAll(Assembly.GetExecutingAssembly());
	}

	public override bool Unload()
	{
		Harmony harmony = _harmony;
		if (harmony != null)
		{
			harmony.UnpatchSelf();
		}
		return true;
	}

	[HarmonyPatch(typeof(OnDeathSystem), "DropInventoryOnDeath")]
	[HarmonyPrefix]
	public static bool Prefix()
	{
		return false;
	}
}
public static class MyPluginInfo
{
	public const string PLUGIN_GUID = "KeepInventory";

	public const string PLUGIN_NAME = "KeepInventory";

	public const string PLUGIN_VERSION = "1.0.0";
}