Decompiled source of TwoHandedMod v1.0.0

BepInEx/plugins/TwoHandedMod.dll

Decompiled 6 months 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 GameNetcodeStuff;
using HarmonyLib;
using TwoHanded.Patches;
using UnityEngine;

[assembly: CompilationRelaxations(8)]
[assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)]
[assembly: Debuggable(DebuggableAttribute.DebuggingModes.Default | DebuggableAttribute.DebuggingModes.DisableOptimizations | DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints | DebuggableAttribute.DebuggingModes.EnableEditAndContinue)]
[assembly: AssemblyTitle("TwoHanded")]
[assembly: AssemblyDescription("")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("")]
[assembly: AssemblyProduct("TwoHanded")]
[assembly: AssemblyCopyright("Copyright ©  2023")]
[assembly: AssemblyTrademark("")]
[assembly: ComVisible(false)]
[assembly: Guid("4b54e22a-0014-42b8-b3c4-ee3db577c8bf")]
[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 TwoHanded
{
	[BepInPlugin("Acromata.TwoHanded", "Two Handed Mod", "1.0.0")]
	public class TwoHandedBase : BaseUnityPlugin
	{
		private const string modGUID = "Acromata.TwoHanded";

		private const string modName = "Two Handed Mod";

		private const string modVersion = "1.0.0";

		private readonly Harmony harmony = new Harmony("Acromata.TwoHanded");

		private static TwoHandedBase Instance;

		internal ManualLogSource logSource;

		private void Awake()
		{
			if ((Object)(object)Instance == (Object)null)
			{
				Instance = this;
			}
			logSource = Logger.CreateLogSource("Acromata.TwoHanded");
			harmony.PatchAll(typeof(TwoHandedBase));
			harmony.PatchAll(typeof(PlayerControllerBPatch));
		}
	}
}
namespace TwoHanded.Patches
{
	[HarmonyPatch(typeof(PlayerControllerB))]
	internal class PlayerControllerBPatch
	{
		[HarmonyPatch("BeginGrabObject")]
		[HarmonyPostfix]
		private static void UpdateBeginGrabObject(ref bool ___twoHanded)
		{
			___twoHanded = false;
		}

		[HarmonyPatch("GrabObjectClientRpc")]
		[HarmonyPostfix]
		private static void UpdateGrabObjectClientRpc(ref bool ___twoHanded)
		{
			___twoHanded = false;
		}

		[HarmonyPatch("SwitchToItemSlot")]
		[HarmonyPostfix]
		private static void UpdateSwitchToItemSlot(ref bool ___twoHanded)
		{
			___twoHanded = false;
		}
	}
}