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 Hanging Decoration Hitbox Fix v1.3.0
HangingDecorationHitboxFix.dll
Decompiled a month agousing System; using System.Diagnostics; using System.Reflection; using System.Runtime.CompilerServices; using System.Runtime.Versioning; using System.Security; using System.Security.Permissions; using BepInEx; using BepInEx.Configuration; 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: IgnoresAccessChecksTo("assembly_utils")] [assembly: IgnoresAccessChecksTo("assembly_valheim")] [assembly: TargetFramework(".NETFramework,Version=v4.8", FrameworkDisplayName = ".NET Framework 4.8")] [assembly: AssemblyCompany("HangingDecorationHitboxFix")] [assembly: AssemblyConfiguration("Debug")] [assembly: AssemblyFileVersion("1.3.0.0")] [assembly: AssemblyInformationalVersion("1.3.0")] [assembly: AssemblyProduct("HangingDecorationHitboxFix")] [assembly: AssemblyTitle("HangingDecorationHitboxFix")] [assembly: SecurityPermission(SecurityAction.RequestMinimum, SkipVerification = true)] [assembly: AssemblyVersion("1.3.0.0")] [module: UnverifiableCode] [module: RefSafetyRules(11)] namespace Microsoft.CodeAnalysis { [CompilerGenerated] [Embedded] internal sealed class EmbeddedAttribute : Attribute { } } namespace System.Runtime.CompilerServices { [CompilerGenerated] [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 ValheimHangingDecorationFix { [BepInPlugin("com.faultydwarf.hangingdecorationhitboxfix", "Hanging Decoration Hitbox Fix", "1.3.0")] public class Plugin : BaseUnityPlugin { public const string PluginGUID = "com.faultydwarf.hangingdecorationhitboxfix"; public const string PluginName = "Hanging Decoration Hitbox Fix"; public const string PluginVersion = "1.3.0"; private readonly Harmony harmony = new Harmony("com.faultydwarf.hangingdecorationhitboxfix"); public static ConfigEntry<float> HitboxWidth; public static ConfigEntry<float> HitboxHeight; public static ConfigEntry<float> HitboxLength; private void Awake() { HitboxWidth = ((BaseUnityPlugin)this).Config.Bind<float>("Hitbox", "Width", 0.6f, "Width (X) of the central deconstruction trigger."); HitboxHeight = ((BaseUnityPlugin)this).Config.Bind<float>("Hitbox", "Height", 0.6f, "Height (Y) of the central deconstruction trigger."); HitboxLength = ((BaseUnityPlugin)this).Config.Bind<float>("Hitbox", "Length", 3f, "Length (Z) of the central deconstruction trigger."); harmony.PatchAll(); ((BaseUnityPlugin)this).Logger.LogInfo((object)"Hanging Decoration Hitbox Fix v1.3.0 initialized cleanly."); } } [HarmonyPatch(typeof(ZNetScene), "Awake")] public static class ZNetScene_Awake_Patch { [HarmonyPostfix] public static void Postfix(ZNetScene __instance) { if ((Object)(object)__instance == (Object)null) { return; } int num = LayerMask.NameToLayer("piece"); if (num == -1) { num = 10; } foreach (GameObject prefab in __instance.m_prefabs) { if (!((Object)(object)prefab == (Object)null)) { string text = ((Object)prefab).name.ToLowerInvariant(); if (text.Contains("fey") || text.Contains("garland") || text.Contains("stringlight")) { ApplyPrefabHitbox(prefab, num); } } } } private static void ApplyPrefabHitbox(GameObject prefab, int pieceLayer) { //IL_0020: Unknown result type (might be due to invalid IL or missing references) //IL_0053: Unknown result type (might be due to invalid IL or missing references) //IL_0064: Unknown result type (might be due to invalid IL or missing references) //IL_0096: Unknown result type (might be due to invalid IL or missing references) //IL_00c0: Unknown result type (might be due to invalid IL or missing references) Transform val = prefab.transform.Find("DeconstructHitbox"); GameObject val2 = (GameObject)(((Object)(object)val != (Object)null) ? ((object)((Component)val).gameObject) : ((object)new GameObject("DeconstructHitbox"))); if ((Object)(object)val == (Object)null) { val2.transform.SetParent(prefab.transform, false); val2.transform.localPosition = Vector3.zero; val2.transform.localRotation = Quaternion.identity; } val2.layer = pieceLayer; BoxCollider val3 = val2.GetComponent<BoxCollider>(); if ((Object)(object)val3 == (Object)null) { val3 = val2.AddComponent<BoxCollider>(); } val3.center = Vector3.zero; val3.size = new Vector3(Plugin.HitboxWidth.Value, Plugin.HitboxHeight.Value, Plugin.HitboxLength.Value); ((Collider)val3).isTrigger = true; } } } namespace System.Runtime.CompilerServices { [AttributeUsage(AttributeTargets.Assembly, AllowMultiple = true)] internal sealed class IgnoresAccessChecksToAttribute : Attribute { public IgnoresAccessChecksToAttribute(string assemblyName) { } } }