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 StructurallyImpossible v1.0.0
StructurallyImpossible.dll
Decompiled a year agousing System.Diagnostics; using System.Reflection; using System.Runtime.CompilerServices; using System.Runtime.InteropServices; using System.Runtime.Versioning; using System.Security; using System.Security.Permissions; using BepInEx; using BepInEx.Configuration; using HarmonyLib; using UnityEngine; [assembly: CompilationRelaxations(8)] [assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)] [assembly: Debuggable(DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints)] [assembly: AssemblyTitle("StructurallyImpossible")] [assembly: AssemblyDescription("")] [assembly: AssemblyConfiguration("")] [assembly: AssemblyCompany("")] [assembly: AssemblyProduct("StructurallyImpossible")] [assembly: AssemblyCopyright("Copyright © 2025")] [assembly: AssemblyTrademark("")] [assembly: ComVisible(false)] [assembly: Guid("3c445010-10b4-45e9-aded-aec6a60c00fb")] [assembly: AssemblyFileVersion("1.0.0")] [assembly: TargetFramework(".NETFramework,Version=v4.8", FrameworkDisplayName = ".NET Framework 4.8")] [assembly: SecurityPermission(SecurityAction.RequestMinimum, SkipVerification = true)] [assembly: AssemblyVersion("1.0.0.0")] [module: UnverifiableCode] namespace StructurallyImpossible; public static class WearNTearManager { public const int HasFieldsHash = -310439593; public const int HasFieldsWearNTearHash = 2128458598; public const int WearNTearNoSupportWearHash = -1943636578; public static void SetNoSupportWear(WearNTear wearNTear) { wearNTear.m_noSupportWear = false; wearNTear.m_nview.m_zdo.Set(-310439593, true); wearNTear.m_nview.m_zdo.Set(2128458598, true); wearNTear.m_nview.m_zdo.Set(-1943636578, false); } } [BepInPlugin("org.ssmvc.structurallyimpossible", "StructurallyImpossible", "1.0.0")] [BepInProcess("valheim.exe")] public class StructurallyImpossible : BaseUnityPlugin { [HarmonyPatch(typeof(Piece))] public static class PiecePatch { [HarmonyPrefix] [HarmonyPatch("SetCreator")] public static void SetCreator(Piece __instance, long uid) { Plant val = default(Plant); WearNTear noSupportWear = default(WearNTear); if (Enabled.Value && Object.op_Implicit((Object)(object)__instance) && Object.op_Implicit((Object)(object)__instance.m_nview) && __instance.m_nview.IsValid() && !((Component)__instance).TryGetComponent<Plant>(ref val) && ((Component)__instance).TryGetComponent<WearNTear>(ref noSupportWear)) { WearNTearManager.SetNoSupportWear(noSupportWear); } } } public const string PluginGUID = "org.ssmvc.structurallyimpossible"; public const string PluginName = "StructurallyImpossible"; public const string PluginVersion = "1.0.0"; private static Harmony _harmony; public static ConfigEntry<bool> Enabled { get; set; } public void Awake() { _harmony = Harmony.CreateAndPatchAll(Assembly.GetExecutingAssembly(), "org.ssmvc.structurallyimpossible"); Enabled = ((BaseUnityPlugin)this).Config.Bind<bool>("_Global", "isModEnabled", true, "Globally enable or disable this mod."); } public void OnDestroy() { Harmony harmony = _harmony; if (harmony != null) { harmony.UnpatchSelf(); } } }