Decompiled source of Potatoes Suits v1.0.0

plugin/PotatoesSuits.dll

Decompiled 4 hours ago
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.Configuration;
using BepInEx.Logging;
using HarmonyLib;
using LethalLib.Modules;
using Microsoft.CodeAnalysis;
using PotatoesSuits.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: IgnoresAccessChecksTo("Assembly-CSharp")]
[assembly: AssemblyCompany("PotatoesSuits")]
[assembly: AssemblyConfiguration("Debug")]
[assembly: AssemblyFileVersion("0.0.0.0")]
[assembly: AssemblyInformationalVersion("0.0.0-alpha.0")]
[assembly: AssemblyProduct("PotatoesSuits")]
[assembly: AssemblyTitle("PotatoesSuits")]
[assembly: SecurityPermission(SecurityAction.RequestMinimum, SkipVerification = true)]
[assembly: AssemblyVersion("0.0.0.0")]
[module: UnverifiableCode]
[module: RefSafetyRules(11)]
[module: NetcodePatchedAssembly]
internal class <Module>
{
	static <Module>()
	{
	}
}
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 YourThunderstoreTeam
{
	public static class PluginInfo
	{
		public const string PLUGIN_GUID = "PotatoesSuits";

		public const string PLUGIN_NAME = "PotatoesSuits";

		public const string PLUGIN_VERSION = "1.0.0";
	}
}
namespace PotatoScrap
{
	[BepInPlugin("com.potato.scrap", "Potato", "1.0")]
	[BepInDependency(/*Could not decode attribute arguments.*/)]
	public class PotatoMod : BaseUnityPlugin
	{
		private const string modGUID = "com.potato.scrap";

		private const string modName = "Potato";

		private const string modVersion = "1.0";

		private readonly Harmony harmony = new Harmony("com.potato.scrap");

		private static PotatoMod Instance;

		private ConfigEntry<int> configDebug;

		internal ManualLogSource mls;

		public static AssetBundle Assets;

		private void Awake()
		{
			//IL_0097: Unknown result type (might be due to invalid IL or missing references)
			//IL_00a1: Expected O, but got Unknown
			if ((Object)(object)Instance == (Object)null)
			{
				Instance = this;
			}
			Assets = AssetBundle.LoadFromFile(Path.Combine(Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location), "Potato"));
			mls = Logger.CreateLogSource("com.potato.scrap");
			mls.LogInfo((object)"Potato [Version 1.0]...");
			harmony.PatchAll(typeof(PotatoMod));
			configDebug = ((BaseUnityPlugin)this).Config.Bind<int>("General", "Debug", 20, new ConfigDescription("How rare is it to find. Lower values mean less spawns", (AcceptableValueBase)(object)new AcceptableValueRange<int>(0, 100), Array.Empty<object>()));
			Item val = Assets.LoadAsset<Item>("assets/export/potato.asset");
			if ((Object)(object)val == (Object)null)
			{
				mls.LogError((object)"Failed to load Potato prefab.");
				return;
			}
			NetworkPrefabs.RegisterNetworkPrefab(val.spawnPrefab);
			Items.RegisterScrap(val, configDebug.Value, (LevelTypes)(-1));
		}
	}
}
namespace System.Runtime.CompilerServices
{
	[AttributeUsage(AttributeTargets.Assembly, AllowMultiple = true)]
	internal sealed class IgnoresAccessChecksToAttribute : Attribute
	{
		public IgnoresAccessChecksToAttribute(string assemblyName)
		{
		}
	}
}
namespace PotatoesSuits.NetcodePatcher
{
	[AttributeUsage(AttributeTargets.Module)]
	internal class NetcodePatchedAssemblyAttribute : Attribute
	{
	}
}