Decompiled source of AutoHop v1.0.1

BepInEx/plugins/AutoHop/AutoHop.dll

Decompiled an hour ago
using System;
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.Logging;
using HarmonyLib;
using Microsoft.CodeAnalysis;
using UnityEngine;

[assembly: CompilationRelaxations(8)]
[assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)]
[assembly: Debuggable(DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints)]
[assembly: TargetFramework(".NETFramework,Version=v4.7.2", FrameworkDisplayName = ".NET Framework 4.7.2")]
[assembly: AssemblyCompany("AutoHop")]
[assembly: AssemblyConfiguration("Release")]
[assembly: AssemblyFileVersion("1.0.0.0")]
[assembly: AssemblyInformationalVersion("1.0.0+dc6367376d4c2732a7913249681ade6546bc02cd")]
[assembly: AssemblyProduct("AutoHop")]
[assembly: AssemblyTitle("AutoHop")]
[assembly: SecurityPermission(SecurityAction.RequestMinimum, SkipVerification = true)]
[assembly: AssemblyVersion("1.0.0.0")]
[module: UnverifiableCode]
[module: RefSafetyRules(11)]
namespace Microsoft.CodeAnalysis
{
	[CompilerGenerated]
	[Embedded]
	internal sealed class EmbeddedAttribute : Attribute
	{
	}
}
namespace System.Runtime.CompilerServices
{
	[CompilerGenerated]
	[Embedded]
	[AttributeUsage(AttributeTargets.Module, AllowMultiple = false, Inherited = false)]
	internal sealed class RefSafetyRulesAttribute : Attribute
	{
		public readonly int Version;

		public RefSafetyRulesAttribute(int P_0)
		{
			Version = P_0;
		}
	}
}
namespace AutoHop
{
	public static class Pluginfo
	{
		public const string guid = "win.deathis.autohop";

		public const string name = "Auto Hop";

		public const string version = "1.0.0";
	}
	[BepInPlugin("win.deathis.autohop", "Auto Hop", "1.0.0")]
	public class Plugin : BaseUnityPlugin
	{
		private static ManualLogSource _logger;

		private static Harmony _harmony;

		private void Awake()
		{
			//IL_0010: Unknown result type (might be due to invalid IL or missing references)
			//IL_001a: Expected O, but got Unknown
			_logger = ((BaseUnityPlugin)this).Logger;
			_harmony = new Harmony("win.deathis.autohop");
			_harmony.PatchAll();
			_logger.LogInfo((object)"Plugin win.deathis.autohop has loaded");
		}

		private void OnDestroy()
		{
			Harmony harmony = _harmony;
			if (harmony != null)
			{
				harmony.UnpatchSelf();
			}
			_logger.LogInfo((object)"Plugin win.deathis.autohop has unloaded");
		}

		private void Update()
		{
			if (!((Object)(object)ENT_Player.GetPlayer() == (Object)null) && InputManager.GetButton("Jump").Pressed)
			{
				ENT_Player player = ENT_Player.GetPlayer();
				bool flag = player.IsCrouching() && (double)((GameEntity)player).curBuffs.GetBuff("addJumpBoost") > 0.0 && player.IsGrounded(true) && (double)player.GetLowestGripStrength() > 2.0;
				if ((player.IsGrounded(true) || player.IsHanging()) && !player.IsFlying() && !player.IsSwimming() && !player.noclip)
				{
					player.Jump(flag, 1f);
				}
			}
		}
	}
	public static class MyPluginInfo
	{
		public const string PLUGIN_GUID = "AutoHop";

		public const string PLUGIN_NAME = "AutoHop";

		public const string PLUGIN_VERSION = "1.0.0";
	}
}