using System;
using System.Diagnostics;
using System.IO;
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.Versioning;
using System.Security;
using System.Security.Permissions;
using BepInEx;
using BepInEx.Bootstrap;
using BepInEx.Logging;
using Dawn;
using LobbyCompatibility.Enums;
using LobbyCompatibility.Features;
using Microsoft.CodeAnalysis;
using Nhoj1000.CinnasBun.NetcodePatcher;
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("Nhoj1000.CinnasBun")]
[assembly: AssemblyConfiguration("Debug")]
[assembly: AssemblyFileVersion("1.3.0.0")]
[assembly: AssemblyInformationalVersion("1.3.0")]
[assembly: AssemblyProduct("CinnasBun")]
[assembly: AssemblyTitle("Nhoj1000.CinnasBun")]
[assembly: SecurityPermission(SecurityAction.RequestMinimum, SkipVerification = true)]
[assembly: AssemblyVersion("1.3.0.0")]
[module: UnverifiableCode]
[module: RefSafetyRules(11)]
[module: NetcodePatchedAssembly]
namespace Microsoft.CodeAnalysis
{
[CompilerGenerated]
[Microsoft.CodeAnalysis.Embedded]
internal sealed class EmbeddedAttribute : Attribute
{
}
}
namespace System.Runtime.CompilerServices
{
[CompilerGenerated]
[Microsoft.CodeAnalysis.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]
[Microsoft.CodeAnalysis.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]
[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 CinnasBun
{
[BepInPlugin("Nhoj1000.CinnasBun", "CinnasBun", "1.3.0")]
[BepInDependency(/*Could not decode attribute arguments.*/)]
[BepInDependency(/*Could not decode attribute arguments.*/)]
public class CinnasBun : BaseUnityPlugin
{
private static class ItemKeys
{
public static readonly NamespacedKey<DawnItemInfo> CinnasBun = NamespacedKey<DawnItemInfo>.From("cinnas_bun", "cinnas_bun");
}
private static ManualLogSource Logger { get; set; }
private void Awake()
{
Logger = ((BaseUnityPlugin)this).Logger;
if (Chainloader.PluginInfos.ContainsKey("BMX.LobbyCompatibility"))
{
LobbyCompatibilityCompat();
}
else
{
Logger.LogInfo((object)"LobbyCompatibility by BMX not found, skipping...");
}
string directoryName = Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location);
AssetBundle val = AssetBundle.LoadFromFile(Path.Combine(directoryName, "cinnasbunbundle"));
if ((Object)(object)val == (Object)null)
{
Logger.LogError((object)"Failed to load custom assets.");
}
else
{
Item val2 = val.LoadAsset<Item>("Assets/LethalCompany/Mods/CinnasBun/CinnasBun.asset");
DawnLib.DefineItem(ItemKeys.CinnasBun, val2, (Action<ItemInfoBuilder>)delegate(ItemInfoBuilder builder)
{
builder.DefineScrap((Action<ScrapBuilder>)delegate(ScrapBuilder scrapBuilder)
{
scrapBuilder.SetWeights((Action<WeightTableBuilder<DawnMoonInfo>>)delegate(WeightTableBuilder<DawnMoonInfo> tableBuilder)
{
tableBuilder.AddTagWeight(Tags.All, 30);
});
});
});
}
Logger.LogInfo((object)"Nhoj1000.CinnasBun v1.3.0 has loaded!");
}
private static void LobbyCompatibilityCompat()
{
Logger.LogInfo((object)"LobbyCompatibility by BMX found. Registering Nhoj1000.CinnasBun with LobbyCompatibility.");
PluginHelper.RegisterPlugin("Nhoj1000.CinnasBun", Version.Parse("1.3.0"), (CompatibilityLevel)2, (VersionStrictness)2);
Logger.LogInfo((object)"Nhoj1000.CinnasBun registered with LobbyCompatibility by BMX.");
}
}
public static class MyPluginInfo
{
public const string PLUGIN_GUID = "Nhoj1000.CinnasBun";
public const string PLUGIN_NAME = "CinnasBun";
public const string PLUGIN_VERSION = "1.3.0";
}
}
namespace __GEN
{
internal class NetworkVariableSerializationHelper
{
[RuntimeInitializeOnLoadMethod]
internal static void InitializeSerialization()
{
}
}
}
namespace Nhoj1000.CinnasBun.NetcodePatcher
{
[AttributeUsage(AttributeTargets.Module)]
internal class NetcodePatchedAssemblyAttribute : Attribute
{
}
}