using System;
using System.Diagnostics;
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.Versioning;
using BepInEx;
using BepInEx.Core.Logging.Interpolation;
using BepInEx.Logging;
using BepInEx.NET.Common;
using BepInExResoniteShim;
using Elements.Core;
using HarmonyLib;
[assembly: CompilationRelaxations(8)]
[assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)]
[assembly: Debuggable(/*Could not decode attribute arguments.*/)]
[assembly: TargetFramework(".NETCoreApp,Version=v10.0", FrameworkDisplayName = ".NET 10.0")]
[assembly: AssemblyCompany("Gyztor Mizirath")]
[assembly: AssemblyConfiguration("Release")]
[assembly: AssemblyFileVersion("1.0.0.0")]
[assembly: AssemblyInformationalVersion("1.0.0+b3fb1e2c11666426136a6d3601c30d34d9fa650a")]
[assembly: AssemblyProduct("DontCrashDecimal")]
[assembly: AssemblyTitle("DontCrashDecimal")]
[assembly: AssemblyMetadata("RepositoryUrl", "https://github.com/Gyztor/DontCrashDecimal")]
[assembly: AssemblyVersion("1.0.0.0")]
[module: RefSafetyRules(11)]
namespace DontCrashDecimal;
[ResonitePlugin("xyz.gyztormizirath.DontCrashDecimal", "DontCrashDecimal", "1.0.0", "Gyztor Mizirath", "https://github.com/Gyztor/DontCrashDecimal")]
[BepInDependency(/*Could not decode attribute arguments.*/)]
public class DontCrashDecimal : BasePlugin
{
[HarmonyPatchCategory("ValueModDecimal")]
[HarmonyPatch(typeof(Coder<decimal>), "Mod")]
private static class ValueModDecimal
{
[HarmonyPatch]
private static bool Prefix(decimal b)
{
return b != 0m;
}
}
internal static ManualLogSource Log;
public override void Load()
{
//IL_0032: Unknown result type (might be due to invalid IL or missing references)
//IL_0038: Expected O, but got Unknown
Log = ((BasePlugin)this).Log;
try
{
((BasePlugin)this).HarmonyInstance.PatchAll();
Log.LogInfo((object)"Dont Crash Decimal has Loaded!");
}
catch (global::System.Exception ex)
{
ManualLogSource log = Log;
bool flag = default(bool);
BepInExErrorLogInterpolatedStringHandler val = new BepInExErrorLogInterpolatedStringHandler(36, 1, ref flag);
if (flag)
{
((BepInExLogInterpolatedStringHandler)val).AppendLiteral("Dont Crash Decimal failed to patch: ");
((BepInExLogInterpolatedStringHandler)val).AppendFormatted<global::System.Exception>(ex);
}
log.LogError(val);
}
}
}
public static class PluginMetadata
{
public const string GUID = "xyz.gyztormizirath.DontCrashDecimal";
public const string NAME = "DontCrashDecimal";
public const string VERSION = "1.0.0";
public const string AUTHORS = "Gyztor Mizirath";
public const string REPOSITORY_URL = "https://github.com/Gyztor/DontCrashDecimal";
}