Please disclose if any significant portion of your mod was created using AI tools by adding the 'AI Generated' category. Failing to do so may result in the mod being removed from Thunderstore.
Decompiled source of OpenExtractionWithCart v1.0.2
OpenExtractionZoneWithCart.dll
Decompiled a year agousing System; using System.Collections.Generic; using System.Diagnostics; using System.Linq; using System.Reflection; using System.Runtime.CompilerServices; using System.Runtime.InteropServices; using System.Runtime.Versioning; using BepInEx; using BepInEx.Logging; using HarmonyLib; using UnityEngine; [assembly: CompilationRelaxations(8)] [assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)] [assembly: Debuggable(DebuggableAttribute.DebuggingModes.Default | DebuggableAttribute.DebuggingModes.DisableOptimizations | DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints | DebuggableAttribute.DebuggingModes.EnableEditAndContinue)] [assembly: AssemblyTitle("OpenExtractionZoneWithCart")] [assembly: AssemblyDescription("Mod made by flipf17")] [assembly: AssemblyConfiguration("")] [assembly: AssemblyCompany("")] [assembly: AssemblyProduct("OpenExtractionZoneWithCart")] [assembly: AssemblyCopyright("Copyright © 2025")] [assembly: AssemblyTrademark("")] [assembly: ComVisible(false)] [assembly: Guid("38201fb3-c1a5-4330-81e6-3ed7cd1788ae")] [assembly: AssemblyFileVersion("1.0.0.0")] [assembly: TargetFramework(".NETFramework,Version=v4.8", FrameworkDisplayName = ".NET Framework 4.8")] [assembly: AssemblyVersion("1.0.0.0")] namespace REPO_OpenExtractionWithCart; [HarmonyPatch] public class CartCollisionDetector : MonoBehaviour { internal static FieldInfo extractionStateField = typeof(ExtractionPoint).GetField("currentState", BindingFlags.Instance | BindingFlags.NonPublic); internal static FieldInfo isShopField = typeof(ExtractionPoint).GetField("isShop", BindingFlags.Instance | BindingFlags.NonPublic); internal static FieldInfo inStartRoomField = typeof(ExtractionPoint).GetField("inStartRoom", BindingFlags.Instance | BindingFlags.NonPublic); public ExtractionPoint extractionPoint; public State currentState => (State)(Object.op_Implicit((Object)(object)extractionPoint) ? ((int)(State)extractionStateField.GetValue(extractionPoint)) : 0); public bool isShop => Object.op_Implicit((Object)(object)extractionPoint) && (bool)isShopField.GetValue(extractionPoint); [HarmonyPatch(typeof(ExtractionPoint), "Start")] [HarmonyPostfix] public static void OnStart(ExtractionPoint __instance) { if ((bool)inStartRoomField.GetValue(__instance)) { return; } StaticGrabObject[] componentsInChildren = ((Component)__instance).GetComponentsInChildren<StaticGrabObject>(); GameObject val = null; StaticGrabObject[] array = componentsInChildren; foreach (StaticGrabObject val2 in array) { if (((Object)val2).name.StartsWith("Button")) { val = ((Component)val2).gameObject; break; } } if (Object.op_Implicit((Object)(object)val)) { val.AddComponent<CartCollisionDetector>(); Plugin.Log("Added CartCollisionDetector component to extraction zone button"); } else { Plugin.LogWarning("Failed to insert CartCollisionDetector to extraction zone button."); } } public void Awake() { extractionPoint = ((Component)this).GetComponentInParent<ExtractionPoint>(); } private void OnCollisionEnter(Collision collision) { //IL_0016: Unknown result type (might be due to invalid IL or missing references) //IL_001c: Invalid comparison between Unknown and I4 if (SemiFunc.IsMasterClientOrSingleplayer() && Object.op_Implicit((Object)(object)extractionPoint) && (int)currentState == 1 && !extractionPoint.isLocked && !isShop && Object.op_Implicit((Object)(object)collision.gameObject.GetComponent<PhysGrabCart>())) { Plugin.Log("Cart pushed into button. Pressing button."); extractionPoint.OnClick(); } } } [BepInPlugin("flipf17.OpenExtractionWithCart", "OpenExtractionWithCart", "1.0.2")] public class Plugin : BaseUnityPlugin { private Harmony _harmony; public static Plugin instance; private static ManualLogSource logger; private void Awake() { //IL_0014: Unknown result type (might be due to invalid IL or missing references) //IL_001e: Expected O, but got Unknown instance = this; CreateCustomLogger(); _harmony = new Harmony("OpenExtractionWithCart"); PatchAll(); Log("OpenExtractionWithCart loaded"); } private void PatchAll() { IEnumerable<Type> enumerable; try { enumerable = Assembly.GetExecutingAssembly().GetTypes(); } catch (ReflectionTypeLoadException ex) { enumerable = ex.Types.Where((Type t) => t != null); } foreach (Type item in enumerable) { _harmony.PatchAll(item); } } private void CreateCustomLogger() { try { logger = Logger.CreateLogSource(string.Format("{0}-{1}", "OpenExtractionWithCart", "1.0.2")); } catch { logger = ((BaseUnityPlugin)this).Logger; } } internal static void Log(string message) { logger.LogInfo((object)message); } internal static void LogError(string message) { logger.LogError((object)message); } internal static void LogWarning(string message) { logger.LogWarning((object)message); } } public static class PluginInfo { public const string PLUGIN_GUID = "flipf17.OpenExtractionWithCart"; public const string PLUGIN_NAME = "OpenExtractionWithCart"; public const string PLUGIN_VERSION = "1.0.2"; }