Decompiled source of Improved Scoop v0.1.4

ImprovedScoop.dll

Decompiled 2 weeks ago
using System;
using System.Collections.Generic;
using System.Diagnostics;
using System.Linq;
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.Versioning;
using System.Security;
using System.Security.Permissions;
using System.Text;
using BepInEx;
using BepInEx.Configuration;
using BepInEx.Logging;
using CG;
using CG.Game;
using CG.Objects;
using CG.Ship.Hull;
using CG.Ship.Modules;
using CG.Space;
using Gameplay.Carryables;
using Gameplay.Utilities;
using HarmonyLib;
using Microsoft.CodeAnalysis;
using Photon.Pun;
using ResourceAssets;
using UnityEngine;
using VoidManager;
using VoidManager.CustomGUI;
using VoidManager.MPModChecks;

[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.7.2", FrameworkDisplayName = ".NET Framework 4.7.2")]
[assembly: AssemblyCompany("ImprovedScoop")]
[assembly: AssemblyConfiguration("Debug")]
[assembly: AssemblyDescription("Template")]
[assembly: AssemblyFileVersion("0.1.4.0")]
[assembly: AssemblyInformationalVersion("0.1.4+6dc30b6c5952c10b2dcc2b8eed22ffca9e7a7703")]
[assembly: AssemblyProduct("ImprovedScoop")]
[assembly: AssemblyTitle("Increases Range, Radius, and Pull speed of gravity scoops. Ignores Mission Items. Inspired by Maverik's 'Better Scoop'. Session Mod.")]
[assembly: SecurityPermission(SecurityAction.RequestMinimum, SkipVerification = true)]
[assembly: AssemblyVersion("0.1.4.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 ImprovedScoop
{
	[BepInPlugin("18107.ImprovedScoop", "Improved Scoop", "0.1.4")]
	[BepInProcess("Void Crew.exe")]
	[BepInDependency(/*Could not decode attribute arguments.*/)]
	public class BepinPlugin : BaseUnityPlugin
	{
		internal static ManualLogSource Log;

		private void Awake()
		{
			Log = ((BaseUnityPlugin)this).Logger;
			Harmony.CreateAndPatchAll(Assembly.GetExecutingAssembly(), "18107.ImprovedScoop");
			ScoopConfig.BindConfigs(this);
			((BaseUnityPlugin)this).Logger.LogInfo((object)"Plugin 18107.ImprovedScoop is loaded!");
		}
	}
	[HarmonyPatch(typeof(CarryableAttractor))]
	internal class CarryableAttractorPatch
	{
		internal static List<GUIDUnion> dotNotAttract = ScoopConfig.HexToGUIDs(ScoopConfig.ItemBlacklist.Value);

		[HarmonyPrefix]
		[HarmonyPatch("Awake")]
		private static void Awake(CarryableAttractor __instance, ref float ____catchRadius, ref ModifiableFloat ___MaxRange, ref ModifiableFloat ____pullVelocity)
		{
			if (Bindings.IsDebugMode)
			{
				BepinPlugin.Log.LogInfo((object)$"Patching awake for {((Object)__instance).name}. Catch Radius: {____catchRadius}, Range: {((ModifiablePrimitive<float, FloatModifier>)(object)___MaxRange).Value}:{((ModifiablePrimitive<float, FloatModifier>)(object)___MaxRange).BaseValue}, Velocity: {((ModifiablePrimitive<float, FloatModifier>)(object)____pullVelocity).Value}:{((ModifiablePrimitive<float, FloatModifier>)(object)____pullVelocity).BaseValue}");
			}
			____catchRadius *= ScoopConfig.CatchRadiusMultiplier.Value;
			((ModifiablePrimitive<float, FloatModifier>)(object)___MaxRange).SetBaseValue(((ModifiablePrimitive<float, FloatModifier>)(object)___MaxRange).BaseValue * ScoopConfig.MaxRangeMultiplier.Value);
			((ModifiablePrimitive<float, FloatModifier>)(object)____pullVelocity).SetBaseValue(((ModifiablePrimitive<float, FloatModifier>)(object)____pullVelocity).BaseValue * ScoopConfig.PullVelocityMultiplier.Value);
			if (Bindings.IsDebugMode)
			{
				BepinPlugin.Log.LogInfo((object)$"Patched awake for {((Object)__instance).name}. Catch Radius: {____catchRadius}, Range: {((ModifiablePrimitive<float, FloatModifier>)(object)___MaxRange).Value}:{((ModifiablePrimitive<float, FloatModifier>)(object)___MaxRange).BaseValue}, Velocity: {((ModifiablePrimitive<float, FloatModifier>)(object)____pullVelocity).Value}:{((ModifiablePrimitive<float, FloatModifier>)(object)____pullVelocity).BaseValue}");
			}
			foreach (CarryablesSocket socket in __instance._carryablesSocketProvider.Sockets)
			{
				socket.OnAcquireCarryable += GravityScoopEject.SocketItemInserted;
			}
		}

		[HarmonyPrefix]
		[HarmonyPatch("OnDestroy")]
		private static void OnDestroy(CarryableAttractor __instance)
		{
			foreach (CarryablesSocket socket in __instance._carryablesSocketProvider.Sockets)
			{
				socket.OnAcquireCarryable -= GravityScoopEject.SocketItemInserted;
			}
		}

		[HarmonyPostfix]
		[HarmonyPatch("GetPossibleItemsToAttrack")]
		private static void GetPossibleItemsToAttrack(ref List<CarryableObject> __result)
		{
			if (PhotonNetwork.IsMasterClient)
			{
				__result.RemoveAll((CarryableObject item) => dotNotAttract.Contains(((AbstractCloneStarObject)item).assetGuid));
			}
		}
	}
	internal class GravityScoopEject
	{
		internal static List<GUIDUnion> eject = ScoopConfig.HexToGUIDs(ScoopConfig.ItemEjectlist.Value);

		private static Dictionary<CarryablesSocket, DateTime> toEject = new Dictionary<CarryablesSocket, DateTime>();

		private const long EjectWaitTimeMs = 1000L;

		private const float distance = 4f;

		private const float speed = 100f;

		private static readonly FieldInfo attractPointField = AccessTools.Field(typeof(CarryableAttractor), "_attractPoint");

		internal static void CheckAndEject(object sender, EventArgs e)
		{
			//IL_009e: Unknown result type (might be due to invalid IL or missing references)
			//IL_00a5: Expected O, but got Unknown
			//IL_00b1: Unknown result type (might be due to invalid IL or missing references)
			//IL_00b8: Unknown result type (might be due to invalid IL or missing references)
			//IL_00bd: Unknown result type (might be due to invalid IL or missing references)
			//IL_00c7: Unknown result type (might be due to invalid IL or missing references)
			//IL_00cc: Unknown result type (might be due to invalid IL or missing references)
			//IL_00d1: Unknown result type (might be due to invalid IL or missing references)
			//IL_00e4: Unknown result type (might be due to invalid IL or missing references)
			//IL_00e9: Unknown result type (might be due to invalid IL or missing references)
			//IL_00f3: Unknown result type (might be due to invalid IL or missing references)
			//IL_00f8: Unknown result type (might be due to invalid IL or missing references)
			for (int num = toEject.Count - 1; num >= 0; num--)
			{
				KeyValuePair<CarryablesSocket, DateTime> keyValuePair = toEject.ElementAt(num);
				CarryablesSocket key = keyValuePair.Key;
				DateTime value = keyValuePair.Value;
				if ((Object)(object)key.Payload == (Object)null)
				{
					toEject.Remove(key);
				}
				else if ((DateTime.Now - value).TotalMilliseconds > 1000.0)
				{
					toEject.Remove(key);
					Transform val = (Transform)attractPointField.GetValue(((AbstractCloneStarObject)key).GameObject.GetComponentInParent<CarryableAttractor>());
					Transform transform = ((Component)key.Payload).transform;
					transform.position += val.rotation * (Vector3.back * 4f);
					key.CarryableHandler.TryEjectCarryable(val.rotation * (Vector3.back * 100f));
				}
			}
			if (toEject.Count == 0)
			{
				Events.Instance.LateUpdate -= CheckAndEject;
			}
		}

		internal static void SocketItemInserted(ICarrier carrier, CarryableObject carryable, ICarrier previousCarrier)
		{
			//IL_000e: 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_007d: Expected O, but got Unknown
			if (PhotonNetwork.IsMasterClient && eject.Contains(((AbstractCloneStarObject)carryable).assetGuid) && carrier is CarryablesSocket)
			{
				if (toEject.Count == 0)
				{
					Events.Instance.LateUpdate += CheckAndEject;
				}
				toEject.Add((CarryablesSocket)carrier, DateTime.Now);
			}
		}
	}
	internal class GUI : ModSettingsMenu
	{
		private string ItemBlacklistString;

		private string ItemEjectlistString;

		private string MaxRangeMultiplierString = $"{ScoopConfig.MaxRangeMultiplier.Value}";

		private string PullVelocityMultiplierString = $"{ScoopConfig.PullVelocityMultiplier.Value}";

		private string CatchRadiusMultiplierString = $"{ScoopConfig.CatchRadiusMultiplier.Value}";

		public override string Name()
		{
			return "ImprovedScoop";
		}

		public override void OnOpen()
		{
			ItemBlacklistString = GUIDManager.GetDisplayNameList(CarryableAttractorPatch.dotNotAttract);
			ItemEjectlistString = GUIDManager.GetDisplayNameList(GravityScoopEject.eject);
		}

		public override void Draw()
		{
			GUILayout.BeginHorizontal(Array.Empty<GUILayoutOption>());
			GUILayout.Label("Ignore these items:", Array.Empty<GUILayoutOption>());
			ItemBlacklistString = GUILayout.TextField(ItemBlacklistString, (GUILayoutOption[])(object)new GUILayoutOption[1] { GUILayout.MinWidth(80f) });
			GUILayout.FlexibleSpace();
			if (GUILayout.Button("Apply", Array.Empty<GUILayoutOption>()))
			{
				CarryableAttractorPatch.dotNotAttract = GUIDManager.GetGUIDs(ItemBlacklistString);
				ItemBlacklistString = GUIDManager.GetDisplayNameList(CarryableAttractorPatch.dotNotAttract);
				ScoopConfig.ItemBlacklist.Value = ScoopConfig.GUIDsToHex(GUIDManager.GetGUIDs(ItemBlacklistString));
			}
			if (GUILayout.Button("Reset", Array.Empty<GUILayoutOption>()))
			{
				CarryableAttractorPatch.dotNotAttract = ScoopConfig.ItemBlacklistDefault;
				ScoopConfig.ItemBlacklist.Value = ScoopConfig.GUIDsToHex(CarryableAttractorPatch.dotNotAttract);
				ItemBlacklistString = GUIDManager.GetDisplayNameList(CarryableAttractorPatch.dotNotAttract);
			}
			GUILayout.EndHorizontal();
			GUILayout.BeginHorizontal(Array.Empty<GUILayoutOption>());
			GUILayout.Label("Eject these items:", Array.Empty<GUILayoutOption>());
			ItemEjectlistString = GUILayout.TextField(ItemEjectlistString, (GUILayoutOption[])(object)new GUILayoutOption[1] { GUILayout.MinWidth(80f) });
			GUILayout.FlexibleSpace();
			if (GUILayout.Button("Apply", Array.Empty<GUILayoutOption>()))
			{
				GravityScoopEject.eject = GUIDManager.GetGUIDs(ItemEjectlistString);
				ItemEjectlistString = GUIDManager.GetDisplayNameList(GravityScoopEject.eject);
				ScoopConfig.ItemEjectlist.Value = ScoopConfig.GUIDsToHex(GUIDManager.GetGUIDs(ItemEjectlistString));
			}
			if (GUILayout.Button("Reset", Array.Empty<GUILayoutOption>()))
			{
				GravityScoopEject.eject = ScoopConfig.ItemEjectlistDefault;
				ScoopConfig.ItemEjectlist.Value = ScoopConfig.GUIDsToHex(GravityScoopEject.eject);
				ItemEjectlistString = GUIDManager.GetDisplayNameList(GravityScoopEject.eject);
			}
			GUILayout.EndHorizontal();
			GUILayout.BeginHorizontal(Array.Empty<GUILayoutOption>());
			GUILayout.Label("Max range multiplier:", Array.Empty<GUILayoutOption>());
			MaxRangeMultiplierString = GUILayout.TextField(MaxRangeMultiplierString, (GUILayoutOption[])(object)new GUILayoutOption[1] { GUILayout.MinWidth(80f) });
			GUILayout.FlexibleSpace();
			if (GUILayout.Button("Apply", Array.Empty<GUILayoutOption>()) && float.TryParse(MaxRangeMultiplierString, out var maxRangeMultiplier))
			{
				IterateAttractors(delegate(CarryableAttractor attractor)
				{
					((ModifiablePrimitive<float, FloatModifier>)(object)attractor.MaxRange).SetBaseValue(((ModifiablePrimitive<float, FloatModifier>)(object)attractor.MaxRange).BaseValue / ScoopConfig.MaxRangeMultiplier.Value);
				});
				ScoopConfig.MaxRangeMultiplier.Value = maxRangeMultiplier;
				IterateAttractors(delegate(CarryableAttractor attractor)
				{
					((ModifiablePrimitive<float, FloatModifier>)(object)attractor.MaxRange).SetBaseValue(((ModifiablePrimitive<float, FloatModifier>)(object)attractor.MaxRange).BaseValue * maxRangeMultiplier);
				});
			}
			if (GUILayout.Button("Reset", Array.Empty<GUILayoutOption>()))
			{
				IterateAttractors(delegate(CarryableAttractor attractor)
				{
					((ModifiablePrimitive<float, FloatModifier>)(object)attractor.MaxRange).SetBaseValue(((ModifiablePrimitive<float, FloatModifier>)(object)attractor.MaxRange).BaseValue / ScoopConfig.MaxRangeMultiplier.Value);
				});
				ScoopConfig.MaxRangeMultiplier.Value = (float)((ConfigEntryBase)ScoopConfig.MaxRangeMultiplier).DefaultValue;
				MaxRangeMultiplierString = $"{ScoopConfig.MaxRangeMultiplier.Value}";
				IterateAttractors(delegate(CarryableAttractor attractor)
				{
					((ModifiablePrimitive<float, FloatModifier>)(object)attractor.MaxRange).SetBaseValue(((ModifiablePrimitive<float, FloatModifier>)(object)attractor.MaxRange).BaseValue * ScoopConfig.MaxRangeMultiplier.Value);
				});
			}
			GUILayout.EndHorizontal();
			GUILayout.BeginHorizontal(Array.Empty<GUILayoutOption>());
			GUILayout.Label("Pull velocity multiplier:", Array.Empty<GUILayoutOption>());
			PullVelocityMultiplierString = GUILayout.TextField(PullVelocityMultiplierString, (GUILayoutOption[])(object)new GUILayoutOption[1] { GUILayout.MinWidth(80f) });
			GUILayout.FlexibleSpace();
			if (GUILayout.Button("Apply", Array.Empty<GUILayoutOption>()) && float.TryParse(PullVelocityMultiplierString, out var pullVelocityMultiplier))
			{
				IterateAttractors(delegate(CarryableAttractor attractor)
				{
					((ModifiablePrimitive<float, FloatModifier>)(object)attractor._pullVelocity).SetBaseValue(((ModifiablePrimitive<float, FloatModifier>)(object)attractor._pullVelocity).BaseValue / ScoopConfig.PullVelocityMultiplier.Value);
				});
				ScoopConfig.PullVelocityMultiplier.Value = pullVelocityMultiplier;
				IterateAttractors(delegate(CarryableAttractor attractor)
				{
					((ModifiablePrimitive<float, FloatModifier>)(object)attractor._pullVelocity).SetBaseValue(((ModifiablePrimitive<float, FloatModifier>)(object)attractor._pullVelocity).BaseValue * pullVelocityMultiplier);
				});
			}
			if (GUILayout.Button("Reset", Array.Empty<GUILayoutOption>()))
			{
				IterateAttractors(delegate(CarryableAttractor attractor)
				{
					((ModifiablePrimitive<float, FloatModifier>)(object)attractor._pullVelocity).SetBaseValue(((ModifiablePrimitive<float, FloatModifier>)(object)attractor._pullVelocity).BaseValue / ScoopConfig.PullVelocityMultiplier.Value);
				});
				ScoopConfig.PullVelocityMultiplier.Value = (float)((ConfigEntryBase)ScoopConfig.PullVelocityMultiplier).DefaultValue;
				PullVelocityMultiplierString = $"{ScoopConfig.PullVelocityMultiplier.Value}";
				IterateAttractors(delegate(CarryableAttractor attractor)
				{
					((ModifiablePrimitive<float, FloatModifier>)(object)attractor._pullVelocity).SetBaseValue(((ModifiablePrimitive<float, FloatModifier>)(object)attractor._pullVelocity).BaseValue * ScoopConfig.PullVelocityMultiplier.Value);
				});
			}
			GUILayout.EndHorizontal();
			GUILayout.BeginHorizontal(Array.Empty<GUILayoutOption>());
			GUILayout.Label("Catch radius multiplier:", Array.Empty<GUILayoutOption>());
			CatchRadiusMultiplierString = GUILayout.TextField(CatchRadiusMultiplierString, (GUILayoutOption[])(object)new GUILayoutOption[1] { GUILayout.MinWidth(80f) });
			GUILayout.FlexibleSpace();
			if (GUILayout.Button("Apply", Array.Empty<GUILayoutOption>()) && float.TryParse(CatchRadiusMultiplierString, out var catchRadiusMultiplier))
			{
				IterateAttractors(delegate(CarryableAttractor attractor)
				{
					attractor._catchRadius /= ScoopConfig.CatchRadiusMultiplier.Value;
				});
				ScoopConfig.CatchRadiusMultiplier.Value = catchRadiusMultiplier;
				IterateAttractors(delegate(CarryableAttractor attractor)
				{
					attractor._catchRadius *= catchRadiusMultiplier;
				});
			}
			if (GUILayout.Button("Reset", Array.Empty<GUILayoutOption>()))
			{
				IterateAttractors(delegate(CarryableAttractor attractor)
				{
					attractor._catchRadius /= ScoopConfig.CatchRadiusMultiplier.Value;
				});
				ScoopConfig.CatchRadiusMultiplier.Value = (float)((ConfigEntryBase)ScoopConfig.CatchRadiusMultiplier).DefaultValue;
				CatchRadiusMultiplierString = $"{ScoopConfig.CatchRadiusMultiplier.Value}";
				IterateAttractors(delegate(CarryableAttractor attractor)
				{
					attractor._catchRadius *= ScoopConfig.CatchRadiusMultiplier.Value;
				});
			}
			GUILayout.EndHorizontal();
		}

		private void IterateAttractors(Action<CarryableAttractor> action)
		{
			ClientGame current = ClientGame.Current;
			object obj;
			if (current == null)
			{
				obj = null;
			}
			else
			{
				AbstractPlayerControlledShip playerShip = current.PlayerShip;
				obj = ((playerShip != null) ? ((Component)playerShip).GetComponentsInChildren<CarryableAttractor>() : null);
			}
			CarryableAttractor[] array = (CarryableAttractor[])obj;
			if (array != null)
			{
				CarryableAttractor[] array2 = array;
				foreach (CarryableAttractor obj2 in array2)
				{
					action(obj2);
				}
			}
		}
	}
	internal class GUIDManager
	{
		private static Dictionary<GUIDUnion, string> DisplayNames;

		public static void GenerateDictionaries()
		{
			List<CarryableDef> list = ((ResourceAssetContainer<CarryableContainer, CarryableObject, CarryableDef>)(object)ResourceAssetContainer<CarryableContainer, CarryableObject, CarryableDef>.Instance)?.AssetDescriptions;
			if (list == null || list.Count == 0)
			{
				BepinPlugin.Log.LogInfo((object)"GenerateDictionaries could not load AssetDescriptions");
				return;
			}
			DisplayNames = list.ToDictionary((CarryableDef item) => ((ResourceAssetDef<CarryableObject>)(object)item).AssetGuid, (CarryableDef item) => ((AbstractCloneStarObject)((ResourceAssetDef<CarryableObject>)(object)item).Asset).DisplayName);
		}

		public static List<GUIDUnion> GetGUIDs(string displayNameCSV)
		{
			//IL_0070: Unknown result type (might be due to invalid IL or missing references)
			if (string.IsNullOrEmpty(displayNameCSV))
			{
				return new List<GUIDUnion>();
			}
			string[] array = displayNameCSV.Split(',');
			List<GUIDUnion> list = new List<GUIDUnion>();
			string[] array2 = array;
			foreach (string displayName in array2)
			{
				KeyValuePair<GUIDUnion, string> keyValuePair = DisplayNames.FirstOrDefault((KeyValuePair<GUIDUnion, string> kvp) => kvp.Value.ToLower().Contains(displayName.Trim().ToLower()));
				if (!string.IsNullOrEmpty(keyValuePair.Value))
				{
					list.Add(keyValuePair.Key);
				}
			}
			return list;
		}

		public static string GetDisplayNameList(List<GUIDUnion> guids)
		{
			//IL_0013: Unknown result type (might be due to invalid IL or missing references)
			//IL_0018: Unknown result type (might be due to invalid IL or missing references)
			//IL_001f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0030: Unknown result type (might be due to invalid IL or missing references)
			List<string> list = new List<string>();
			foreach (GUIDUnion guid in guids)
			{
				if (DisplayNames.ContainsKey(guid))
				{
					list.Add(DisplayNames[guid]);
				}
			}
			return string.Join(", ", list);
		}
	}
	public class MyPluginInfo
	{
		public const string PLUGIN_GUID = "18107.ImprovedScoop";

		public const string PLUGIN_NAME = "ImprovedScoop";

		public const string USERS_PLUGIN_NAME = "Improved Scoop";

		public const string PLUGIN_VERSION = "0.1.4";

		public const string PLUGIN_DESCRIPTION = "Increases Range, Radius, and Pull speed of gravity scoops. Ignores Mission Items. Inspired by Maverik's 'Better Scoop'. Session Mod.";

		public const string PLUGIN_ORIGINAL_AUTHOR = "18107";

		public const string PLUGIN_AUTHORS = "18107, Dragon";

		public const string PLUGIN_THUNDERSTORE_ID = "VoidCrewModdingTeam/Improved_Scoop";
	}
	internal class ScoopConfig
	{
		internal static readonly List<GUIDUnion> ItemBlacklistDefault = new List<GUIDUnion>
		{
			new GUIDUnion("ee69440bbce371e458daeba6eee12a49"),
			new GUIDUnion("6c37b5363f7ef7844881a301dca76572"),
			new GUIDUnion("ec0fc0790a706ef4facab39da5d9de04"),
			new GUIDUnion("e1bdce573e8182b4d95aacb841301d7c")
		};

		internal static readonly List<GUIDUnion> ItemEjectlistDefault = new List<GUIDUnion>
		{
			new GUIDUnion("ee69440bbce371e458daeba6eee12a49")
		};

		internal static ConfigEntry<string> ItemBlacklist;

		internal static ConfigEntry<string> ItemEjectlist;

		internal static ConfigEntry<float> MaxRangeMultiplier;

		internal static ConfigEntry<float> PullVelocityMultiplier;

		internal static ConfigEntry<float> CatchRadiusMultiplier;

		internal static ConfigEntry<bool> ProcessAlloys;

		internal static ConfigEntry<bool> ProcessBiomass;

		internal static ConfigEntry<bool> ProcessShards;

		internal static ConfigEntry<bool> ProcessSummonShards;

		internal static ConfigEntry<bool> MoveToShelf;

		internal static void BindConfigs(BepinPlugin plugin)
		{
			ItemBlacklist = ((BaseUnityPlugin)plugin).Config.Bind<string>("GravityScoop", "ItemBlacklist", GUIDsToHex(ItemBlacklistDefault), (ConfigDescription)null);
			ItemEjectlist = ((BaseUnityPlugin)plugin).Config.Bind<string>("GravityScoop", "ItemEjectlist", GUIDsToHex(ItemEjectlistDefault), (ConfigDescription)null);
			MaxRangeMultiplier = ((BaseUnityPlugin)plugin).Config.Bind<float>("GravityScoop", "MaxRangeMultiplier", 1.5f, (ConfigDescription)null);
			PullVelocityMultiplier = ((BaseUnityPlugin)plugin).Config.Bind<float>("GravityScoop", "PullVelocityMultiplier", 3f, (ConfigDescription)null);
			CatchRadiusMultiplier = ((BaseUnityPlugin)plugin).Config.Bind<float>("GravityScoop", "CatchRadiusMultiplier", 1.5f, (ConfigDescription)null);
			ProcessAlloys = ((BaseUnityPlugin)plugin).Config.Bind<bool>("GravityScoop", "ProcessAlloys", false, (ConfigDescription)null);
			ProcessBiomass = ((BaseUnityPlugin)plugin).Config.Bind<bool>("GravityScoop", "ProcessBiomass", false, (ConfigDescription)null);
			ProcessShards = ((BaseUnityPlugin)plugin).Config.Bind<bool>("GravityScoop", "ProcessShards", false, (ConfigDescription)null);
			ProcessSummonShards = ((BaseUnityPlugin)plugin).Config.Bind<bool>("GravityScoop", "ProcessSummonShards", false, (ConfigDescription)null);
			MoveToShelf = ((BaseUnityPlugin)plugin).Config.Bind<bool>("GravityScoop", "MoveToShelf", false, (ConfigDescription)null);
		}

		internal static List<GUIDUnion> HexToGUIDs(string str)
		{
			//IL_0037: Unknown result type (might be due to invalid IL or missing references)
			if (string.IsNullOrEmpty(str))
			{
				return new List<GUIDUnion>();
			}
			string[] array = str.Split(',');
			List<GUIDUnion> list = new List<GUIDUnion>();
			string[] array2 = array;
			foreach (string text in array2)
			{
				list.Add(new GUIDUnion(text));
			}
			return list;
		}

		internal static string GUIDsToHex(List<GUIDUnion> guids)
		{
			//IL_0028: Unknown result type (might be due to invalid IL or missing references)
			//IL_002d: Unknown result type (might be due to invalid IL or missing references)
			if (guids.Count == 0)
			{
				return "";
			}
			StringBuilder stringBuilder = new StringBuilder();
			foreach (GUIDUnion guid in guids)
			{
				GUIDUnion current = guid;
				stringBuilder.Append(((GUIDUnion)(ref current)).AsHex());
				stringBuilder.Append(",");
			}
			stringBuilder.Remove(stringBuilder.Length - 1, 1);
			return stringBuilder.ToString();
		}
	}
	public class VoidManagerPlugin : VoidPlugin
	{
		public override MultiplayerType MPType => (MultiplayerType)14;

		public override string Author => "18107, Dragon";

		public override string Description => "Increases Range, Radius, and Pull speed of gravity scoops. Ignores Mission Items. Inspired by Maverik's 'Better Scoop'. Session Mod.";

		public override string ThunderstoreID => "VoidCrewModdingTeam/Improved_Scoop";

		public VoidManagerPlugin()
		{
			GUIDManager.GenerateDictionaries();
		}

		public override SessionChangedReturn OnSessionChange(SessionChangedInput input)
		{
			//IL_0003: Unknown result type (might be due to invalid IL or missing references)
			//IL_0011: Unknown result type (might be due to invalid IL or missing references)
			//IL_0012: Unknown result type (might be due to invalid IL or missing references)
			//IL_0015: Unknown result type (might be due to invalid IL or missing references)
			SessionChangedReturn result = default(SessionChangedReturn);
			result.SetMod_Session = true;
			return result;
		}
	}
}