Decompiled source of NoFurnitureMovement v1.0.0

plugins/NoFurnitureMovement.dll

Decompiled 2 years ago
using System;
using System.Collections.Generic;
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 BepInEx.Configuration;
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.0", FrameworkDisplayName = ".NET Standard 2.0")]
[assembly: AssemblyCompany("NoFurnitureMovement")]
[assembly: AssemblyConfiguration("Debug")]
[assembly: AssemblyFileVersion("1.0.0")]
[assembly: AssemblyInformationalVersion("1.0.0")]
[assembly: AssemblyProduct("NoFurnitureMovement")]
[assembly: AssemblyTitle("NoFurnitureMovement")]
[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.Module, AllowMultiple = false, Inherited = false)]
	internal sealed class RefSafetyRulesAttribute : Attribute
	{
		public readonly int Version;

		public RefSafetyRulesAttribute(int P_0)
		{
			Version = P_0;
		}
	}
}
namespace NoFurnitureMovement
{
	[BepInPlugin("GeeEm.WrestlingEmpire.NoFurnitureMovement", "NoFurnitureMovement", "1.0.0")]
	[HarmonyPatch]
	public class Plugin : BaseUnityPlugin
	{
		public const string PluginGuid = "GeeEm.WrestlingEmpire.NoFurnitureMovement";

		public const string PluginName = "NoFurnitureMovement";

		public const string PluginVer = "1.0.0";

		internal static ManualLogSource Log;

		internal static readonly Harmony Harmony = new Harmony("GeeEm.WrestlingEmpire.NoFurnitureMovement");

		internal static string PluginPath;

		public static List<int> MoveableFurniture = new List<int>();

		public static ConfigEntry<string> MoveableFurnitureConfig;

		private void Awake()
		{
			Log = ((BaseUnityPlugin)this).Logger;
			PluginPath = Path.GetDirectoryName(((BaseUnityPlugin)this).Info.Location);
			MoveableFurnitureConfig = ((BaseUnityPlugin)this).Config.Bind<string>("General", "Moveable Furniture IDs", "2 7 8 9 10 14 16 18 33", "Furniture IDs that will be ignored by this mod and will get moved on contact");
			string[] array = MoveableFurnitureConfig.Value.Split(new char[2] { ' ', '\t' }, StringSplitOptions.RemoveEmptyEntries);
			string[] array2 = array;
			foreach (string s in array2)
			{
				MoveableFurniture.Add(int.Parse(s));
			}
		}

		private void OnEnable()
		{
			Harmony.PatchAll();
			((BaseUnityPlugin)this).Logger.LogInfo((object)"Loaded NoFurnitureMovement!");
		}

		private void OnDisable()
		{
			Harmony.UnpatchSelf();
			((BaseUnityPlugin)this).Logger.LogInfo((object)"Unloaded NoFurnitureMovement!");
		}

		[HarmonyPatch(typeof(GGKBLABCJFN), "IPDDNOLDFLE")]
		[HarmonyPrefix]
		private static bool GGKBLABCJFN_IPDDNOLDFLEPrefix(GGKBLABCJFN __instance)
		{
			if (MoveableFurniture.Contains(__instance.BPJFLJPKKJK))
			{
				return true;
			}
			return false;
		}
	}
}