Decompiled source of SlimeTamingFix v1.0.2

SlimeTamingFix.dll

Decompiled a year 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;

[assembly: CompilationRelaxations(8)]
[assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)]
[assembly: Debuggable(DebuggableAttribute.DebuggingModes.Default | DebuggableAttribute.DebuggingModes.DisableOptimizations | DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints | DebuggableAttribute.DebuggingModes.EnableEditAndContinue)]
[assembly: TargetFramework(".NETStandard,Version=v2.1", FrameworkDisplayName = ".NET Standard 2.1")]
[assembly: AssemblyCompany("EliteMasterEric")]
[assembly: AssemblyConfiguration("Debug")]
[assembly: AssemblyDescription("Fixes a bug that made Hygroderes unable to be tamed with Boomboxes.")]
[assembly: AssemblyFileVersion("1.0.2.0")]
[assembly: AssemblyInformationalVersion("1.0.2+38f01b21fff41249851eaa3d5a7686cfd554bb79")]
[assembly: AssemblyProduct("SlimeTamingFix")]
[assembly: AssemblyTitle("SlimeTamingFix")]
[assembly: SecurityPermission(SecurityAction.RequestMinimum, SkipVerification = true)]
[assembly: AssemblyVersion("1.0.2.0")]
[module: UnverifiableCode]
[module: RefSafetyRules(11)]
namespace Microsoft.CodeAnalysis
{
	[CompilerGenerated]
	[Microsoft.CodeAnalysis.Embedded]
	internal sealed class EmbeddedAttribute : Attribute
	{
	}
}
namespace System.Runtime.CompilerServices
{
	[CompilerGenerated]
	[Microsoft.CodeAnalysis.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 SlimeTamingFix
{
	public static class PluginInfo
	{
		public const string PLUGIN_ID = "SlimeTamingFix";

		public const string PLUGIN_NAME = "SlimeTamingFix";

		public const string PLUGIN_VERSION = "1.0.2";

		public const string PLUGIN_GUID = "com.elitemastereric.slimetamingfix";
	}
	[BepInPlugin("com.elitemastereric.slimetamingfix", "SlimeTamingFix", "1.0.2")]
	public class Plugin : BaseUnityPlugin
	{
		public ManualLogSource PluginLogger;

		public static Plugin Instance { get; private set; }

		private void Awake()
		{
			//IL_0019: Unknown result type (might be due to invalid IL or missing references)
			//IL_001f: Expected O, but got Unknown
			Instance = this;
			PluginLogger = ((BaseUnityPlugin)this).Logger;
			Harmony val = new Harmony("com.elitemastereric.slimetamingfix");
			val.PatchAll();
			PluginLogger.LogInfo((object)"Plugin SlimeTamingFix (com.elitemastereric.slimetamingfix) is loaded!");
		}
	}
}
namespace SlimeTamingFix.Patch
{
	[HarmonyPatch(typeof(BlobAI))]
	[HarmonyPatch("OnCollideWithPlayer")]
	internal class BlobAIOnCollideWithPlayerPatch
	{
		public static bool Prefix(BlobAI __instance)
		{
			float value = Traverse.Create((object)__instance).Field("tamedTimer").GetValue<float>();
			float value2 = Traverse.Create((object)__instance).Field("angeredTimer").GetValue<float>();
			if (value > 0f && value2 <= 0f)
			{
				return false;
			}
			return true;
		}
	}
}