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 LessFragileGlassValuables v1.0.0
plugins/LessFragileGlassValuables.dll
Decompiled a year 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.Default | DebuggableAttribute.DebuggingModes.DisableOptimizations | DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints | DebuggableAttribute.DebuggingModes.EnableEditAndContinue)] [assembly: TargetFramework(".NETStandard,Version=v2.1", FrameworkDisplayName = ".NET Standard 2.1")] [assembly: AssemblyCompany("LessFragileGlassValuables")] [assembly: AssemblyConfiguration("Debug")] [assembly: AssemblyFileVersion("1.0.0.0")] [assembly: AssemblyInformationalVersion("1.0.0")] [assembly: AssemblyProduct("LessFragileGlassValuables")] [assembly: AssemblyTitle("LessFragileGlassValuables")] [assembly: AssemblyVersion("1.0.0.0")] [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 LessFragileGlassValuables { [BepInPlugin("LessFragileGlassValuables", "Less Fragile Glass Valuables", "1.0.0")] public class LessFragileGlassValuables : BaseUnityPlugin { public static ManualLogSource Logger; private Harmony harmony; public static ConfigEntry<int> configFragility; public static ConfigEntry<int> configDurability; public void Awake() { //IL_0012: Unknown result type (might be due to invalid IL or missing references) //IL_001c: Expected O, but got Unknown Logger = ((BaseUnityPlugin)this).Logger; harmony = new Harmony("LessFragileGlassValuables"); harmony.PatchAll(Assembly.GetExecutingAssembly()); SetupConfig(); Logger.LogInfo((object)"Less Fragile Glass Valuables has loaded!"); } private void SetupConfig() { //IL_0025: Unknown result type (might be due to invalid IL or missing references) //IL_002f: Expected O, but got Unknown //IL_0058: Unknown result type (might be due to invalid IL or missing references) //IL_0062: Expected O, but got Unknown configFragility = ((BaseUnityPlugin)this).Config.Bind<int>("Config", "Fragility", 75, new ConfigDescription("Glass item fragility. The normal fragility for items is 50 and for glass is 100.", (AcceptableValueBase)(object)new AcceptableValueRange<int>(0, 100), Array.Empty<object>())); configDurability = ((BaseUnityPlugin)this).Config.Bind<int>("Config", "Durability", 50, new ConfigDescription("Glass item durability. The normal durability for items is 100 and for glass is 0.", (AcceptableValueBase)(object)new AcceptableValueRange<int>(0, 100), Array.Empty<object>())); } } public class PluginInfo { public const string PLUGIN_GUID = "LessFragileGlassValuables"; public const string PLUGIN_NAME = "Less Fragile Glass Valuables"; public const string PLUGIN_VERSION = "1.0.0"; } } namespace LessFragileGlassValuables.Patches { [HarmonyPatch] public class Patches { [HarmonyPatch(typeof(PhysGrabObjectImpactDetector), "Start")] [HarmonyPostfix] public static void Start(PhysGrabObjectImpactDetector __instance) { if (SemiFunc.IsMasterClientOrSingleplayer() && Object.op_Implicit((Object)(object)((Component)__instance).GetComponent<ValuableObject>()) && __instance.fragility == 100f && __instance.durability == 0f) { __instance.fragility = LessFragileGlassValuables.configFragility.Value; __instance.durability = LessFragileGlassValuables.configDurability.Value; } } } }