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 InfiniteEnergy v0.1.0
InfiniteEnergy.dll
Decompiled 3 days agousing System; using System.Diagnostics; using System.Reflection; using System.Runtime.CompilerServices; using System.Runtime.Versioning; using BepInEx; using BepInEx.Configuration; using BepInEx.Logging; 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("InfiniteEnergy")] [assembly: AssemblyConfiguration("Release")] [assembly: AssemblyFileVersion("0.1.0.0")] [assembly: AssemblyInformationalVersion("0.1.0+b7a3e37ca6b8596df1d85c2141d60f0b8ce2bbc3")] [assembly: AssemblyProduct("InfiniteEnergy")] [assembly: AssemblyTitle("InfiniteEnergy")] [assembly: AssemblyVersion("0.1.0.0")] [module: RefSafetyRules(11)] namespace Microsoft.CodeAnalysis { [CompilerGenerated] [Embedded] internal sealed class EmbeddedAttribute : Attribute { } } namespace System.Runtime.CompilerServices { [CompilerGenerated] [Embedded] [AttributeUsage(AttributeTargets.Class | AttributeTargets.Property | AttributeTargets.Field | AttributeTargets.Event | AttributeTargets.Parameter | AttributeTargets.ReturnValue | AttributeTargets.GenericParameter, AllowMultiple = false, Inherited = false)] internal sealed class NullableAttribute : Attribute { public readonly byte[] NullableFlags; public NullableAttribute(byte P_0) { NullableFlags = new byte[1] { P_0 }; } public NullableAttribute(byte[] P_0) { NullableFlags = P_0; } } [CompilerGenerated] [Embedded] [AttributeUsage(AttributeTargets.Class | AttributeTargets.Struct | AttributeTargets.Method | AttributeTargets.Interface | AttributeTargets.Delegate, AllowMultiple = false, Inherited = false)] internal sealed class NullableContextAttribute : Attribute { public readonly byte Flag; public NullableContextAttribute(byte P_0) { Flag = P_0; } } [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 InfiniteEnergy { [BepInPlugin("darkharasho.InfiniteEnergy", "InfiniteEnergy", "0.1.0")] public class Plugin : BaseUnityPlugin { internal static ManualLogSource Log = null; internal static ConfigEntry<bool> Enabled = null; private static readonly FieldRef<RoundDirector, bool> DebugInfiniteBattery = AccessTools.FieldRefAccess<RoundDirector, bool>("debugInfiniteBattery"); private void Awake() { //IL_0059: Unknown result type (might be due to invalid IL or missing references) Log = ((BaseUnityPlugin)this).Logger; Enabled = ((BaseUnityPlugin)this).Config.Bind<bool>("General", "Enabled", true, "Keep every item battery (guns, melee durability, drones, tools) full. The host's setting is what counts."); Enabled.SettingChanged += delegate { Apply(); }; new Harmony("darkharasho.InfiniteEnergy").PatchAll(); Log.LogInfo((object)"InfiniteEnergy v0.1.0 loaded."); } internal static void Apply() { if ((Object)(object)RoundDirector.instance != (Object)null) { DebugInfiniteBattery.Invoke(RoundDirector.instance) = Enabled.Value; } } } [HarmonyPatch(typeof(RoundDirector), "Awake")] internal static class RoundDirectorAwakePatch { private static void Postfix() { Plugin.Apply(); } } [HarmonyPatch(typeof(ItemBattery), "RemoveFullBar")] internal static class RemoveFullBarPatch { private static bool Prefix() { return !Plugin.Enabled.Value; } } public static class PluginInfo { public const string PLUGIN_GUID = "darkharasho.InfiniteEnergy"; public const string PLUGIN_NAME = "InfiniteEnergy"; public const string PLUGIN_VERSION = "0.1.0"; } }