using System;
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 BepInEx;
using BepInEx.Logging;
using CG;
using CG.Client.Player.Input;
using CG.Client.Player.Interactions;
using CG.Client.Ship.Interactions;
using CG.Game.Player;
using CG.Objects;
using CG.Ship.Object;
using CG.Space;
using HarmonyLib;
using Microsoft.CodeAnalysis;
using Opsive.UltimateCharacterController.Character;
using Opsive.UltimateCharacterController.Character.Abilities;
using UnityEngine;
using VoidManager;
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("SafeCopyMatrix")]
[assembly: AssemblyConfiguration("Debug")]
[assembly: AssemblyFileVersion("1.0.0.0")]
[assembly: AssemblyInformationalVersion("1.0.0")]
[assembly: AssemblyProduct("SafeCopyMatrix")]
[assembly: AssemblyTitle("Puts the copied item in the players hands")]
[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 SafeCopyMatrix
{
[HarmonyPatch(typeof(InteractiveCarryableItemCopier), "CompleteInteraction")]
internal class InteractiveCarryableItemCopierPatch
{
private static bool Prefix(InteractiveCarryableItemCopier __instance)
{
//IL_0020: Unknown result type (might be due to invalid IL or missing references)
//IL_0026: Unknown result type (might be due to invalid IL or missing references)
if ((Object)(object)__instance.lookedAtCarryable == (Object)null)
{
return true;
}
AbstractCloneStarObject obj = DebugInput.SpawnByGUID(__instance.GetGuidOfCopyableCarryable(__instance.lookedAtCarryable), 0, Vector3.up);
CarryableObject val = (CarryableObject)(object)((obj is CarryableObject) ? obj : null);
((CarryableObject)__instance).Carrier.TryReleaseCarryable().Then((Action)((OrbitObject)__instance).Kill);
Ability obj2 = ((UltimateCharacterLocomotion)((Player)LocalPlayer.Instance).Locomotion).Abilities.First((Ability ability) => ability is CarryableInteract);
CarryableInteract val2 = (CarryableInteract)(object)((obj2 is CarryableInteract) ? obj2 : null);
GrabableObject component = ((Component)val).gameObject.GetComponent<GrabableObject>();
((MonoBehaviour)LocalPlayer.Instance).StartCoroutine(val2.DelayedPickupGrabable((AbstractInteractable)(object)component));
((InteractiveCarryable)__instance).OnCompletedInteraction.Invoke();
return false;
}
}
public class MyPluginInfo
{
public const string PLUGIN_GUID = "id107.safecopymatrix";
public const string PLUGIN_NAME = "SafeCopyMatrix";
public const string USERS_PLUGIN_NAME = "Safe Copy Matrix";
public const string PLUGIN_VERSION = "1.0.0";
public const string PLUGIN_DESCRIPTION = "Puts the copied item in the players hands";
public const string PLUGIN_ORIGINAL_AUTHOR = "18107";
public const string PLUGIN_AUTHORS = "18107";
public const string PLUGIN_THUNDERSTORE_ID = "";
}
[BepInPlugin("id107.safecopymatrix", "Safe Copy Matrix", "1.0.0")]
[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(), (string)null);
((BaseUnityPlugin)this).Logger.LogInfo((object)"Plugin id107.safecopymatrix is loaded!");
}
}
public class VoidManagerPlugin : VoidPlugin
{
public override MultiplayerType MPType => (MultiplayerType)8;
public override string Author => "18107";
public override string Description => "Puts the copied item in the players hands";
public override string ThunderstoreID => "";
}
}