Decompiled source of Small Bolt v1.0.0

SmallBolt.dll

Decompiled 2 months ago
using System.CodeDom.Compiler;
using System.ComponentModel;
using System.Diagnostics;
using System.Globalization;
using System.IO;
using System.Reflection;
using System.Resources;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;
using System.Runtime.Versioning;
using BepInEx;
using BepInEx.Logging;
using HarmonyLib;
using LethalLib.Modules;
using UnityEngine;

[assembly: CompilationRelaxations(8)]
[assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)]
[assembly: Debuggable(DebuggableAttribute.DebuggingModes.Default | DebuggableAttribute.DebuggingModes.DisableOptimizations | DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints | DebuggableAttribute.DebuggingModes.EnableEditAndContinue)]
[assembly: AssemblyTitle("SmallBolt")]
[assembly: AssemblyDescription("")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("")]
[assembly: AssemblyProduct("SmallBolt")]
[assembly: AssemblyCopyright("Copyright ©  2024")]
[assembly: AssemblyTrademark("")]
[assembly: ComVisible(false)]
[assembly: Guid("3be1f173-5a3b-4c0c-8b1d-722a1b64bf46")]
[assembly: AssemblyFileVersion("1.0.0.0")]
[assembly: TargetFramework(".NETFramework,Version=v4.7.2", FrameworkDisplayName = ".NET Framework 4.7.2")]
[assembly: AssemblyVersion("1.0.0.0")]
namespace SmallBolt
{
	[BepInPlugin("com.Dummydude.SmallBolt", "SmallBolt", "1.0.0")]
	public class Plugin : BaseUnityPlugin
	{
		public const string PLUGIN_GUID = "com.Dummydude.SmallBolt";

		public const string PLUGIN_NAME = "SmallBolt";

		public const string PLUGIN_VERSION = "1.0.0";

		internal static AssetBundle assetBundle;

		private readonly Harmony _harmony = new Harmony("com.Dummydude.SmallBolt");

		public static ManualLogSource Log => ((BaseUnityPlugin)Instance).Logger;

		public static Plugin Instance { get; private set; }

		private void Awake()
		{
			Instance = this;
			using (Stream stream = Assembly.GetExecutingAssembly().GetManifestResourceStream(GetAssemblyName() + ".smallbolt"))
			{
				assetBundle = AssetBundle.LoadFromStream(stream);
			}
			int num = 30;
			LoadAsset<Item>(assetBundle, "SmallBolt", out Item loadedObject);
			NetworkPrefabs.RegisterNetworkPrefab(loadedObject.spawnPrefab);
			Items.RegisterScrap(loadedObject, num, (LevelTypes)(-1));
			if ((Object)(object)loadedObject != (Object)null)
			{
				Log.LogMessage((object)"Dummydude was here");
			}
			static string GetAssemblyName()
			{
				return Assembly.GetExecutingAssembly().GetName().Name.Replace(" ", "_");
			}
		}

		private static bool LoadAsset<T>(AssetBundle assets, string path, out T loadedObject) where T : Object
		{
			loadedObject = assets.LoadAsset<T>(path);
			return Object.op_Implicit((Object)(object)loadedObject);
		}
	}
}
namespace SmallBolt.Properties
{
	[GeneratedCode("System.Resources.Tools.StronglyTypedResourceBuilder", "17.0.0.0")]
	[DebuggerNonUserCode]
	[CompilerGenerated]
	internal class Resources
	{
		private static ResourceManager resourceMan;

		private static CultureInfo resourceCulture;

		[EditorBrowsable(EditorBrowsableState.Advanced)]
		internal static ResourceManager ResourceManager
		{
			get
			{
				if (resourceMan == null)
				{
					ResourceManager resourceManager = new ResourceManager("SmallBolt.Properties.Resources", typeof(Resources).Assembly);
					resourceMan = resourceManager;
				}
				return resourceMan;
			}
		}

		[EditorBrowsable(EditorBrowsableState.Advanced)]
		internal static CultureInfo Culture
		{
			get
			{
				return resourceCulture;
			}
			set
			{
				resourceCulture = value;
			}
		}

		internal Resources()
		{
		}
	}
}