Decompiled source of CZmix update v1.0.1

LethalCZmpany.dll

Decompiled a year ago
using System.Diagnostics;
using System.IO;
using System.Reflection;
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("LethalCZmpany")]
[assembly: AssemblyDescription("")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("")]
[assembly: AssemblyProduct("LethalCZmpany")]
[assembly: AssemblyCopyright("Copyright ©  2024")]
[assembly: AssemblyTrademark("")]
[assembly: ComVisible(false)]
[assembly: Guid("923dc715-ec31-48a4-848f-a9c03c5125d4")]
[assembly: AssemblyFileVersion("1.0.0.0")]
[assembly: TargetFramework(".NETFramework,Version=v4.8.1", FrameworkDisplayName = ".NET Framework 4.8.1")]
[assembly: AssemblyVersion("1.0.0.0")]
namespace LethalCZmpany;

[BepInPlugin("decxi-lethalczmpany", "LethalCZmpany", "0.7.3.0")]
public class Base : BaseUnityPlugin
{
	public const string GUID = "decxi-lethalczmpany";

	public const string Name = "LethalCZmpany";

	public const string Version = "0.7.3.0";

	private readonly Harmony harmony = new Harmony("decxi-lethalczmpany");

	public static Base instance;

	internal ManualLogSource logger;

	private void Awake()
	{
		if ((Object)(object)instance == (Object)null)
		{
			instance = this;
		}
		logger = Logger.CreateLogSource("decxi-lethalczmpany");
		LogInfo("LethalCZmpany patching...");
		LoadBundleItems();
		harmony.PatchAll(typeof(Base));
		LogInfo("Lethal CZmpany patched successfully!");
	}

	private void LoadBundleItems()
	{
		string text = Path.Combine(Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location), "itemmod");
		AssetBundle val = AssetBundle.LoadFromFile(text);
		Item[] array = val.LoadAllAssets<Item>();
		Item[] array2 = array;
		foreach (Item val2 in array2)
		{
			NetworkPrefabs.RegisterNetworkPrefab(val2.spawnPrefab);
			Utilities.FixMixerGroups(val2.spawnPrefab);
			Items.RegisterScrap(val2, 50, (LevelTypes)(-1));
		}
	}

	private void LogInfo(object data)
	{
		logger.LogInfo(data);
	}

	private void LogDebug(object data)
	{
		logger.LogDebug(data);
	}

	private void LogWarning(object data)
	{
		logger.LogWarning(data);
	}

	private void LogError(object data)
	{
		logger.LogError(data);
	}
}