Please disclose if your mod was created primarily 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 DoorSpeedModifier v1.0.2
DoorSpeedModifier.dll
Decompiled 6 months 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.IgnoreSymbolStoreSequencePoints)] [assembly: TargetFramework(".NETStandard,Version=v2.1", FrameworkDisplayName = ".NET Standard 2.1")] [assembly: AssemblyCompany("blacks7ar")] [assembly: AssemblyConfiguration("Release")] [assembly: AssemblyFileVersion("1.0.2")] [assembly: AssemblyInformationalVersion("1.0.2")] [assembly: AssemblyProduct("DoorSpeedModifier")] [assembly: AssemblyTitle("DoorSpeedModifier")] [assembly: SecurityPermission(SecurityAction.RequestMinimum, SkipVerification = true)] [assembly: AssemblyVersion("1.0.2.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 DoorSpeedModifier { [BepInPlugin("blacks7ar.DoorSpeedModifier", "DoorSpeedModifier", "1.0.2")] public class Plugin : BaseUnityPlugin { [HarmonyPatch(typeof(Door), "Interact")] private class Patches { private static void Postfix(Door __instance) { if (!((Object)(object)__instance == (Object)null) && __instance.CanInteract() && __instance.m_nview.IsValid() && __instance.m_nview.IsOwner() && !((Object)(object)__instance.m_animator == (Object)null)) { __instance.m_animator.speed = _speed.Value; } } } private const string modGUID = "blacks7ar.DoorSpeedModifier"; public const string modName = "DoorSpeedModifier"; public const string modAuthor = "blacks7ar"; public const string modVersion = "1.0.2"; public const string modLink = "https://thunderstore.io/c/valheim/p/blacks7ar/DoorSpeedModifier/"; private static readonly Harmony _harmony = new Harmony("blacks7ar.DoorSpeedModifier"); private static ConfigEntry<float> _speed; public void Awake() { ((BaseUnityPlugin)this).Config.SaveOnConfigSet = false; _speed = ((BaseUnityPlugin)this).Config.Bind<float>("General", "Speed", 0.5f, "Door open close animation speed."); ((BaseUnityPlugin)this).Config.SaveOnConfigSet = true; ((BaseUnityPlugin)this).Config.Save(); Assembly executingAssembly = Assembly.GetExecutingAssembly(); _harmony.PatchAll(executingAssembly); } private void OnDestroy() { ((BaseUnityPlugin)this).Config.Save(); } } }