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 ShovelFix v1.1.0
shovelFix.dll
Decompiled 2 years 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.Logging; using GameNetcodeStuff; using IL; using Microsoft.CodeAnalysis; using Mono.Cecil.Cil; using MonoMod.Cil; using On; using ShovelFixPatch; using UnityEngine; using shovelFix; [assembly: CompilationRelaxations(8)] [assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)] [assembly: Debuggable(DebuggableAttribute.DebuggingModes.Default | DebuggableAttribute.DebuggingModes.DisableOptimizations | DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints | DebuggableAttribute.DebuggingModes.EnableEditAndContinue)] [assembly: TargetFramework(".NETStandard,Version=v2.1", FrameworkDisplayName = ".NET Standard 2.1")] [assembly: IgnoresAccessChecksTo("Assembly-CSharp")] [assembly: AssemblyCompany("shovelFix")] [assembly: AssemblyConfiguration("Debug")] [assembly: AssemblyDescription("My first plugin")] [assembly: AssemblyFileVersion("1.0.0.0")] [assembly: AssemblyInformationalVersion("1.0.0")] [assembly: AssemblyProduct("shovelFix")] [assembly: AssemblyTitle("shovelFix")] [assembly: SecurityPermission(SecurityAction.RequestMinimum, SkipVerification = true)] [assembly: AssemblyVersion("1.0.0.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 shovelFix { [BepInPlugin("shovelFix", "shovelFix", "1.0.0")] public class Plugin : BaseUnityPlugin { private const string modName = "Shovel Hotfix"; private const string modVersion = "1.0.0"; private const string modGUID = "Rocksnotch.ShovelHotfix"; internal static Plugin Instance; public static ManualLogSource logSrc = Logger.CreateLogSource("loggingSource"); private void Awake() { if ((Object)(object)Instance == (Object)null) { Instance = this; } try { ShovelFix.Init(); logSrc.LogInfo((object)"Patched ShovelFix!"); } catch (Exception ex) { logSrc.LogError((object)("Error Patching Files: " + ex.Message)); } logSrc.LogInfo((object)"Plugin Rocksnotch.ShovelHotfix is loaded!"); } } public static class PluginInfo { public const string PLUGIN_GUID = "shovelFix"; public const string PLUGIN_NAME = "shovelFix"; public const string PLUGIN_VERSION = "1.0.0"; } } namespace ShovelFixPatch { internal class ShovelFix { [CompilerGenerated] private static class <>O { public static Manipulator <0>__HitShovel; public static hook_Start <1>__Start; } public GameObject MapCamera = null; public static void Init() { //IL_0011: Unknown result type (might be due to invalid IL or missing references) //IL_0016: Unknown result type (might be due to invalid IL or missing references) //IL_001c: Expected O, but got Unknown //IL_0032: Unknown result type (might be due to invalid IL or missing references) //IL_0037: Unknown result type (might be due to invalid IL or missing references) //IL_003d: Expected O, but got Unknown object obj = <>O.<0>__HitShovel; if (obj == null) { Manipulator val = HitShovel; <>O.<0>__HitShovel = val; obj = (object)val; } Shovel.HitShovel += (Manipulator)obj; object obj2 = <>O.<1>__Start; if (obj2 == null) { hook_Start val2 = Start; <>O.<1>__Start = val2; obj2 = (object)val2; } StartOfRound.Start += (hook_Start)obj2; } private static void Start(orig_Start orig, StartOfRound self) { orig.Invoke(self); try { Plugin.logSrc.LogWarning((object)("VolumeMain (1) LayerMask Name: " + LayerMask.LayerToName(8))); } catch (NullReferenceException) { Plugin.logSrc.LogError((object)"NullReferenceException: VolumeMain (1) not found!"); } } private static void HitShovel(ILContext il) { //IL_0002: Unknown result type (might be due to invalid IL or missing references) //IL_0008: Expected O, but got Unknown ILCursor val = new ILCursor(il); Plugin.logSrc.LogMessage((object)"HitShovel IL Patch Start!"); if (val.TryGotoNext(new Func<Instruction, bool>[6] { (Instruction x) => ILPatternMatchingExt.MatchLdarg(x, 0), (Instruction x) => ILPatternMatchingExt.MatchLdarg(x, 0), (Instruction x) => ILPatternMatchingExt.MatchLdfld<Shovel>(x, "previousPlayerHeldBy"), (Instruction x) => ILPatternMatchingExt.MatchLdfld<PlayerControllerB>(x, "gameplayCamera"), (Instruction x) => ILPatternMatchingExt.MatchCallvirt<Component>(x, "get_transform"), (Instruction x) => ILPatternMatchingExt.MatchCallvirt<Transform>(x, "get_position") })) { Plugin.logSrc.LogMessage((object)"Try Goto Next Success!"); int index = val.Index; val.Index = index + 1; val.RemoveRange(25); val.EmitDelegate<Action<Shovel>>((Action<Shovel>)delegate(Shovel instance) { //IL_0012: Unknown result type (might be due to invalid IL or missing references) //IL_0027: Unknown result type (might be due to invalid IL or missing references) //IL_0031: Unknown result type (might be due to invalid IL or missing references) //IL_0036: Unknown result type (might be due to invalid IL or missing references) //IL_0050: Unknown result type (might be due to invalid IL or missing references) instance.objectsHitByShovel = Physics.SphereCastAll(((Component)instance.previousPlayerHeldBy.gameplayCamera).transform.position + ((Component)instance.previousPlayerHeldBy.gameplayCamera).transform.forward * 0.5f, 0.3f, ((Component)instance.previousPlayerHeldBy.gameplayCamera).transform.forward, 1.85f, instance.shovelMask, (QueryTriggerInteraction)2); }); } else { Plugin.logSrc.LogError((object)"Try Goto Next Failed! Bad IL Code!"); } } } } namespace System.Runtime.CompilerServices { [AttributeUsage(AttributeTargets.Assembly, AllowMultiple = true)] internal sealed class IgnoresAccessChecksToAttribute : Attribute { public IgnoresAccessChecksToAttribute(string assemblyName) { } } }