Decompiled source of Headplant v0.0.1

jasonofthestorm-Headplant/Headplant.dll

Decompiled a year ago
using System;
using System.Diagnostics;
using System.IO;
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.Versioning;
using System.Security;
using System.Security.Permissions;
using BepInEx;
using HarmonyLib;
using Microsoft.CodeAnalysis;
using Reptile;
using UnityEngine;

[assembly: CompilationRelaxations(8)]
[assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)]
[assembly: Debuggable(DebuggableAttribute.DebuggingModes.Default | DebuggableAttribute.DebuggingModes.DisableOptimizations | DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints | DebuggableAttribute.DebuggingModes.EnableEditAndContinue)]
[assembly: TargetFramework(".NETFramework,Version=v4.6", FrameworkDisplayName = ".NET Framework 4.6")]
[assembly: AssemblyCompany("Headplant")]
[assembly: AssemblyConfiguration("Debug")]
[assembly: AssemblyFileVersion("0.0.1.0")]
[assembly: AssemblyInformationalVersion("0.0.1")]
[assembly: AssemblyProduct("Headplant")]
[assembly: AssemblyTitle("Headplant")]
[assembly: SecurityPermission(SecurityAction.RequestMinimum, SkipVerification = true)]
[assembly: AssemblyVersion("0.0.1.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 Headplant
{
	[BepInPlugin("Headplant", "Headplant", "0.0.1")]
	public class Plugin : BaseUnityPlugin
	{
		public static GameObject headplant;

		private void Awake()
		{
			//IL_0006: Unknown result type (might be due to invalid IL or missing references)
			//IL_000c: Expected O, but got Unknown
			Harmony val = new Harmony("io.jasonofthestorm.Headplant");
			val.PatchAll();
			if (File.Exists(Path.Combine(Paths.PluginPath, "jasonofthestorm-Headplant", "headplant")))
			{
				AssetBundle val2 = AssetBundle.LoadFromFile(Path.Combine(Paths.PluginPath, "jasonofthestorm-Headplant", "headplant"));
				headplant = val2.LoadAsset<GameObject>("Headplant");
				((BaseUnityPlugin)this).Logger.LogInfo((object)"Plugin Headplant mod has been loaded.");
			}
			else
			{
				((BaseUnityPlugin)this).Logger.LogError((object)"Plugin Headplant mod couldn't find the headplant file. It comes with the mod!! Did you move it out of the mod folder or something?");
			}
		}
	}
	[HarmonyPatch(typeof(CharacterVisual), "Init")]
	public class CharacterInitPatch
	{
		public static void Postfix(Characters character, RuntimeAnimatorController animatorController, bool IK, float setGroundAngleLimit, ref CharacterVisual __instance)
		{
			Object.Instantiate<GameObject>(Plugin.headplant, __instance.head);
		}
	}
	public static class PluginInfo
	{
		public const string PLUGIN_GUID = "Headplant";

		public const string PLUGIN_NAME = "Headplant";

		public const string PLUGIN_VERSION = "0.0.1";
	}
}