Decompiled source of TestMod v2.0.8

Plugins/Bear/LethalLibScrapLoader.dll

Decompiled 2 years 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.Logging;
using LethalLib.Modules;
using Microsoft.CodeAnalysis;
using UnityEngine;

[assembly: CompilationRelaxations(8)]
[assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)]
[assembly: Debuggable(DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints)]
[assembly: TargetFramework(".NETStandard,Version=v2.1", FrameworkDisplayName = ".NET Standard 2.1")]
[assembly: AssemblyCompany("LethalLibScrapLoader")]
[assembly: AssemblyConfiguration("Release")]
[assembly: AssemblyDescription("Scrap Loader using Lethal Lib")]
[assembly: AssemblyFileVersion("1.0.0.0")]
[assembly: AssemblyInformationalVersion("1.0.0+1348bff75c3860b66b1a077482a37b4957993af3")]
[assembly: AssemblyProduct("LethalLibScrapLoader")]
[assembly: AssemblyTitle("LethalLibScrapLoader")]
[assembly: SecurityPermission(SecurityAction.RequestMinimum, SkipVerification = true)]
[assembly: AssemblyVersion("1.0.0.0")]
[module: UnverifiableCode]
[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 BepInEx5Plugin1
{
	public static class PluginInfo
	{
		public const string PLUGIN_GUID = "LethalLibScrapLoader";

		public const string PLUGIN_NAME = "LethalLibScrapLoader";

		public const string PLUGIN_VERSION = "1.0.0";
	}
}
namespace LethalLibScrapLoader
{
	public static class PluginInformation
	{
		public const string PluginName = "LethalLibScrapLoader";

		public const string PluginVersion = "1.0.0";

		public const string PluginGuid = "diyagi.LethalLibScrapLoader";
	}
	[BepInPlugin("diyagi.LethalLibScrapLoader", "LethalLibScrapLoader", "1.0.0")]
	[BepInDependency(/*Could not decode attribute arguments.*/)]
	public class Plugin : BaseUnityPlugin
	{
		internal ManualLogSource _staticLogger;

		public static AssetBundle bearAseets;

		private void Awake()
		{
			_staticLogger = Logger.CreateLogSource("diyagi.LethalLibScrapLoader");
			bearAseets = AssetBundle.LoadFromFile(Path.Combine(Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location), "teddybear"));
			string[] allAssetNames = bearAseets.GetAllAssetNames();
			foreach (string text in allAssetNames)
			{
				_staticLogger.LogInfo((object)text);
			}
			_staticLogger.LogInfo((object)"Loading Bear '-'7");
			Item val = bearAseets.LoadAsset<Item>("Assets/BearItem.asset");
			if ((Object)(object)val == (Object)null)
			{
				_staticLogger.LogError((object)"Failed to load Bear :c");
				return;
			}
			NetworkPrefabs.RegisterNetworkPrefab(val.spawnPrefab);
			Items.RegisterScrap(val, 30, (LevelTypes)510);
		}
	}
}

Plugins/PandaCosmetics/PandaCosmetics.dll

Decompiled 2 years ago
using System;
using System.Collections.Generic;
using System.Diagnostics;
using System.Linq;
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.Versioning;
using BepInEx;
using BepInEx.Logging;
using Microsoft.CodeAnalysis;
using MoreCompany.Cosmetics;
using MoreCompany.Utils;
using UnityEngine;

[assembly: CompilationRelaxations(8)]
[assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)]
[assembly: Debuggable(DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints)]
[assembly: TargetFramework(".NETFramework,Version=v4.7.2", FrameworkDisplayName = ".NET Framework 4.7.2")]
[assembly: AssemblyVersion("0.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 PandaCosmetics
{
	public static class PluginInformation
	{
		public const string PluginName = "Panda Cosmetics";

		public const string PluginVersion = "2.0.4";

		public const string PluginGuid = "diyagi.PandaCosmetics";
	}
	[BepInPlugin("diyagi.PandaCosmetics", "Panda Cosmetics", "2.0.4")]
	[BepInDependency(/*Could not decode attribute arguments.*/)]
	public class Plugin : BaseUnityPlugin
	{
		private static Assembly _executingAssembly;

		private static ManualLogSource _staticLogger;

		private void Awake()
		{
			_staticLogger = ((BaseUnityPlugin)this).Logger;
			_staticLogger.LogInfo((object)"Loading Panda Cosmetics...");
			_executingAssembly = Assembly.GetExecutingAssembly();
			GetEmbeddedBundlesNames().ForEach(LoadBundle);
			_staticLogger.LogInfo((object)"Panda Cosmetics Loaded!!!");
		}

		private static List<string> GetEmbeddedBundlesNames()
		{
			return (from x in _executingAssembly.GetManifestResourceNames()
				where x.Contains(".cosmetic")
				select x).ToList();
		}

		private static void LoadBundle(string bundleResourceName)
		{
			_staticLogger.LogInfo((object)("Found AssetBundle " + bundleResourceName + "..."));
			LoadCosmeticsFromBundle(BundleUtilities.LoadBundleFromInternalAssembly(bundleResourceName, _executingAssembly));
		}

		private static void LoadCosmeticsFromBundle(AssetBundle bundle)
		{
			string[] allAssetNames = bundle.GetAllAssetNames();
			foreach (string text in allAssetNames)
			{
				if (text.EndsWith(".prefab"))
				{
					CosmeticInstance component = AssetBundleExtension.LoadPersistentAsset<GameObject>(bundle, text).GetComponent<CosmeticInstance>();
					if (!((Object)(object)component == (Object)null))
					{
						_staticLogger.LogInfo((object)("Loaded cosmetic: " + component.cosmeticId + " from bundle"));
						CosmeticRegistry.cosmeticInstances.Add(component.cosmeticId, component);
					}
				}
			}
		}
	}
}