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 Shovel Swing Input Buffer v1.0.1
ShovelSwingBufferInput-V1.1.dll
Decompiled 4 hours agousing System; using System.Collections; using System.Collections.Generic; using System.Diagnostics; 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.IgnoreSymbolStoreSequencePoints)] [assembly: AssemblyTitle("Lethal-ShovelSwingBufferInput")] [assembly: AssemblyDescription("")] [assembly: AssemblyConfiguration("")] [assembly: AssemblyCompany("")] [assembly: AssemblyProduct("Lethal-ShovelSwingBufferInput")] [assembly: AssemblyCopyright("Copyright © 2026")] [assembly: AssemblyTrademark("")] [assembly: ComVisible(false)] [assembly: Guid("917a4972-ef39-47cc-a677-e3e0750233c3")] [assembly: AssemblyFileVersion("1.0.0.0")] [assembly: TargetFramework(".NETFramework,Version=v4.8", FrameworkDisplayName = ".NET Framework 4.8")] [assembly: AssemblyVersion("1.0.0.0")] namespace ShovelSwingInputBuffer; [BepInPlugin("com.mystictornado.shovelswinginputbuffer", "ShovelSwingInputBuffer", "1.0.0")] public class ShovelSwingInputBuffer : BaseUnityPlugin { [HarmonyPatch(typeof(Shovel), "ItemActivate")] public static class Patch_Sovel_ItemActivate { [HarmonyPrefix] private static void PrefixShovelActivate(Shovel __instance, ref bool __state) { __state = (Object)(object)__instance != (Object)null && __instance.reelingUp; } [HarmonyPostfix] private static void PostfixShovelActivate(Shovel __instance, bool buttonDown, bool __state) { if (!ActiveReplaySwings.Contains(__instance) && !((Object)(object)__instance == (Object)null) && buttonDown && ((GrabbableObject)__instance).isHeld && !((Object)(object)((GrabbableObject)__instance).playerHeldBy == (Object)null) && __state) { if (QueuedSwings.Add(__instance)) { ((MonoBehaviour)__instance).StartCoroutine(TriggerBufferedSwing(__instance)); } Logger.LogDebug((object)"Queued shovel swing"); } } } [CompilerGenerated] private sealed class <>c__DisplayClass10_0 { public Shovel shovel; internal bool <TriggerBufferedSwing>b__0() { if (!((Object)(object)shovel == (Object)null)) { return !shovel.reelingUp; } return true; } } [CompilerGenerated] private sealed class <TriggerBufferedSwing>d__10 : IEnumerator<object>, IDisposable, IEnumerator { private int <>1__state; private object <>2__current; public Shovel shovel; private <>c__DisplayClass10_0 <>8__1; object IEnumerator<object>.Current { [DebuggerHidden] get { return <>2__current; } } object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } [DebuggerHidden] public <TriggerBufferedSwing>d__10(int <>1__state) { this.<>1__state = <>1__state; } [DebuggerHidden] void IDisposable.Dispose() { <>8__1 = null; <>1__state = -2; } private bool MoveNext() { //IL_0074: Unknown result type (might be due to invalid IL or missing references) //IL_007e: Expected O, but got Unknown switch (<>1__state) { default: return false; case 0: <>1__state = -1; <>8__1 = new <>c__DisplayClass10_0(); <>8__1.shovel = shovel; if ((Object)(object)<>8__1.shovel == (Object)null) { return false; } Logger.LogInfo((object)"started waiter for queued swing"); <>2__current = (object)new WaitUntil((Func<bool>)(() => (Object)(object)<>8__1.shovel == (Object)null || !<>8__1.shovel.reelingUp)); <>1__state = 1; return true; case 1: <>1__state = -1; Logger.LogInfo((object)"Shovel no longer waiting, queue swing triggering"); if ((Object)(object)<>8__1.shovel == (Object)null) { return false; } if (!((GrabbableObject)<>8__1.shovel).isHeld || (Object)(object)((GrabbableObject)<>8__1.shovel).playerHeldBy == (Object)null) { QueuedSwings.Remove(<>8__1.shovel); return false; } if (!QueuedSwings.Remove(<>8__1.shovel)) { Logger.LogInfo((object)"Swing thrown out, not triggering"); return false; } Logger.LogInfo((object)"Replaying buffered shovel swing"); ActiveReplaySwings.Add(<>8__1.shovel); ((GrabbableObject)<>8__1.shovel).ItemActivate(true, true); <>2__current = null; <>1__state = 2; return true; case 2: <>1__state = -1; ((GrabbableObject)<>8__1.shovel).ItemActivate(true, false); ActiveReplaySwings.Remove(<>8__1.shovel); return false; } } bool IEnumerator.MoveNext() { //ILSpy generated this explicit interface implementation from .override directive in MoveNext return this.MoveNext(); } [DebuggerHidden] void IEnumerator.Reset() { throw new NotSupportedException(); } } public const string GUID = "com.mystictornado.shovelswinginputbuffer"; public const string NAME = "ShovelSwingInputBuffer"; public const string VERSION = "1.0.0"; internal static readonly HashSet<Shovel> QueuedSwings = new HashSet<Shovel>(); internal static readonly HashSet<Shovel> ActiveReplaySwings = new HashSet<Shovel>(); internal static ManualLogSource Logger { get; private set; } private void Awake() { //IL_0010: Unknown result type (might be due to invalid IL or missing references) Logger = ((BaseUnityPlugin)this).Logger; Harmony val = new Harmony("com.mystictornado.shovelswinginputbuffer"); Logger.LogInfo((object)"Patching ShovelSwingInputBuffer..."); val.PatchAll(); Logger.LogInfo((object)"ShovelSwingInputBuffer Patched"); Logger.LogInfo((object)"com.mystictornado.shovelswinginputbuffer v1.0.0 has loaded!"); } [IteratorStateMachine(typeof(<TriggerBufferedSwing>d__10))] internal static IEnumerator TriggerBufferedSwing(Shovel shovel) { //yield-return decompiler failed: Unexpected instruction in Iterator.Dispose() return new <TriggerBufferedSwing>d__10(0) { shovel = shovel }; } }