Decompiled source of FixItemSpawn v1.0.0

CW-FixItemSpawn.dll

Decompiled 7 months ago
using System;
using System.Diagnostics;
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.Versioning;
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 = "")]
[assembly: AssemblyCompany("CW-FixItemSpawn")]
[assembly: AssemblyConfiguration("Debug")]
[assembly: AssemblyFileVersion("1.0.0.0")]
[assembly: AssemblyInformationalVersion("1.0.0")]
[assembly: AssemblyProduct("CW-FixItemSpawn")]
[assembly: AssemblyTitle("CW-FixItemSpawn")]
[assembly: AssemblyVersion("1.0.0.0")]
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.Class | AttributeTargets.Struct | AttributeTargets.Method | AttributeTargets.Interface | AttributeTargets.Delegate, AllowMultiple = false, Inherited = false)]
	internal sealed class NullableContextAttribute : Attribute
	{
		public readonly byte Flag;

		public NullableContextAttribute(byte P_0)
		{
			Flag = P_0;
		}
	}
}
namespace CW_FixItemSpawn
{
	[ContentWarningPlugin("Electric131.FixItemSpawn", "1.0.0", false)]
	[BepInPlugin("Electric131.FixItemSpawn", "FixItemSpawn", "1.0.0")]
	public class Plugin : BaseUnityPlugin
	{
		public const string ModGUID = "Electric131.FixItemSpawn";

		public const string ModName = "FixItemSpawn";

		public const string ModVersion = "1.0.0";

		public static ManualLogSource? logger;

		private void Awake()
		{
			logger = ((BaseUnityPlugin)this).Logger;
			logger.LogInfo((object)"Plugin Electric131.FixItemSpawn loaded!");
			Harmony.CreateAndPatchAll(typeof(Plugin), (string)null);
			logger.LogInfo((object)"Patches created successfully");
		}

		[HarmonyPatch(typeof(PersistentObjectsHolder), "SpawnPersistentDiveBellObjects")]
		[HarmonyPrefix]
		public static void UpdatePatch(ref UI_Views __instance)
		{
			//IL_001c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0021: Unknown result type (might be due to invalid IL or missing references)
			//IL_0032: Unknown result type (might be due to invalid IL or missing references)
			//IL_0037: Unknown result type (might be due to invalid IL or missing references)
			//IL_0048: Unknown result type (might be due to invalid IL or missing references)
			//IL_004d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0050: Unknown result type (might be due to invalid IL or missing references)
			//IL_005d: Unknown result type (might be due to invalid IL or missing references)
			//IL_006e: Unknown result type (might be due to invalid IL or missing references)
			//IL_006f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0075: Unknown result type (might be due to invalid IL or missing references)
			DivingBell val = Object.FindObjectOfType<DivingBell>();
			if (!((Object)(object)val == (Object)null))
			{
				Vector3 position = val.itemSpawns.position;
				Vector3 position2 = ((Component)val).transform.Find("Tools/TravelButton").position;
				Vector3 position3 = ((Component)val).transform.Find("Mesh/InLight").position;
				position2.y = position.y;
				position3.y = position.y;
				val.itemSpawns.position = Vector3.Lerp(position3, position2, 0.5f);
			}
		}
	}
}