Decompiled source of KweebecPlush v1.0.0

plugins/KwebecPlush/KweebecPlush.dll

Decompiled 11 months 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 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 = "")]
[assembly: AssemblyCompany("KweebecPlush")]
[assembly: AssemblyConfiguration("Debug")]
[assembly: AssemblyDescription("The Kweebec Plush From Hytale")]
[assembly: AssemblyFileVersion("1.0.0.0")]
[assembly: AssemblyInformationalVersion("1.0.0")]
[assembly: AssemblyProduct("KweebecPlush")]
[assembly: AssemblyTitle("KweebecPlush")]
[assembly: SecurityPermission(SecurityAction.RequestMinimum, SkipVerification = true)]
[assembly: AssemblyVersion("1.0.0.0")]
[module: UnverifiableCode]
namespace LethalCompanyTemplate
{
	public static class PluginInfo
	{
		public const string PLUGIN_GUID = "KweebecPlush";

		public const string PLUGIN_NAME = "KweebecPlush";

		public const string PLUGIN_VERSION = "1.0.0";
	}
}
namespace LightPlush
{
	[BepInPlugin("lightglow.kweebecplush", "Kweebec Scrap", "1.0.0")]
	[BepInDependency(/*Could not decode attribute arguments.*/)]
	public class Plugin : BaseUnityPlugin
	{
		private const string modGUID = "lightglow.kweebecplush";

		private const string modName = "Kweebec Scrap";

		private const string modVersion = "1.0.0";

		private readonly Harmony harmony = new Harmony("lightglow.kweebecplush");

		private static Plugin Instance;

		internal ManualLogSource mls;

		public static AssetBundle LightAssets;

		public static AssetBundle KweebecAssets;

		private ConfigEntry<int> configLightRarity;

		private ConfigEntry<int> configKweebecRarity;

		private void Awake()
		{
			//IL_00b9: Unknown result type (might be due to invalid IL or missing references)
			//IL_00c3: Expected O, but got Unknown
			//IL_00ed: Unknown result type (might be due to invalid IL or missing references)
			//IL_00f7: Expected O, but got Unknown
			if ((Object)(object)Instance == (Object)null)
			{
				Instance = this;
			}
			LightAssets = AssetBundle.LoadFromFile(Path.Combine(Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location), "lightplush"));
			KweebecAssets = AssetBundle.LoadFromFile(Path.Combine(Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location), "kweebecplush"));
			mls = Logger.CreateLogSource("lightglow.kweebecplush");
			mls.LogInfo((object)"Kweebecs Have Invaded your Facilites!");
			harmony.PatchAll(typeof(Plugin));
			configLightRarity = ((BaseUnityPlugin)this).Config.Bind<int>("General", "LightRarity (Creator)", 1, new ConfigDescription("How rare Light is to find. Lower values mean Light spawns less often", (AcceptableValueBase)(object)new AcceptableValueRange<int>(0, 100), Array.Empty<object>()));
			configKweebecRarity = ((BaseUnityPlugin)this).Config.Bind<int>("General", "KweebecRarity", 30, new ConfigDescription("How rare Kweebecs are to find. Lower values mean Kweebecs spawn less often", (AcceptableValueBase)(object)new AcceptableValueRange<int>(0, 100), Array.Empty<object>()));
			Item val = LightAssets.LoadAsset<Item>("Assets/LightPlush.asset");
			if ((Object)(object)val == (Object)null)
			{
				mls.LogError((object)"Failed to load Light prefab.");
			}
			else
			{
				NetworkPrefabs.RegisterNetworkPrefab(val.spawnPrefab);
				Items.RegisterScrap(val, configLightRarity.Value, (LevelTypes)510);
			}
			Item val2 = LightAssets.LoadAsset<Item>("Assets/KweebecPlush.asset");
			if ((Object)(object)val2 == (Object)null)
			{
				mls.LogError((object)"Failed to load Kweebec prefab.");
				return;
			}
			NetworkPrefabs.RegisterNetworkPrefab(val2.spawnPrefab);
			Items.RegisterScrap(val2, configKweebecRarity.Value, (LevelTypes)510);
		}
	}
}