Decompiled source of MineMineMineMode v1.0.0

HoarderBugMine.dll

Decompiled 2 years 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.Default | DebuggableAttribute.DebuggingModes.DisableOptimizations | DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints | DebuggableAttribute.DebuggingModes.EnableEditAndContinue)]
[assembly: TargetFramework(".NETStandard,Version=v2.1", FrameworkDisplayName = ".NET Standard 2.1")]
[assembly: AssemblyCompany("HoarderBugMine")]
[assembly: AssemblyConfiguration("Debug")]
[assembly: AssemblyDescription("A plugin for BepInEx that replaces the standard sound of hoarding bugs with \"mine\"")]
[assembly: AssemblyFileVersion("1.0.0.0")]
[assembly: AssemblyInformationalVersion("1.0.0+43206f0475d7dae18e393eaa115cfd192399712f")]
[assembly: AssemblyProduct("HoarderBugMine")]
[assembly: AssemblyTitle("HoarderBugMine")]
[assembly: SecurityPermission(SecurityAction.RequestMinimum, SkipVerification = true)]
[assembly: AssemblyVersion("1.0.0.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.Class | AttributeTargets.Property | AttributeTargets.Field | AttributeTargets.Event | AttributeTargets.Parameter | AttributeTargets.ReturnValue | AttributeTargets.GenericParameter, AllowMultiple = false, Inherited = false)]
	internal sealed class NullableAttribute : Attribute
	{
		public readonly byte[] NullableFlags;

		public NullableAttribute(byte P_0)
		{
			NullableFlags = new byte[1] { P_0 };
		}

		public NullableAttribute(byte[] P_0)
		{
			NullableFlags = P_0;
		}
	}
	[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 HoarderBugMine
{
	[BepInPlugin("HoarderBugMine", "HoarderBugMine", "1.0.0")]
	public class MineMineMineMod : BaseUnityPlugin
	{
		[HarmonyPatch(typeof(HoarderBugAI))]
		internal class HoarderBugPatch
		{
			[HarmonyPatch("Start")]
			[HarmonyPostfix]
			public static void hoarderBugAudioPatch(ref AudioClip[] ___chitterSFX)
			{
				AudioClip[] newSFX = MineMineMineMod.newSFX;
				___chitterSFX = newSFX;
			}
		}

		private readonly Harmony _harmony = new Harmony("HoarderBugMine");

		private static MineMineMineMod? _instance;

		internal ManualLogSource? mls;

		internal static AudioClip[] newSFX;

		private void Awake()
		{
			if ((Object)(object)_instance == (Object)null)
			{
				_instance = this;
			}
			mls = Logger.CreateLogSource("HoarderBugMine mod");
			mls.LogInfo((object)"Plugin HoarderBugMine is loading!");
			string location = ((BaseUnityPlugin)_instance).Info.Location;
			string text = location.TrimEnd("HoarderBugMine.dll".ToCharArray());
			string text2 = text + "minemine";
			AssetBundle val = AssetBundle.LoadFromFile(text2);
			if ((Object)(object)val == (Object)null)
			{
				mls.LogError((object)"Failed to load asset bundle");
				return;
			}
			newSFX = val.LoadAssetWithSubAssets<AudioClip>("assets/mineMineMine.mp3");
			_harmony.PatchAll(typeof(HoarderBugPatch));
			mls.LogInfo((object)"HoarderBugMine is now loaded");
		}
	}
	public static class PluginInfo
	{
		public const string PLUGIN_GUID = "HoarderBugMine";

		public const string PLUGIN_NAME = "HoarderBugMine";

		public const string PLUGIN_VERSION = "1.0.0";
	}
}