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 Greatsword Idle v0.6.0
GreatswordIdle.dll
Decompiled 2 weeks agousing System; using System.Diagnostics; using System.Reflection; using System.Runtime.CompilerServices; using System.Runtime.Versioning; using BepInEx; using BepInEx.Logging; using HarmonyLib; using Microsoft.CodeAnalysis; [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("GreatswordIdle")] [assembly: AssemblyConfiguration("Release")] [assembly: AssemblyFileVersion("0.5.0.0")] [assembly: AssemblyInformationalVersion("0.5.0")] [assembly: AssemblyProduct("GreatswordIdle")] [assembly: AssemblyTitle("GreatswordIdle")] [assembly: AssemblyVersion("0.5.0.0")] [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 GreatswordIdle { [BepInPlugin("com.greatswordidle.valheim", "Greatsword Idle", "0.5.0")] public sealed class Plugin : BaseUnityPlugin { public const string PluginGuid = "com.greatswordidle.valheim"; public const string PluginName = "Greatsword Idle"; public const string PluginVersion = "0.5.0"; internal static ManualLogSource Log; private Harmony _harmony; private void Awake() { //IL_0011: Unknown result type (might be due to invalid IL or missing references) //IL_001b: Expected O, but got Unknown Log = ((BaseUnityPlugin)this).Logger; _harmony = new Harmony("com.greatswordidle.valheim"); try { _harmony.PatchAll(); Log.LogInfo((object)"Greatsword Idle 0.5.0 loaded."); } catch (Exception arg) { Log.LogError((object)$"Failed to patch Valheim: {arg}"); } } private void OnDestroy() { Harmony harmony = _harmony; if (harmony != null) { harmony.UnpatchSelf(); } } } [HarmonyPatch(typeof(Humanoid), "SetupAnimationState")] internal static class Humanoid_SetupAnimationState_Patch { private static readonly MethodInfo SetAnimationState = AccessTools.Method(typeof(Humanoid), "SetAnimationState", (Type[])null, (Type[])null); [HarmonyPostfix] private static void Postfix(Humanoid __instance, ItemData ___m_rightItem) { //IL_0025: Unknown result type (might be due to invalid IL or missing references) //IL_002c: Invalid comparison between Unknown and I4 //IL_0034: Unknown result type (might be due to invalid IL or missing references) //IL_003b: Invalid comparison between Unknown and I4 //IL_0043: Unknown result type (might be due to invalid IL or missing references) //IL_0049: Invalid comparison between Unknown and I4 try { if (!(__instance is Player)) { return; } if (___m_rightItem == null || ___m_rightItem.m_shared == null || ((int)___m_rightItem.m_shared.m_animationState != 13 && ((int)___m_rightItem.m_shared.m_itemType != 14 || (int)___m_rightItem.m_shared.m_skillType != 1))) { return; } if (SetAnimationState == null) { ManualLogSource log = Plugin.Log; if (log != null) { log.LogError((object)"Humanoid.SetAnimationState not found."); } } else { SetAnimationState.Invoke(__instance, new object[1] { (object)(AnimationState)2 }); } } catch (Exception arg) { ManualLogSource log2 = Plugin.Log; if (log2 != null) { log2.LogError((object)$"Animation patch error: {arg}"); } } } } }