Decompiled source of HomebreweryTEST v4.7.37

Homebrewery.dll

Decompiled 17 hours ago
using System;
using System.Collections;
using System.Collections.Generic;
using System.Diagnostics;
using System.Diagnostics.CodeAnalysis;
using System.Globalization;
using System.IO;
using System.Linq;
using System.Reflection;
using System.Reflection.Emit;
using System.Resources;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;
using System.Runtime.Versioning;
using System.Security;
using System.Security.Permissions;
using System.Text;
using System.Threading;
using System.Threading.Tasks;
using System.Web;
using AtlyssCommandLib.API;
using BepInEx;
using BepInEx.Bootstrap;
using BepInEx.Configuration;
using BepInEx.Logging;
using CodeTalker.Networking;
using CodeTalker.Packets;
using GLTFast;
using GLTFast.Loading;
using GLTFast.Logging;
using GLTFast.Materials;
using HarmonyLib;
using Homebrewery.Code;
using Homebrewery.Code.Commands;
using Homebrewery.Code.Component;
using Homebrewery.Code.Config;
using Homebrewery.Code.Content;
using Homebrewery.Code.Content.Assets;
using Homebrewery.Code.Content.Items;
using Homebrewery.Code.Content.Parts;
using Homebrewery.Code.Enums;
using Homebrewery.Code.Objects;
using Homebrewery.Code.Objects.Things;
using Homebrewery.Code.Structs;
using Marioalexsan.AtlyssGLTF;
using Microsoft.CodeAnalysis;
using Mirror;
using Mirror.RemoteCalls;
using Mono.Cecil;
using Newtonsoft.Json;
using UnityEngine;
using UnityEngine.Events;
using UnityEngine.Networking;
using UnityEngine.SceneManagement;
using UnityEngine.UI;

[assembly: CompilationRelaxations(8)]
[assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)]
[assembly: Debuggable(DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints)]
[assembly: IgnoresAccessChecksTo("Assembly-CSharp")]
[assembly: IgnoresAccessChecksTo("UnityEngine.UI")]
[assembly: TargetFramework(".NETStandard,Version=v2.1", FrameworkDisplayName = ".NET Standard 2.1")]
[assembly: AssemblyCompany("Homebrewery")]
[assembly: AssemblyConfiguration("Debug")]
[assembly: AssemblyFileVersion("4.7.37.0")]
[assembly: AssemblyInformationalVersion("4.7.37+2a6732a53b3b330ddc37f251e48b81c091194224")]
[assembly: AssemblyProduct("Homebrewery")]
[assembly: AssemblyTitle("Homebrewery")]
[assembly: NeutralResourcesLanguage("en")]
[assembly: SecurityPermission(SecurityAction.RequestMinimum, SkipVerification = true)]
[assembly: AssemblyVersion("4.7.37.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.Class | AttributeTargets.Property | AttributeTargets.Field | AttributeTargets.Event | AttributeTargets.Parameter | AttributeTargets.ReturnValue | AttributeTargets.GenericParameter, AllowMultiple = false, Inherited = false)]
	internal sealed class NullableAttribute : Attribute
	{
		public readonly byte[] NullableFlags;

		public NullableAttribute(byte P_0)
		{
			NullableFlags = new byte[1] { P_0 };
		}

		public NullableAttribute(byte[] P_0)
		{
			NullableFlags = P_0;
		}
	}
	[CompilerGenerated]
	[Microsoft.CodeAnalysis.Embedded]
	[AttributeUsage(AttributeTargets.Class | AttributeTargets.Struct | AttributeTargets.Method | AttributeTargets.Interface | AttributeTargets.Delegate, AllowMultiple = false, Inherited = false)]
	internal sealed class NullableContextAttribute : Attribute
	{
		public readonly byte Flag;

		public NullableContextAttribute(byte P_0)
		{
			Flag = P_0;
		}
	}
	[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 Homebrewery
{
	internal static class CT
	{
		[CompilerGenerated]
		private static class <>O
		{
			public static BinaryPacketListener <0>__BP;

			public static PacketListener <1>__P;
		}

		internal const string MOD_ID = "CodeTalker";

		private static bool? _enabled;

		internal static uint _mainPlayerIndex;

		internal static bool _ready;

		internal static Dictionary<uint, Player> _players = new Dictionary<uint, Player>();

		internal static bool _floatsOn;

		internal static bool _stringsOn;

		private static readonly Dictionary<Folder, int> _typeIndexes = new Dictionary<Folder, int>
		{
			[Folder.Helm] = 1,
			[Folder.Cape] = 2,
			[Folder.Chestpiece] = 3,
			[Folder.Leggings] = 4,
			[Folder.Eyes] = 5,
			[Folder.Mouth] = 6
		};

		internal static bool Enabled
		{
			get
			{
				bool valueOrDefault = _enabled.GetValueOrDefault();
				if (!_enabled.HasValue)
				{
					valueOrDefault = Chainloader.PluginInfos.ContainsKey("CodeTalker");
					_enabled = valueOrDefault;
				}
				return _enabled.Value;
			}
		}

		internal static void RegisterListeners()
		{
			//IL_0010: Unknown result type (might be due to invalid IL or missing references)
			//IL_0015: Unknown result type (might be due to invalid IL or missing references)
			//IL_001b: Expected O, but got Unknown
			//IL_0045: Unknown result type (might be due to invalid IL or missing references)
			//IL_004a: Unknown result type (might be due to invalid IL or missing references)
			//IL_0050: Expected O, but got Unknown
			object obj = <>O.<0>__BP;
			if (obj == null)
			{
				BinaryPacketListener val = BP;
				<>O.<0>__BP = val;
				obj = (object)val;
			}
			if (!CodeTalkerNetwork.RegisterBinaryListener<BF>((BinaryPacketListener)obj))
			{
				HB.Log("Could not register float packet listener!", 4);
			}
			else
			{
				_floatsOn = true;
			}
			object obj2 = <>O.<1>__P;
			if (obj2 == null)
			{
				PacketListener val2 = P;
				<>O.<1>__P = val2;
				obj2 = (object)val2;
			}
			if (!CodeTalkerNetwork.RegisterListener<S>((PacketListener)obj2))
			{
				HB.Log("Could not register string packet listener!", 4);
			}
			else
			{
				_stringsOn = true;
			}
		}

		internal static void P(PacketHeader header, PacketBase packet)
		{
			if (_ready && packet is S s)
			{
				StringsIn(s);
			}
		}

		internal static void BP(PacketHeader header, BinaryPacketBase packet)
		{
			if (_ready && packet is BF floats)
			{
				FloatsIn(floats);
			}
		}

		internal static void FloatsIn(BF floats)
		{
			uint sender = (uint)floats.V[1];
			float num = floats.V[0];
			if (num != 0f)
			{
				if (num != 1f)
				{
					if (num != 2f)
					{
						if (num != 3f)
						{
							if (num != 4f)
							{
								if (num != 5f)
								{
									if (num == 6f)
									{
										TailModeIn(sender, floats.V[3..]);
									}
								}
								else
								{
									AllDyesIn(sender, floats.V[2], floats.V[3..]);
								}
							}
							else
							{
								DyeColorIn(sender, floats.V[3..]);
							}
						}
						else
						{
							ScaleCmdIn(sender, floats.V[3..]);
						}
					}
					else
					{
						CondEffectIn(sender, floats.V[3..]);
					}
				}
				else
				{
					LimitsPacketIn(sender, floats.V[2], floats.V[3..]);
				}
			}
			else
			{
				HBHelloIn(sender);
			}
		}

		private static void HBHelloIn(uint sender)
		{
			if (sender == _mainPlayerIndex)
			{
				ZPartMarkersOut();
				LimitsPacketOut();
				AllDyesOut();
			}
			else
			{
				ZPartMarkersOut(sender.ToString(CultureInfo.InvariantCulture));
				LimitsPacketOut(sender);
				AllDyesOut(sender);
			}
			TailModeOut(CharDisplayManager._local.GetTailMode());
		}

		private static void LimitsPacketIn(uint sender, float recipient, float[] values)
		{
			Player value;
			CharDisplayManager charDisplayManager = default(CharDisplayManager);
			if (sender == _mainPlayerIndex)
			{
				HB.Log("Ignored a LimitsPacket that was ours", 2);
			}
			else if (recipient != -1f && recipient != (float)_mainPlayerIndex)
			{
				HB.Log("Ignored a LimitsPacket that wasn't for us", 2);
			}
			else if (!_players.TryGetValue(sender, out value))
			{
				HB.Log($"NetID ({sender}) was not in Players Dictionary!", 4);
			}
			else if (((Component)value._pVisual._playerRaceModel).TryGetComponent<CharDisplayManager>(ref charDisplayManager))
			{
				charDisplayManager.SetYourLimits(CondType.Boobs, values[0], miniftrue: true);
				charDisplayManager.SetYourLimits(CondType.Boobs, values[1], miniftrue: false);
				charDisplayManager.SetYourLimits(CondType.Butt, values[2], miniftrue: true);
				charDisplayManager.SetYourLimits(CondType.Butt, values[3], miniftrue: false);
				charDisplayManager.SetYourLimits(CondType.Belly, values[4], miniftrue: true);
				charDisplayManager.SetYourLimits(CondType.Belly, values[5], miniftrue: false);
				charDisplayManager.SetYourLimits(CondType.Arms, values[6], miniftrue: true);
				charDisplayManager.SetYourLimits(CondType.Arms, values[7], miniftrue: false);
				charDisplayManager.SetYourLimits(CondType.Torso, values[8], miniftrue: true);
				charDisplayManager.SetYourLimits(CondType.Torso, values[9], miniftrue: false);
				charDisplayManager.SetYourLimits(CondType.Muzzle, values[10], miniftrue: true);
				charDisplayManager.SetYourLimits(CondType.Muzzle, values[11], miniftrue: false);
				charDisplayManager.SetYourLimits(CondType.Height, values[12], miniftrue: true);
				charDisplayManager.SetYourLimits(CondType.Height, values[13], miniftrue: false);
				charDisplayManager.SetYourLimits(CondType.Width, values[14], miniftrue: true);
				charDisplayManager.SetYourLimits(CondType.Width, values[15], miniftrue: false);
				charDisplayManager.SetYourLimits(CondType.Head, values[16], miniftrue: true);
				charDisplayManager.SetYourLimits(CondType.Head, values[17], miniftrue: false);
				charDisplayManager.SetYourLimits(CondType.Voice, values[18], miniftrue: true);
				charDisplayManager.SetYourLimits(CondType.Voice, values[19], miniftrue: false);
				charDisplayManager.SetYourLimits(CondType.Depth, values[20], miniftrue: true);
				charDisplayManager.SetYourLimits(CondType.Depth, values[21], miniftrue: false);
			}
		}

		internal static void LimitsPacketOut(float recipient = -1f)
		{
			CodeTalkerNetwork.SendNetworkPacket((BinaryPacketBase)(object)new BF(1f, _mainPlayerIndex, CharDisplayManager._local.GetAllLimits(), recipient));
		}

		private static void CondEffectIn(uint sender, float[] values)
		{
			CondEffectManager condEffectManager = default(CondEffectManager);
			if (!_players.TryGetValue(sender, out Player value))
			{
				HB.Log($"NetID ({sender}) was not in Players Dictionary!", 4);
			}
			else if (((Component)value).TryGetComponent<CondEffectManager>(ref condEffectManager))
			{
				condEffectManager.GetEffect((CondType)values[0], values[1], values[2], values[3], values[4] != 0f);
			}
		}

		internal static void CondEffectOut(CondType cond, float duration, float power, float interval, bool delayed)
		{
			CodeTalkerNetwork.SendNetworkPacket((BinaryPacketBase)(object)new BF(2f, _mainPlayerIndex, new float[5]
			{
				(float)cond,
				duration,
				power,
				interval,
				delayed ? 1 : 0
			}));
		}

		private static void ScaleCmdIn(uint sender, float[] values)
		{
			CondEffectManager condEffectManager = default(CondEffectManager);
			if (!_players.TryGetValue(sender, out Player value))
			{
				HB.Log($"NetID ({sender}) was not in Players Dictionary!", 4);
			}
			else if (((Component)value).TryGetComponent<CondEffectManager>(ref condEffectManager))
			{
				CondType condType = (CondType)values[0];
				float num = 1f;
				float num2 = 0f;
				switch (condType)
				{
				case CondType.Boobs:
					num2 = condEffectManager.Player._pVisual._playerRaceModel._boobWeight;
					break;
				case CondType.Butt:
					num2 = condEffectManager.Player._pVisual._playerRaceModel._bottomWeight;
					break;
				case CondType.Belly:
					num2 = condEffectManager.Player._pVisual._playerRaceModel._bellyWeight;
					break;
				case CondType.Height:
					num2 = condEffectManager.Player._pVisual._playerAppearanceStruct._heightWeight;
					num = 2000f;
					break;
				case CondType.Width:
					num2 = condEffectManager.Player._pVisual._playerAppearanceStruct._widthWeight;
					num = 2000f;
					break;
				case CondType.Depth:
					num2 = condEffectManager.CharMan.GetDepth();
					num = 2000f;
					break;
				case CondType.HeightWidthDepth:
					num2 = condEffectManager.Player._pVisual._playerAppearanceStruct._heightWeight;
					num = 2000f;
					break;
				case CondType.Head:
					num2 = condEffectManager.Player._pVisual._playerRaceModel._headWidth;
					break;
				case CondType.Arms:
					num2 = condEffectManager.Player._pVisual._playerRaceModel._armWeight;
					break;
				case CondType.Torso:
					num2 = condEffectManager.Player._pVisual._playerRaceModel._torsoWeight;
					break;
				case CondType.Muzzle:
					num2 = condEffectManager.Player._pVisual._playerRaceModel._muzzleWeight;
					break;
				case CondType.Voice:
					num2 = condEffectManager.Player._pSound._voicePitch;
					break;
				}
				float power = (values[1] - num2) / values[2] / 60f * num;
				condEffectManager.GetEffect(condType, values[2], power, 1f / 60f, delayed: false);
			}
		}

		internal static void ScaleCmdOut(CondType slider, float endPoint, float time)
		{
			CodeTalkerNetwork.SendNetworkPacket((BinaryPacketBase)(object)new BF(3f, _mainPlayerIndex, new float[3]
			{
				(float)slider,
				endPoint,
				time
			}));
		}

		private static void DyeColorIn(uint sender, float[] values)
		{
			//IL_0051: Unknown result type (might be due to invalid IL or missing references)
			//IL_0056: Unknown result type (might be due to invalid IL or missing references)
			//IL_005f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0068: Unknown result type (might be due to invalid IL or missing references)
			//IL_0071: Unknown result type (might be due to invalid IL or missing references)
			//IL_007b: Expected O, but got Unknown
			Player value;
			if (sender == _mainPlayerIndex)
			{
				HB.Log("Ignored a DyeColor packet that was ours", 2);
			}
			else if (!_players.TryGetValue(sender, out value))
			{
				HB.Log($"Sender ID ({sender}) was not in Players Dictionary!", 4);
			}
			else
			{
				CharDisplayManager charDisplayManager = default(CharDisplayManager);
				if (!((Component)value._pVisual._playerRaceModel).TryGetComponent<CharDisplayManager>(ref charDisplayManager))
				{
					return;
				}
				ColorAdjustShader_Profile colorAdjust = new ColorAdjustShader_Profile
				{
					_hue = values[1],
					_saturation = values[2],
					_brightness = values[3],
					_contrast = values[4]
				};
				float num = values[0];
				if (num != 0f)
				{
					if (num != 1f)
					{
						if (num != 2f)
						{
							if (num != 3f)
							{
								if (num != 4f)
								{
									if (num != 5f)
									{
										if (num == 6f)
										{
											charDisplayManager.RecolourMouth(colorAdjust);
										}
									}
									else
									{
										charDisplayManager.RecolourEyes(colorAdjust);
									}
								}
								else
								{
									charDisplayManager.SetSlotDye(Folder.Leggings, colorAdjust);
								}
							}
							else
							{
								charDisplayManager.SetSlotDye(Folder.Chestpiece, colorAdjust);
							}
						}
						else
						{
							charDisplayManager.SetSlotDye(Folder.Cape, colorAdjust);
						}
					}
					else
					{
						charDisplayManager.SetSlotDye(Folder.Helm, colorAdjust);
					}
				}
				else
				{
					charDisplayManager.SetSlotDye(Folder.Helm, colorAdjust);
					charDisplayManager.SetSlotDye(Folder.Cape, colorAdjust);
					charDisplayManager.SetSlotDye(Folder.Chestpiece, colorAdjust);
					charDisplayManager.SetSlotDye(Folder.Leggings, colorAdjust);
				}
			}
		}

		internal static void DyeColorOut(int type, ColorAdjustShader_Profile colorAdjust)
		{
			CodeTalkerNetwork.SendNetworkPacket((BinaryPacketBase)(object)new BF(4f, _mainPlayerIndex, new float[5] { type, colorAdjust._hue, colorAdjust._saturation, colorAdjust._brightness, colorAdjust._contrast }));
		}

		internal static void DyeColorOut(Folder type, ColorAdjustShader_Profile colorAdjust)
		{
			CodeTalkerNetwork.SendNetworkPacket((BinaryPacketBase)(object)new BF(4f, _mainPlayerIndex, new float[5]
			{
				_typeIndexes[type],
				colorAdjust._hue,
				colorAdjust._saturation,
				colorAdjust._brightness,
				colorAdjust._contrast
			}));
		}

		private static void AllDyesIn(uint sender, float recipient, float[] values)
		{
			//IL_008e: Unknown result type (might be due to invalid IL or missing references)
			//IL_0093: Unknown result type (might be due to invalid IL or missing references)
			//IL_009e: Unknown result type (might be due to invalid IL or missing references)
			//IL_00a9: Unknown result type (might be due to invalid IL or missing references)
			//IL_00b4: Unknown result type (might be due to invalid IL or missing references)
			//IL_00c1: Expected O, but got Unknown
			Player value;
			if (sender == _mainPlayerIndex)
			{
				HB.Log("Ignored an AllDyes Packet that was ours", 2);
			}
			else if (recipient != -1f && recipient != (float)_mainPlayerIndex)
			{
				HB.Log("Ignored an AllDyes Packet that wasn't for us", 2);
			}
			else if (!_players.TryGetValue(sender, out value))
			{
				HB.Log($"NetID ({sender}) was not in Players Dictionary!", 4);
			}
			else
			{
				CharDisplayManager charDisplayManager = default(CharDisplayManager);
				if (!((Component)value._pVisual._playerRaceModel).TryGetComponent<CharDisplayManager>(ref charDisplayManager))
				{
					return;
				}
				HB.Log("Got an AllDyes packet from: " + value._nickname, 2);
				int num = 1;
				for (int i = 0; (float)i < values[0]; i++)
				{
					ColorAdjustShader_Profile val = new ColorAdjustShader_Profile
					{
						_hue = values[num + 1],
						_saturation = values[num + 2],
						_brightness = values[num + 3],
						_contrast = values[num + 4]
					};
					float num2 = values[num];
					if (num2 != 1f)
					{
						if (num2 != 2f)
						{
							if (num2 != 3f)
							{
								if (num2 != 4f)
								{
									if (num2 != 5f)
									{
										if (num2 == 6f)
										{
											charDisplayManager.RecolourMouth(val);
											HB.Log($"Mouth: H {val._hue}, S {val._saturation}, B {val._brightness}, C {val._contrast}", 1);
										}
									}
									else
									{
										charDisplayManager.RecolourEyes(val);
									}
								}
								else
								{
									charDisplayManager.SetSlotDye(Folder.Leggings, val);
								}
							}
							else
							{
								charDisplayManager.SetSlotDye(Folder.Chestpiece, val);
							}
						}
						else
						{
							charDisplayManager.SetSlotDye(Folder.Cape, val);
						}
					}
					else
					{
						charDisplayManager.SetSlotDye(Folder.Helm, val);
					}
					num += 5;
				}
			}
		}

		private static void AllDyesOut(float recipient = -1f)
		{
			float[] dyesIfNotDefault = CharDisplayManager._local.GetDyesIfNotDefault();
			if (dyesIfNotDefault.Length != 0)
			{
				CodeTalkerNetwork.SendNetworkPacket((BinaryPacketBase)(object)new BF(5f, _mainPlayerIndex, dyesIfNotDefault, recipient));
			}
		}

		private static void TailModeIn(uint sender, float[] values)
		{
			Player value;
			CharDisplayManager charDisplayManager = default(CharDisplayManager);
			if (sender == _mainPlayerIndex)
			{
				HB.Log("Ignored a TailMode Packet that was ours", 2);
			}
			else if (!_players.TryGetValue(sender, out value))
			{
				HB.Log($"NetID ({sender}) was not in Players Dictionary!", 4);
			}
			else if (((Component)value._pVisual._playerRaceModel).TryGetComponent<CharDisplayManager>(ref charDisplayManager))
			{
				HB.Log("Got a TailMode packet from: " + value._nickname, 2);
				charDisplayManager.SetTailMode((TailMode)values[0]);
			}
		}

		internal static void TailModeOut(TailMode tailmode)
		{
			CodeTalkerNetwork.SendNetworkPacket((BinaryPacketBase)(object)new BF(6f, _mainPlayerIndex, new float[1] { (float)tailmode }));
		}

		internal static void StringsIn(S s)
		{
			if (uint.TryParse(s.V[1], out var result))
			{
				string text = s.V[0];
				if (text == "0")
				{
					ZPartMarkersIn(result, s.V[2], s.V[3..]);
				}
			}
		}

		internal static void ZPartMarkersIn(uint sender, string recipient, string[] s)
		{
			Player value;
			CharDisplayManager charDisplayManager = default(CharDisplayManager);
			if (sender == _mainPlayerIndex)
			{
				HB.Log("Ignored a ZPartMarkers that was ours", 2);
			}
			else if (recipient.Length > 0 && !recipient.Equals(_mainPlayerIndex.ToString(CultureInfo.InvariantCulture), StringComparison.OrdinalIgnoreCase))
			{
				HB.Log("Ignored a ZPartMarkers that wasn't for us", 2);
			}
			else if (!_players.TryGetValue(sender, out value))
			{
				HB.Log($"NetID ({sender}) was not in Players Dictionary!", 4);
			}
			else if (((Component)value._pVisual._playerRaceModel).TryGetComponent<CharDisplayManager>(ref charDisplayManager))
			{
				HB.Log("Got a ZPartMarkers packet from: " + value._nickname, 2);
				if (s[0].Length > 0)
				{
					charDisplayManager.SetPartMarker(Folder.Skin, s[0]);
				}
				if (s[1].Length > 0)
				{
					charDisplayManager.SetPartMarker(Folder.Mouth, s[1]);
				}
				if (s[2].Length > 0)
				{
					charDisplayManager.SetPartMarker(Folder.Eyes, s[2]);
				}
				if (s[3].Length > 0)
				{
					charDisplayManager.SetPartMarker(Folder.Hair, s[3]);
				}
				charDisplayManager._playerRaceModel.Apply_CharacterDisplay();
			}
		}

		internal static void ZPartMarkersOut(string recipient = "")
		{
			string partMarker = CharDisplayManager._local.GetPartMarker(Folder.Skin);
			string partMarker2 = CharDisplayManager._local.GetPartMarker(Folder.Mouth);
			string partMarker3 = CharDisplayManager._local.GetPartMarker(Folder.Eyes);
			string partMarker4 = CharDisplayManager._local.GetPartMarker(Folder.Hair);
			if (partMarker.Length + partMarker2.Length + partMarker3.Length + partMarker4.Length != 0)
			{
				CodeTalkerNetwork.SendNetworkPacket((PacketBase)(object)new S("0", _mainPlayerIndex.ToString(CultureInfo.InvariantCulture), new string[4] { partMarker, partMarker2, partMarker3, partMarker4 }, recipient));
			}
		}
	}
	internal sealed class BF : BinaryPacketBase
	{
		public float[] V { get; set; } = Array.Empty<float>();


		public override string PacketSignature => "HB.BF";

		public BF()
		{
		}

		public BF(float type, float sender, float[] values = null, float recipient = -1f)
		{
			List<float> list = new List<float>();
			list.Add(type);
			list.Add(sender);
			list.Add(recipient);
			list.AddRange(values ?? Array.Empty<float>());
			V = list.ToArray();
		}

		public override void Deserialize(byte[] data)
		{
			V = new float[data.Length / 4];
			Buffer.BlockCopy(data, 0, V, 0, data.Length);
		}

		public override byte[] Serialize()
		{
			byte[] array = new byte[V.Length * 4];
			Buffer.BlockCopy(V, 0, array, 0, array.Length);
			return array;
		}
	}
	internal sealed class S : PacketBase
	{
		public override string PacketSourceGUID => "Homebrewery";

		[JsonProperty]
		public string[] V { get; set; }

		public S(string type, string sender, string[] values = null, string recipient = "")
		{
			List<string> list = new List<string>();
			list.Add(type);
			list.Add(sender);
			list.Add(recipient);
			list.AddRange(values ?? Array.Empty<string>());
			V = list.ToArray();
			((PacketBase)this)..ctor();
		}
	}
	internal static class DataExtractor
	{
		internal static StringBuilder _loadedAssetsList = new StringBuilder();

		internal static void TellMeAbout(object? it, bool showempty = true)
		{
			HB.Log("TellMeAbout...");
			if (it == null)
			{
				HB.Log("It's null");
				HB.Log("...ToldYouAbout.\n");
				return;
			}
			HB.Log("Object: " + it);
			List<FieldInfo> list = it.GetType().GetFields(BindingFlags.Instance | BindingFlags.Public | BindingFlags.NonPublic).ToList();
			if (list.Count > 0)
			{
				list.Sort((FieldInfo f1, FieldInfo f2) => string.Compare(f1.Name, f2.Name, StringComparison.OrdinalIgnoreCase));
				foreach (FieldInfo item in list)
				{
					if (showempty || item.GetValue(it) != null)
					{
						HB.Log(item.Name.Replace("k__BackingField", string.Empty, StringComparison.OrdinalIgnoreCase).Replace("<", string.Empty, StringComparison.OrdinalIgnoreCase).Replace(">", string.Empty, StringComparison.OrdinalIgnoreCase) + " " + item.GetValue(it));
					}
				}
			}
			List<PropertyInfo> list2 = it.GetType().GetProperties(BindingFlags.Instance | BindingFlags.Public | BindingFlags.NonPublic).ToList();
			if (list2.Count > 0)
			{
				list2.Sort((PropertyInfo p1, PropertyInfo p2) => string.Compare(p1.Name, p2.Name, StringComparison.OrdinalIgnoreCase));
				foreach (PropertyInfo item2 in list2)
				{
					if (showempty || item2.GetValue(it) != null)
					{
						HB.Log(item2.Name.Replace("k__BackingField", string.Empty, StringComparison.OrdinalIgnoreCase).Replace("<", string.Empty, StringComparison.OrdinalIgnoreCase).Replace(">", string.Empty, StringComparison.OrdinalIgnoreCase) + " " + item2.GetValue(it));
					}
				}
			}
			HB.Log("...ToldYouAbout.\n");
		}

		internal static string MaximumStats()
		{
			//IL_0035: Unknown result type (might be due to invalid IL or missing references)
			//IL_003b: Expected O, but got Unknown
			//IL_009f: Unknown result type (might be due to invalid IL or missing references)
			//IL_00a6: Expected O, but got Unknown
			ScriptableItem val = GameManager._current._cachedScriptableItems.Values.First((ScriptableItem i) => i is ScriptableEquipment && !i._itemName.StartsWith("#HB#", StringComparison.OrdinalIgnoreCase));
			ScriptableEquipment val2 = (ScriptableEquipment)val;
			ScriptableEquipment val3 = val2;
			ScriptableEquipment val4 = val2;
			ScriptableEquipment val5 = val2;
			ScriptableEquipment val6 = val2;
			ScriptableEquipment val7 = val2;
			ScriptableEquipment val8 = val2;
			ScriptableEquipment val9 = val2;
			ScriptableEquipment val10 = val2;
			ScriptableEquipment val11 = val2;
			ScriptableEquipment val12 = val2;
			ScriptableEquipment val13 = val2;
			ScriptableEquipment val14 = val2;
			ScriptableEquipment val15 = val2;
			ScriptableEquipment val16 = val2;
			ScriptableEquipment val17 = val2;
			ScriptableEquipment val18 = val2;
			ScriptableEquipment val19 = val2;
			ScriptableWeapon val20 = (ScriptableWeapon)GameManager._current._cachedScriptableItems.Values.First((ScriptableItem i) => i is ScriptableWeapon && !i._itemName.StartsWith("#HB#", StringComparison.OrdinalIgnoreCase));
			ScriptableWeapon val21 = val20;
			foreach (ScriptableItem item in GameManager._current._cachedScriptableItems.Values.Where((ScriptableItem i) => i is ScriptableEquipment && !i._itemName.StartsWith("#HB#", StringComparison.OrdinalIgnoreCase)))
			{
				ScriptableEquipment val22 = (ScriptableEquipment)(object)((item is ScriptableEquipment) ? item : null);
				if (val22 == null)
				{
					continue;
				}
				if (((ScriptableItem)val22)._vendorCost > val._vendorCost)
				{
					val = (ScriptableItem)(object)val22;
				}
				if (val22._equipmentLevel > val2._equipmentLevel)
				{
					val2 = val22;
				}
				if (val22._statArray._maxHealth > val3._statArray._maxHealth)
				{
					val3 = val22;
				}
				if (val22._statArray._maxMana > val4._statArray._maxMana)
				{
					val4 = val22;
				}
				if (val22._statArray._maxStamina > val5._statArray._maxStamina)
				{
					val5 = val22;
				}
				if (val22._statArray._attackPower > val6._statArray._attackPower)
				{
					val6 = val22;
				}
				if (val22._statArray._magicPower > val7._statArray._magicPower)
				{
					val7 = val22;
				}
				if (val22._statArray._dexPower > val8._statArray._dexPower)
				{
					val8 = val22;
				}
				if (val22._statArray._criticalRate > val9._statArray._criticalRate)
				{
					val9 = val22;
				}
				if (val22._statArray._evasion > val10._statArray._evasion)
				{
					val10 = val22;
				}
				if (val22._statArray._defense > val11._statArray._defense)
				{
					val11 = val22;
				}
				if (val22._statArray._resist > val12._statArray._resist)
				{
					val12 = val22;
				}
				if (val22._statArray._elementalPower > val13._statArray._elementalPower)
				{
					val13 = val22;
				}
				if (val22._statArray._firePower > val14._statArray._firePower)
				{
					val14 = val22;
				}
				if (val22._statArray._waterPower > val15._statArray._waterPower)
				{
					val15 = val22;
				}
				if (val22._statArray._naturePower > val16._statArray._naturePower)
				{
					val16 = val22;
				}
				if (val22._statArray._earthPower > val17._statArray._earthPower)
				{
					val17 = val22;
				}
				if (val22._statArray._holyPower > val18._statArray._holyPower)
				{
					val18 = val22;
				}
				if (val22._statArray._shadowPower > val19._statArray._shadowPower)
				{
					val19 = val22;
				}
				ScriptableWeapon val23 = (ScriptableWeapon)(object)((val22 is ScriptableWeapon) ? val22 : null);
				if (val23 != null)
				{
					if (val23._bonusFloorWeaponDamage > val20._bonusFloorWeaponDamage)
					{
						val20 = val23;
					}
					if (val23._bonusCeilingWeaponDamage > val21._bonusCeilingWeaponDamage)
					{
						val21 = val23;
					}
				}
			}
			return $"```\r\n_vendorCost : {val._itemName} : {val._vendorCost}\r\n\r\n_equipmentLevel : {((ScriptableItem)val2)._itemName} : {val2._equipmentLevel}\r\n\r\n_maxHealth : {((ScriptableItem)val3)._itemName} : {val3._statArray._maxHealth}\r\n_maxMana : {((ScriptableItem)val4)._itemName} : {val4._statArray._maxMana}\r\n_maxStamina : {((ScriptableItem)val5)._itemName} : {val5._statArray._maxStamina}\r\n_attackPower : {((ScriptableItem)val6)._itemName} : {val6._statArray._attackPower}\r\n_magicPower : {((ScriptableItem)val7)._itemName} : {val7._statArray._magicPower}\r\n_dexPower : {((ScriptableItem)val8)._itemName} : {val8._statArray._dexPower}\r\n_criticalRate : {((ScriptableItem)val9)._itemName} : {val9._statArray._criticalRate}\r\n_evasion : {((ScriptableItem)val10)._itemName} : {val10._statArray._evasion}\r\n_defense : {((ScriptableItem)val11)._itemName} : {val11._statArray._defense}\r\n_resist : {((ScriptableItem)val12)._itemName} : {val12._statArray._resist}\r\n_elementalPower : {((ScriptableItem)val13)._itemName} : {val13._statArray._elementalPower}\r\n_firePower : {((ScriptableItem)val14)._itemName} : {val14._statArray._firePower}\r\n_waterPower : {((ScriptableItem)val15)._itemName} : {val15._statArray._waterPower}\r\n_naturePower : {((ScriptableItem)val16)._itemName} : {val16._statArray._naturePower}\r\n_earthPower : {((ScriptableItem)val17)._itemName} : {val17._statArray._earthPower}\r\n_holyPower : {((ScriptableItem)val18)._itemName} : {val18._statArray._holyPower}\r\n_shadowPower : {((ScriptableItem)val19)._itemName} : {val19._statArray._shadowPower}\r\n\r\n_bonusFloorWeaponDamage : {((ScriptableItem)val20)._itemName} : {val20._bonusFloorWeaponDamage}\r\n_bonusCeilingWeaponDamage : {((ScriptableItem)val21)._itemName} : {val21._bonusCeilingWeaponDamage}\r\n```";
		}

		internal static void DumpAllScriptables()
		{
			//IL_029e: Unknown result type (might be due to invalid IL or missing references)
			//IL_032f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0336: Expected O, but got Unknown
			//IL_03c9: Unknown result type (might be due to invalid IL or missing references)
			//IL_03d0: Expected O, but got Unknown
			//IL_05dd: Unknown result type (might be due to invalid IL or missing references)
			//IL_05e4: Expected O, but got Unknown
			//IL_04ed: Unknown result type (might be due to invalid IL or missing references)
			//IL_04f4: Expected O, but got Unknown
			//IL_0509: Unknown result type (might be due to invalid IL or missing references)
			//IL_0879: Unknown result type (might be due to invalid IL or missing references)
			//IL_0880: Expected O, but got Unknown
			//IL_09a7: Unknown result type (might be due to invalid IL or missing references)
			//IL_09ae: Expected O, but got Unknown
			//IL_0a29: Unknown result type (might be due to invalid IL or missing references)
			//IL_0a30: Expected O, but got Unknown
			//IL_0bec: Unknown result type (might be due to invalid IL or missing references)
			//IL_0c57: Unknown result type (might be due to invalid IL or missing references)
			//IL_0c5e: Expected O, but got Unknown
			//IL_0d82: Unknown result type (might be due to invalid IL or missing references)
			//IL_0d89: Expected O, but got Unknown
			//IL_0ee6: Unknown result type (might be due to invalid IL or missing references)
			//IL_0eed: Expected O, but got Unknown
			//IL_0fff: Unknown result type (might be due to invalid IL or missing references)
			//IL_1006: Expected O, but got Unknown
			//IL_11cd: Unknown result type (might be due to invalid IL or missing references)
			//IL_11e4: Unknown result type (might be due to invalid IL or missing references)
			IEnumerable<ScriptableItem> enumerable = GameManager._current._cachedScriptableItems.Values.Where((ScriptableItem i) => !i._itemName.StartsWith("#HB#", StringComparison.OrdinalIgnoreCase));
			DirectoryInfo directoryInfo = HB.Location.CreateSubdirectory("Scriptable");
			File.WriteAllTextAsync(PathUtils.LongCombine(directoryInfo.FullName, "LoadedAssetsList.txt"), _loadedAssetsList.ToString());
			Dictionary<Type, DirectoryInfo> dictionary = new Dictionary<Type, DirectoryInfo>();
			dictionary.Add(typeof(ScriptableArmorDye), directoryInfo.CreateSubdirectory("ArmorDye"));
			dictionary.Add(typeof(ScriptableCape), directoryInfo.CreateSubdirectory("Cape"));
			dictionary.Add(typeof(ScriptableChestpiece), directoryInfo.CreateSubdirectory("Chestpiece"));
			dictionary.Add(typeof(ScriptableHelm), directoryInfo.CreateSubdirectory("Helm"));
			dictionary.Add(typeof(ScriptableLeggings), directoryInfo.CreateSubdirectory("Leggings"));
			dictionary.Add(typeof(ScriptableRing), directoryInfo.CreateSubdirectory("Ring"));
			dictionary.Add(typeof(ScriptableShield), directoryInfo.CreateSubdirectory("Shield"));
			dictionary.Add(typeof(ScriptableStatusConsumable), directoryInfo.CreateSubdirectory("StatusConsumable"));
			dictionary.Add(typeof(ScriptableTradeItem), directoryInfo.CreateSubdirectory("TradeItem"));
			dictionary.Add(typeof(ScriptableWeapon), directoryInfo.CreateSubdirectory("Weapon"));
			Dictionary<Type, DirectoryInfo> dictionary2 = dictionary;
			foreach (ScriptableItem item in enumerable)
			{
				try
				{
					List<string> list = new List<string>();
					Type type = ((object)item).GetType();
					if (!dictionary2.TryGetValue(type, out var value))
					{
						continue;
					}
					list.Add("- ScriptableItem -");
					list.Add("name : " + ((Object)item).name);
					list.Add("_itemName : " + item._itemName);
					list.Add("_itemDescription : " + item._itemDescription);
					list.Add($"_destroyOnDrop : {item._destroyOnDrop}");
					list.Add($"_vendorCost : {item._vendorCost}");
					list.Add($"_maxStackAmount : {item._maxStackAmount}");
					list.Add($"_itemIcon : {item._itemIcon}");
					list.Add($"_itemRarity : {item._itemRarity}");
					if (type == typeof(ScriptableTradeItem))
					{
						File.WriteAllLinesAsync(PathUtils.LongCombine(value.FullName, item._itemName + ".txt"), list);
						continue;
					}
					if (type == typeof(ScriptableArmorDye) || type == typeof(ScriptableStatusConsumable))
					{
						ScriptableConsumable val = (ScriptableConsumable)item;
						list.Add("\n- ScriptableConsumable -");
						list.Add($"_consumableCooldown : {val._consumableCooldown}");
						list.Add($"_consumableObject : {val._consumableObject}");
						list.Add($"_useOnlyInTown : {val._useOnlyInTown}");
						list.Add($"_unperishable : {val._unperishable}");
						if (type == typeof(ScriptableStatusConsumable))
						{
							ScriptableStatusConsumable val2 = (ScriptableStatusConsumable)val;
							list.Add("\n- ScriptableStatusConsumable -");
							list.Add($"_healthApply : {val2._healthApply}");
							list.Add($"_manaApply : {val2._manaApply}");
							list.Add($"_staminaApply : {val2._staminaApply}");
							list.Add($"_expGain : {val2._expGain}");
							list.Add($"_resetSkillPoints : {val2._resetSkillPoints}");
							list.Add($"_resetAttributePoints : {val2._resetAttributePoints}");
							File.WriteAllLinesAsync(PathUtils.LongCombine(value.FullName, item._itemName + ".txt"), list);
						}
						else if (type == typeof(ScriptableArmorDye))
						{
							list.Add("(Dyes are not actually unperishable in vanilla, HB sets them to be!)");
							ScriptableArmorDye val3 = (ScriptableArmorDye)val;
							list.Add("\n- ScriptableArmorDye -");
							list.Add("_particleColoration : " + ColorUtility.ToHtmlStringRGBA(val3._particleColoration));
							list.Add("_dyeParams : {");
							list.Add($"    _hue : {val3._dyeParams._hue}\r\n    _saturation : {val3._dyeParams._saturation}\r\n    _brightness : {val3._dyeParams._brightness}\r\n    _contrast : {val3._dyeParams._contrast}");
							list.Add("}");
							File.WriteAllLinesAsync(PathUtils.LongCombine(value.FullName, item._itemName + ".txt"), list);
						}
						continue;
					}
					ScriptableEquipment val4 = (ScriptableEquipment)item;
					list.Add("\n- ScriptableEquipment -");
					list.Add($"_equipmentLevel : {val4._equipmentLevel}");
					list.Add($"_classRequirement : {val4._classRequirement}");
					list.Add("_statArray : {");
					list.Add($"    _maxHealth : {val4._statArray._maxHealth}\r\n    _maxMana : {val4._statArray._maxMana}\r\n    _maxStamina : {val4._statArray._maxStamina}\r\n    _experience : {val4._statArray._experience}\r\n    _attackPower : {val4._statArray._attackPower}\r\n    _magicPower : {val4._statArray._magicPower}\r\n    _dexPower : {val4._statArray._dexPower}\r\n    _criticalRate : {val4._statArray._criticalRate}\r\n    _evasion : {val4._statArray._evasion}\r\n    _defense : {val4._statArray._defense}\r\n    _resist : {val4._statArray._resist}\r\n    _elementalPower : {val4._statArray._elementalPower}\r\n    _firePower : {val4._statArray._firePower}\r\n    _waterPower : {val4._statArray._waterPower}\r\n    _naturePower : {val4._statArray._naturePower}\r\n    _earthPower : {val4._statArray._earthPower}\r\n    _holyPower : {val4._statArray._holyPower}\r\n    _shadowPower : {val4._statArray._shadowPower}");
					list.Add("}");
					if (val4._statModifierCost != null)
					{
						list.Add("_statModifierCost : {");
						list.Add($"    _scriptItem : {val4._statModifierCost._scriptItem}\r\n    _scriptItemQuantity : {val4._statModifierCost._scriptItemQuantity}");
						list.Add("}");
					}
					if (!(type == typeof(ScriptableCape)) && !(type == typeof(ScriptableChestpiece)) && !(type == typeof(ScriptableHelm)) && !(type == typeof(ScriptableLeggings)) && !(type == typeof(ScriptableRing)))
					{
						goto IL_0ece;
					}
					ScriptableArmor val5 = (ScriptableArmor)val4;
					list.Add("\n- ScriptableArmor -");
					list.Add($"_canDyeArmor : {val5._canDyeArmor}");
					list.Add("_colorAdjustParams : {");
					list.Add($"    _hue : {val5._colorAdjustParams._hue}\r\n    _saturation : {val5._colorAdjustParams._saturation}\r\n    _brightness : {val5._colorAdjustParams._brightness}\r\n    _contrast : {val5._colorAdjustParams._contrast}");
					list.Add("}");
					list.Add($"_armorTexture : {val5._armorTexture}");
					if (type == typeof(ScriptableRing))
					{
						File.WriteAllLinesAsync(PathUtils.LongCombine(value.FullName, item._itemName + ".txt"), list);
					}
					else if (type == typeof(ScriptableCape))
					{
						ScriptableCape val6 = (ScriptableCape)val5;
						list.Add("\n- ScriptableCape -");
						list.Add($"_capeMesh : {val6._capeMesh}");
						File.WriteAllLinesAsync(PathUtils.LongCombine(value.FullName, item._itemName + ".txt"), list);
					}
					else if (type == typeof(ScriptableChestpiece))
					{
						ScriptableChestpiece val7 = (ScriptableChestpiece)val5;
						list.Add("\n- ScriptableChestpiece -");
						list.Add($"_lockBoobs : {val7._lockBoobs}");
						list.Add($"_disableJiggleBoobBones : {val7._disableJiggleBoobBones}");
						list.Add($"_textureArms : {val7._textureArms}");
						list.Add($"_legOverlayTexture : {val7._legOverlayTexture}");
						list.Add($"_boobOverrideTexture : {val7._boobOverrideTexture}");
						list.Add($"_neckCollarMesh : {val7._neckCollarMesh}");
						list.Add($"_neckCollarTexture : {val7._neckCollarTexture}");
						list.Add($"_chestRenderDisplay : {val7._chestRenderDisplay}");
						list.Add($"_chestRenderTexture : {val7._chestRenderTexture}");
						list.Add($"_chestRenderBoobTexture : {val7._chestRenderBoobTexture}");
						list.Add($"_robeSkirtRender : {val7._robeSkirtRender}");
						list.Add($"_robeSkirtTexture : {val7._robeSkirtTexture}");
						list.Add($"_hipMeshDisplay : {val7._hipMeshDisplay}");
						list.Add($"_hipMeshTexture : {val7._hipMeshTexture}");
						list.Add($"_armCuffRender : {val7._armCuffRender}");
						list.Add($"_shoulderpadMesh : {val7._shoulderpadMesh}");
						list.Add($"_shoulderpadTexture : {val7._shoulderpadTexture}");
						list.Add($"_shoulderPadDisplayType : {val7._shoulderPadDisplayType}");
						File.WriteAllLinesAsync(PathUtils.LongCombine(value.FullName, item._itemName + ".txt"), list);
					}
					else if (type == typeof(ScriptableHelm))
					{
						ScriptableHelm val8 = (ScriptableHelm)val5;
						list.Add("\n- ScriptableHelm -");
						list.Add($"_blendHelmValue : {val8._blendHelmValue}");
						list.Add($"_useHelmHairDisplay : {val8._useHelmHairDisplay}");
						list.Add($"_hideEars : {val8._hideEars}");
						list.Add($"_hideMisc : {val8._hideMisc}");
						list.Add($"_isFullHelm : {val8._isFullHelm}");
						list.Add($"_helmRender : {val8._helmRender}");
						list.Add($"_helmOverrideMesh : {val8._helmOverrideMesh}");
						File.WriteAllLinesAsync(PathUtils.LongCombine(value.FullName, item._itemName + ".txt"), list);
					}
					else
					{
						if (!(type == typeof(ScriptableLeggings)))
						{
							goto IL_0ece;
						}
						ScriptableLeggings val9 = (ScriptableLeggings)val5;
						list.Add("\n- ScriptableLeggings -");
						list.Add($"_textureUpperLegOnly : {val9._textureUpperLegOnly}");
						list.Add($"_textureFeet : {val9._textureFeet}");
						list.Add($"_legPieceRender_01 : {val9._legPieceRender_01}");
						list.Add($"_legPieceTexture_01 : {val9._legPieceTexture_01}");
						list.Add($"_legPieceRender_02 : {val9._legPieceRender_02}");
						list.Add($"_legPieceTexture_02 : {val9._legPieceTexture_02}");
						list.Add($"_legPieceRender_03 : {val9._legPieceRender_03}");
						list.Add($"_legPieceTexture_03 : {val9._legPieceTexture_03}");
						list.Add($"_legPieceRender_04 : {val9._legPieceRender_04}");
						list.Add($"_legPieceTexture_04 : {val9._legPieceTexture_04}");
						File.WriteAllLinesAsync(PathUtils.LongCombine(value.FullName, item._itemName + ".txt"), list);
					}
					goto end_IL_01b1;
					IL_0ece:
					if (type == typeof(ScriptableShield))
					{
						ScriptableShield val10 = (ScriptableShield)val4;
						list.Add("\n- ScriptableShield -");
						list.Add($"_shieldMesh : {val10._shieldMesh}");
						list.Add($"_shieldTexture : {val10._shieldTexture}");
						list.Add("_textureColorAdjust : {");
						list.Add($"    _hue : {val10._textureColorAdjust._hue}\r\n    _saturation : {val10._textureColorAdjust._saturation}\r\n    _brightness : {val10._textureColorAdjust._brightness}\r\n    _contrast : {val10._textureColorAdjust._contrast}");
						list.Add("}");
						File.WriteAllLinesAsync(PathUtils.LongCombine(value.FullName, item._itemName + ".txt"), list);
					}
					else if (type == typeof(ScriptableWeapon))
					{
						ScriptableWeapon val11 = (ScriptableWeapon)val4;
						list.Add("\n- ScriptableWeapon -");
						list.Add("weaponType : " + val11.weaponType._weaponTypeClassTag);
						if (Object.op_Implicit((Object)(object)val11._combatElement))
						{
							list.Add($"_combatElement : {val11._combatElement._elementName} - ID: {val11._combatElement._elementID}");
						}
						else
						{
							list.Add("_combatElement : None");
						}
						list.Add($"_weaponProjectileSet : {val11._weaponProjectileSet}");
						list.Add($"_bonusFloorWeaponDamage : {val11._bonusFloorWeaponDamage}");
						list.Add($"_bonusCeilingWeaponDamage : {val11._bonusCeilingWeaponDamage}");
						if (Object.op_Implicit((Object)(object)val11._weaponConditionSlot?._scriptableCondition))
						{
							list.Add("_weaponConditionSlot : {");
							list.Add($"    _scriptableCondition : {val11._weaponConditionSlot._scriptableCondition._conditionName} - ID: {val11._weaponConditionSlot._scriptableCondition._conditionID}\r\n    _chance : {val11._weaponConditionSlot._chance}\r\n    _conditionPower : {val11._weaponConditionSlot._conditionPower}\r\n    _bonusDuration : {val11._weaponConditionSlot._bonusDuration}");
							list.Add("}");
						}
						else
						{
							list.Add("_weaponConditionSlot : None");
						}
						list.Add($"weaponTexture : {val11.weaponTexture}");
						list.Add($"weaponMesh : {val11.weaponMesh}");
						list.Add("trailColors : #" + ColorUtility.ToHtmlStringRGBA(val11.trailColors[0]) + " & #" + ColorUtility.ToHtmlStringRGBA(val11.trailColors[1]));
						list.Add("_textureColorAdjust : {");
						list.Add($"    _hue : {val11._textureColorAdjust._hue}\r\n    _saturation : {val11._textureColorAdjust._saturation}\r\n    _brightness : {val11._textureColorAdjust._brightness}\r\n    _contrast : {val11._textureColorAdjust._contrast}");
						list.Add("}");
						list.Add($"_weaponTakeOutSfxIndex : {val11._weaponTakeOutSfxIndex}");
						list.Add($"_setWeaponTakeOutSfx : {val11._setWeaponTakeOutSfx}");
						list.Add($"_weaponSwingSfxIndex : {val11._weaponSwingSfxIndex}");
						list.Add($"_setWeaponSwingSfx : {val11._setWeaponSwingSfx}");
						File.WriteAllLinesAsync(PathUtils.LongCombine(value.FullName, item._itemName + ".txt"), list);
					}
					end_IL_01b1:;
				}
				catch
				{
					HB.Log("DumpAllScriptables() - Didn't manage to make a file for " + item._itemName);
					throw;
				}
			}
		}
	}
	internal static class FunStuff
	{
		internal static void Bumpscosity()
		{
			int[] array = new int[7] { 0, 1, 12, 50, 76, 100, 1000 };
			MainConfig._current._bumpscosity.Value = array[Random.Range(0, 6)];
			int value = MainConfig._current._bumpscosity.Value;
			if (value < 50)
			{
				if (value > 0)
				{
					if (value < 12)
					{
						if (value == 1)
						{
							HB.Log("Well I'm quite feeling the lack of bumpscosity in here.\nOnly a single bumpscosit. Still, it'll have to do.\n");
						}
						else
						{
							HB.Log("Well I'm quite feeling the lack of bumpscosity in here.\nOnly a few bumpscosits. Still, it'll have to do.\n");
						}
					}
					else
					{
						HB.Log("Just a light breeze of bumpscosity in here at the moment, not bad. I personally enjoy a bit more bumpscosity, but at this amount it's absolutely reasonable.\n");
					}
				}
				else
				{
					HB.Log("Dear me, where did all the bumpscosity go? Quite unnerving in here with all of it gone.\n");
				}
			}
			else if (value < 100)
			{
				if (value < 76)
				{
					HB.Log("Ahh, quite a pleasant amount of bumpscosity we've got today, wouldn't you say? Very enjoyable.\n");
				}
				else
				{
					HB.Log("Well, the bumpscosity in here is really getting up there, isn't it?\nNo matter, the story must carry on no matter how much or how little bumpscosity there is.\n");
				}
			}
			else if (value < 1000)
			{
				HB.Log("Who turned up the bumpscosity so high?\nI like bumpscosity as much as the next person, but a hundred is quite a lot, wouldn't you say?\n");
			}
			else
			{
				HB.Log("My god, the bumpscosity in here is absolutely overwhelming.\nA thousand?! You people have got to be nuts!\nHow can you stand this much bumpscosity?\n");
			}
		}
	}
	[BepInPlugin("Homebrewery", "Homebrewery", "4.7.37")]
	[BepInDependency(/*Could not decode attribute arguments.*/)]
	[BepInDependency(/*Could not decode attribute arguments.*/)]
	[BepInDependency(/*Could not decode attribute arguments.*/)]
	public class BepInExPlugin : BaseUnityPlugin
	{
		public BepInExPlugin()
		{
			HB._dll = new FileInfo(((BaseUnityPlugin)this).Info.Location);
			HB._logger = ((BaseUnityPlugin)this).Logger;
		}

		public void Awake()
		{
			//IL_0005: Unknown result type (might be due to invalid IL or missing references)
			//IL_000f: Expected O, but got Unknown
			HB._homebreweryGameObject = new GameObject("Homebrewery-GameObject");
			Object.DontDestroyOnLoad((Object)(object)HB._homebreweryGameObject);
			HB._self = HB._homebreweryGameObject.AddComponent<HB>();
		}
	}
	public class HB : MonoBehaviour
	{
		[Serializable]
		[CompilerGenerated]
		private sealed class <>c
		{
			public static readonly <>c <>9 = new <>c();

			public static MemoryUsageChangedCallback <>9__58_0;

			public static Func<AnyThing, int> <>9__60_0;

			public static Func<Mesh, bool> <>9__73_0;

			public static Func<Mesh, bool> <>9__73_1;

			public static Func<Mesh, bool> <>9__73_2;

			public static Func<Mesh, bool> <>9__73_3;

			public static Func<Mesh, bool> <>9__73_4;

			public static Func<Mesh, bool> <>9__73_5;

			public static Func<Mesh, bool> <>9__73_6;

			public static Func<Mesh, bool> <>9__73_7;

			public static Func<Mesh, bool> <>9__73_8;

			public static Func<Mesh, bool> <>9__73_9;

			public static Func<Mesh, bool> <>9__73_10;

			public static Func<Mesh, bool> <>9__73_11;

			public static Func<Mesh, bool> <>9__73_12;

			public static Func<Mesh, bool> <>9__73_13;

			public static Func<Mesh, bool> <>9__73_14;

			public static Func<GameObject, bool> <>9__73_15;

			internal void <Awake>b__58_0(in ApplicationMemoryUsageChange newUsage)
			{
				//IL_0006: Unknown result type (might be due to invalid IL or missing references)
				//IL_0016: Unknown result type (might be due to invalid IL or missing references)
				//IL_0020: Expected I4, but got Unknown
				Log($"ApplicationMemoryUsage.{((ApplicationMemoryUsageChange)(ref newUsage)).memoryUsage} reported!", (int)((ApplicationMemoryUsageChange)(ref newUsage)).memoryUsage);
			}

			internal int <Cache_HBScriptableAssets>b__60_0(AnyThing m)
			{
				return (!m._beak) ? 1 : 0;
			}

			internal bool <LoadVanillaAssets>b__73_0(Mesh m)
			{
				return ((Object)m).name.Equals("_mouthEnemy_hair", StringComparison.OrdinalIgnoreCase);
			}

			internal bool <LoadVanillaAssets>b__73_1(Mesh m)
			{
				return ((Object)m).name.Equals("_mouthEnemy_alt00_hair", StringComparison.OrdinalIgnoreCase);
			}

			internal bool <LoadVanillaAssets>b__73_2(Mesh m)
			{
				return ((Object)m).name.Equals("angela_hairTuft", StringComparison.OrdinalIgnoreCase);
			}

			internal bool <LoadVanillaAssets>b__73_3(Mesh m)
			{
				return ((Object)m).name.Equals("_ruko_hair", StringComparison.OrdinalIgnoreCase);
			}

			internal bool <LoadVanillaAssets>b__73_4(Mesh m)
			{
				return ((Object)m).name.Equals("_sally_hair", StringComparison.OrdinalIgnoreCase);
			}

			internal bool <LoadVanillaAssets>b__73_5(Mesh m)
			{
				return ((Object)m).name.Equals("_sallyworker00_hair", StringComparison.OrdinalIgnoreCase);
			}

			internal bool <LoadVanillaAssets>b__73_6(Mesh m)
			{
				return ((Object)m).name.Equals("_vivi_hair", StringComparison.OrdinalIgnoreCase);
			}

			internal bool <LoadVanillaAssets>b__73_7(Mesh m)
			{
				return ((Object)m).name.Equals("_lordBoar_horns", StringComparison.OrdinalIgnoreCase);
			}

			internal bool <LoadVanillaAssets>b__73_8(Mesh m)
			{
				return ((Object)m).name.Equals("mekboar_horn", StringComparison.OrdinalIgnoreCase);
			}

			internal bool <LoadVanillaAssets>b__73_9(Mesh m)
			{
				return ((Object)m).name.Equals("_moth_horn", StringComparison.OrdinalIgnoreCase);
			}

			internal bool <LoadVanillaAssets>b__73_10(Mesh m)
			{
				return ((Object)m).name.Equals("rageBoar_horn", StringComparison.OrdinalIgnoreCase);
			}

			internal bool <LoadVanillaAssets>b__73_11(Mesh m)
			{
				return ((Object)m).name.Equals("warboar_horn", StringComparison.OrdinalIgnoreCase);
			}

			internal bool <LoadVanillaAssets>b__73_12(Mesh m)
			{
				return ((Object)m).name.Equals("wizboar_scepter", StringComparison.OrdinalIgnoreCase);
			}

			internal bool <LoadVanillaAssets>b__73_13(Mesh m)
			{
				return ((Object)m).name.Equals("angela_horns", StringComparison.OrdinalIgnoreCase);
			}

			internal bool <LoadVanillaAssets>b__73_14(Mesh m)
			{
				return ((Object)m).name.Equals("_enok_horns", StringComparison.OrdinalIgnoreCase);
			}

			internal bool <LoadVanillaAssets>b__73_15(GameObject c)
			{
				if (!((Object)c).name.StartsWith("_conditionEffect_", StringComparison.OrdinalIgnoreCase))
				{
					return ((Object)c).name.StartsWith("_conditionObject_", StringComparison.OrdinalIgnoreCase);
				}
				return true;
			}
		}

		[CompilerGenerated]
		private sealed class <AddSlash>d__69 : IEnumerator<object>, IEnumerator, IDisposable
		{
			private int <>1__state;

			private object <>2__current;

			object IEnumerator<object>.Current
			{
				[DebuggerHidden]
				get
				{
					return <>2__current;
				}
			}

			object IEnumerator.Current
			{
				[DebuggerHidden]
				get
				{
					return <>2__current;
				}
			}

			[DebuggerHidden]
			public <AddSlash>d__69(int <>1__state)
			{
				this.<>1__state = <>1__state;
			}

			[DebuggerHidden]
			void IDisposable.Dispose()
			{
				<>1__state = -2;
			}

			private bool MoveNext()
			{
				switch (<>1__state)
				{
				default:
					return false;
				case 0:
					<>1__state = -1;
					<>2__current = null;
					<>1__state = 1;
					return true;
				case 1:
					<>1__state = -1;
					ChatBehaviour._current._chatAssets._chatInput.text = "/";
					ChatBehaviour._current._chatAssets._chatInput.MoveTextEnd(false);
					return false;
				}
			}

			bool IEnumerator.MoveNext()
			{
				//ILSpy generated this explicit interface implementation from .override directive in MoveNext
				return this.MoveNext();
			}

			[DebuggerHidden]
			void IEnumerator.Reset()
			{
				throw new NotSupportedException();
			}
		}

		internal static HB _self = null;

		internal static GameObject _homebreweryGameObject = null;

		internal static FileInfo _dll = null;

		internal static ManualLogSource _logger = null;

		private readonly Stopwatch _stopwatch = Stopwatch.StartNew();

		internal static DirectoryInfo _configHomebrewery = null;

		internal static DirectoryInfo _limitCfgsFolder = null;

		internal static int _bepinPathLength;

		private readonly Harmony _harmony = new Harmony("Homebrewery");

		public const StringComparison ORD = StringComparison.OrdinalIgnoreCase;

		internal static InstallType _installType = InstallType.r2ModMan;

		private static DirectoryInfo? _location;

		private static DirectoryInfo? _internal;

		private static DirectoryInfo? _hbFiles;

		internal static DirectoryInfo _contentPacks = null;

		public static readonly Dictionary<string, ScriptableArmorRender> ARend = new Dictionary<string, ScriptableArmorRender>(StringComparer.OrdinalIgnoreCase);

		public static readonly Dictionary<string, Mesh> AMesh = new Dictionary<string, Mesh>(StringComparer.OrdinalIgnoreCase);

		internal static Dictionary<RaceType, RaceStruct> _raceStructs = new Dictionary<RaceType, RaceStruct>();

		internal static ScriptablePlayerRace _playerRace_imp = null;

		internal static ScriptablePlayerRace _playerRace_poon = null;

		internal static ScriptablePlayerRace _playerRace_kubold = null;

		internal static ScriptablePlayerRace _playerRace_byrdle = null;

		internal static ScriptablePlayerRace _playerRace_chang = null;

		internal static bool _hotkeysOn = true;

		public static readonly int UpdateCount = 10;

		internal const string UPDATE_STRING = "Thank you for using Homebrewery 4.7.37!\r\n\r\n\r\n\r\n\r\n\r\nRemember: don't store custom items!\r\nClose: 'T' | Ctrl+P to open HB Phone!";

		internal static bool _shownUpdateMessage;

		public static readonly Dictionary<string, AudioClip> AudioClips = new Dictionary<string, AudioClip>(StringComparer.OrdinalIgnoreCase);

		public static readonly Dictionary<string, Sprite> Sprites = new Dictionary<string, Sprite>();

		public static readonly Dictionary<string, GameObject> ConsumableObjects = new Dictionary<string, GameObject>(StringComparer.OrdinalIgnoreCase);

		internal static float _foodLevel;

		internal static Shader _unlitColorAdjustCutout = null;

		internal static PlayerRaceModel[] _menuRaceModels = Array.Empty<PlayerRaceModel>();

		internal static PlayerRaceModel[] _inventoryRaceModels = Array.Empty<PlayerRaceModel>();

		internal static GameObject? _glbStorage;

		private static bool _awakeCompleted;

		private bool _chatIsKill;

		internal static int _byrdleVanillaHairsCount;

		internal static int _byrdleVanillaBeaksCount;

		internal static int _nudge;

		internal static DirectoryInfo Location
		{
			get
			{
				return _location ?? throw new InvalidOperationException("Location wasn't initialised!");
			}
			set
			{
				_location = value;
			}
		}

		internal static DirectoryInfo Internal
		{
			get
			{
				return _internal ?? throw new InvalidOperationException("Internal wasn't initialised!");
			}
			set
			{
				_internal = value;
			}
		}

		internal static DirectoryInfo HBFiles
		{
			get
			{
				return _hbFiles ?? throw new InvalidOperationException("HBFiles wasn't initialised!");
			}
			set
			{
				_hbFiles = value;
			}
		}

		internal static List<TexReplace> _texReplacements => TexReplacer._texReplacements;

		public static Dictionary<string, ScriptableWeaponType> WeaponTypes => WeaponItemFolder._weaponTypes;

		public static Dictionary<string, ScriptableWeaponProjectileSet> ProjectileSets => WeaponItemFolder._projectileSets;

		internal static Dictionary<uint, Player> _players => CT._players;

		public static GameManager GM => GameManager._current.L<GameManager>() ?? throw new InvalidOperationException("Tried to use GameManager._current before it was ready!");

		internal static bool FolderCheck(DirectoryInfo dir)
		{
			DateTime lastAccessTime = dir.LastAccessTime;
			DateTime lastWriteTime = dir.LastWriteTime;
			dir.Refresh();
			if (dir.Exists)
			{
				if (!(lastAccessTime < dir.LastAccessTime))
				{
					return lastWriteTime < dir.LastWriteTime;
				}
				return true;
			}
			return false;
		}

		public static void Log(object? thing = null, int level = 0)
		{
			if (Object.op_Implicit((Object)(object)MainConfig._current) && MainConfig._current._logLevel.Value == -1)
			{
				return;
			}
			if (thing == null)
			{
				_logger.LogError((object)"Logged a null, nice one.");
				return;
			}
			switch (level)
			{
			case 1:
				if (!Object.op_Implicit((Object)(object)MainConfig._current) || MainConfig._current._logLevel.Value <= 1)
				{
					_logger.LogDebug(thing);
				}
				break;
			case 2:
				if (!Object.op_Implicit((Object)(object)MainConfig._current) || MainConfig._current._logLevel.Value <= 2)
				{
					_logger.LogMessage(thing);
				}
				break;
			case 3:
				if (!Object.op_Implicit((Object)(object)MainConfig._current) || MainConfig._current._logLevel.Value <= 3)
				{
					_logger.LogWarning((object)$"{thing}\n");
				}
				break;
			case 4:
				_logger.LogError((object)$"{thing}\n");
				break;
			default:
				_logger.LogInfo(thing);
				break;
			}
		}

		private static void TryMoveFile(string source, string destination)
		{
			if (File.Exists(source) && !File.Exists(destination))
			{
				File.Move(source, destination);
			}
		}

		private static void ConfigMover()
		{
			_configHomebrewery = Directory.CreateDirectory(PathUtils.LongCombine(Paths.ConfigPath, "Homebrewery"));
			_limitCfgsFolder = Directory.CreateDirectory(PathUtils.LongCombine(_configHomebrewery.FullName, "LimitCFGs"));
			TryMoveFile(PathUtils.LongCombine(Paths.ConfigPath, "Homebrewery.cfg"), PathUtils.LongCombine(_configHomebrewery.FullName, "Homebrewery.cfg"));
			TryMoveFile(PathUtils.LongCombine(Paths.ConfigPath, "HB_JiggleSettings.cfg"), PathUtils.LongCombine(_configHomebrewery.FullName, "JiggleSettings.cfg"));
			TryMoveFile(PathUtils.LongCombine(Paths.ConfigPath, "HBLimitCFGs", "HB_Byrdle_YourLimits.cfg"), PathUtils.LongCombine(_limitCfgsFolder.FullName, "Byrdle_YourLimits.cfg"));
			TryMoveFile(PathUtils.LongCombine(Paths.ConfigPath, "HBLimitCFGs", "HB_Chang_YourLimits.cfg"), PathUtils.LongCombine(_limitCfgsFolder.FullName, "Chang_YourLimits.cfg"));
			TryMoveFile(PathUtils.LongCombine(Paths.ConfigPath, "HBLimitCFGs", "HB_Imp_YourLimits.cfg"), PathUtils.LongCombine(_limitCfgsFolder.FullName, "Imp_YourLimits.cfg"));
			TryMoveFile(PathUtils.LongCombine(Paths.ConfigPath, "HBLimitCFGs", "HB_Kubold_YourLimits.cfg"), PathUtils.LongCombine(_limitCfgsFolder.FullName, "Kubold_YourLimits.cfg"));
			TryMoveFile(PathUtils.LongCombine(Paths.ConfigPath, "HBLimitCFGs", "HB_Poon_YourLimits.cfg"), PathUtils.LongCombine(_limitCfgsFolder.FullName, "Poon_YourLimits.cfg"));
			TryMoveFile(PathUtils.LongCombine(Paths.ConfigPath, "HBLimitCFGs", "HB_Byrdle_OthersLimits.cfg"), PathUtils.LongCombine(_limitCfgsFolder.FullName, "Byrdle_OthersLimits.cfg"));
			TryMoveFile(PathUtils.LongCombine(Paths.ConfigPath, "HBLimitCFGs", "HB_Chang_OthersLimits.cfg"), PathUtils.LongCombine(_limitCfgsFolder.FullName, "Chang_OthersLimits.cfg"));
			TryMoveFile(PathUtils.LongCombine(Paths.ConfigPath, "HBLimitCFGs", "HB_Imp_OthersLimits.cfg"), PathUtils.LongCombine(_limitCfgsFolder.FullName, "Imp_OthersLimits.cfg"));
			TryMoveFile(PathUtils.LongCombine(Paths.ConfigPath, "HBLimitCFGs", "HB_Kubold_OthersLimits.cfg"), PathUtils.LongCombine(_limitCfgsFolder.FullName, "Kubold_OthersLimits.cfg"));
			TryMoveFile(PathUtils.LongCombine(Paths.ConfigPath, "HBLimitCFGs", "HB_Poon_OthersLimits.cfg"), PathUtils.LongCombine(_limitCfgsFolder.FullName, "Poon_OthersLimits.cfg"));
			if (Directory.Exists(PathUtils.LongCombine(Paths.ConfigPath, "HBLimitCFGs")) && !Directory.EnumerateFileSystemEntries(PathUtils.LongCombine(Paths.ConfigPath, "HBLimitCFGs")).Any())
			{
				Directory.Delete(PathUtils.LongCombine(Paths.ConfigPath, "HBLimitCFGs"));
			}
		}

		private void Awake()
		{
			//IL_0030: Unknown result type (might be due to invalid IL or missing references)
			//IL_003a: Expected O, but got Unknown
			//IL_001b: Unknown result type (might be due to invalid IL or missing references)
			//IL_0020: Unknown result type (might be due to invalid IL or missing references)
			//IL_0026: Expected O, but got Unknown
			Application.SetStackTraceLogType((LogType)4, (StackTraceLogType)2);
			object obj = <>c.<>9__58_0;
			if (obj == null)
			{
				MemoryUsageChangedCallback val = delegate(in ApplicationMemoryUsageChange newUsage)
				{
					//IL_0006: Unknown result type (might be due to invalid IL or missing references)
					//IL_0016: Unknown result type (might be due to invalid IL or missing references)
					//IL_0020: Expected I4, but got Unknown
					Log($"ApplicationMemoryUsage.{((ApplicationMemoryUsageChange)(ref newUsage)).memoryUsage} reported!", (int)((ApplicationMemoryUsageChange)(ref newUsage)).memoryUsage);
				};
				<>c.<>9__58_0 = val;
				obj = (object)val;
			}
			Application.memoryUsageChanged += (MemoryUsageChangedCallback)obj;
			_glbStorage = new GameObject("GLTFContainer");
			_glbStorage.transform.parent = _homebreweryGameObject.transform;
			_glbStorage.SetActive(false);
			ConfigMover();
			ConfigManager._current = _homebreweryGameObject.AddComponent<ConfigManager>();
			CultureInfo.CurrentCulture = CultureInfo.InvariantCulture;
			Log($"Waking up at {DateTime.UtcNow:yyyy-MM-dd h:mm:ss tt} UTC... Game Version is: {Application.version}");
			_bepinPathLength = PathUtils.LongCombine(Paths.BepInExRootPath).Length;
			if (!Application.version.Equals("62026.a1", StringComparison.OrdinalIgnoreCase))
			{
				Log("This version of Homebrewery was made for game version '62026.a1', so be wary of issues arising due to game changes!", 3);
			}
			FunStuff.Bumpscosity();
			Log($"AtlyssGLTF available: {AtlyssGLTF.Available}.");
			if (MainConfig._current._ignoreAtlyssGLTF.Value)
			{
				Log("'Ignore AtylssGLTF' debug setting is on! - Homebrewery will not import any GLB files!", 4);
			}
			Location = _dll.Directory;
			if (Location.Name.Equals("plugins", StringComparison.OrdinalIgnoreCase))
			{
				Log("[InstallError] Homebrewery is not installed correctly! The DLL should not be directly in the BepInEx/plugins folder - Leave it inside its 'Catman232-Homebrewery' folder!", 4);
				Application.SetStackTraceLogType((LogType)4, (StackTraceLogType)1);
				return;
			}
			if (Directory.Exists(PathUtils.LongCombine(Location.FullName, "plugins")))
			{
				_installType = InstallType.Manual;
			}
			if (_installType == InstallType.r2ModMan)
			{
				Internal = new DirectoryInfo(PathUtils.LongCombine(Location.FullName, "Internal"));
				HBFiles = new DirectoryInfo(PathUtils.LongCombine(Location.FullName, "HomebreweryFiles"));
				TexReplacer._folder = new DirectoryInfo(PathUtils.LongCombine(Paths.ConfigPath, "TextureReplace"));
				_contentPacks = new DirectoryInfo(PathUtils.LongCombine(Paths.ConfigPath, "ContentPacks"));
			}
			else if (_installType == InstallType.Manual)
			{
				Internal = new DirectoryInfo(PathUtils.LongCombine(Location.FullName, "plugins", "Internal"));
				HBFiles = new DirectoryInfo(PathUtils.LongCombine(Location.FullName, "plugins", "HomebreweryFiles"));
				TexReplacer._folder = new DirectoryInfo(PathUtils.LongCombine(Location.FullName, "config", "TextureReplace"));
				_contentPacks = new DirectoryInfo(PathUtils.LongCombine(Location.FullName, "config", "ContentPacks"));
			}
			if (!Internal.Exists)
			{
				Log("[InstallError] Internal folder could not be found! Something is wrong with your mod installation!", 4);
				Application.SetStackTraceLogType((LogType)4, (StackTraceLogType)1);
				return;
			}
			if (!HBFiles.Exists)
			{
				Log("[InstallError] HomebreweryFiles folder could not be found! Something is wrong with your mod installation!", 4);
				Application.SetStackTraceLogType((LogType)4, (StackTraceLogType)1);
				return;
			}
			if (!_contentPacks.Exists)
			{
				_contentPacks.Create();
			}
			Log("Info:\r\nMod's folder name: " + Location.Name + "\r\nPlugins path: " + Paths.PluginPath + "\r\nContentPacks path: " + _contentPacks.FullName);
			TextureFile.BlitBleedSetup();
			Log("Calling _harmony.PatchAll");
			_harmony.PatchAll(Assembly.GetExecutingAssembly());
			TexReplacer.Go();
			Log("Loading Vanilla assets!", 2);
			LoadVanillaAssets();
			HairPartFolder.SetupVanillaHairParts();
			MiscPartFolder.SetupVanillaMiscParts();
			TailPartFolder.SetupVanillaTailParts();
			EarsPartFolder.SetupVanillaEarsParts();
			if (MainConfig._current._unarmedDiveJump.Value && WeaponItemFolder._weaponTypes.TryGetValue("Unarmed", out ScriptableWeaponType value))
			{
				WeaponTypeCombatParams val2 = value._weaponData._weaponTypeCombatParams[0];
				val2._allowJumpAttack = true;
				val2._timeBeforeJumpAttack = 0.08f;
				val2._JumpAttackJumpForce = 50f;
				val2._JumpAttackFowardForce = 90f;
				val2._JumpAttackJumpGravityMultiply = 50f;
				val2._jumpLandDelayTime = 0.5f;
			}
			Cond.IDSet();
			Log("Making Internal Sprites!", 2);
			string[] array = new string[13]
			{
				"based", "Nokia_3310", "BrokenDye", "joker", "VanityIco", "PortalIco", "ExitIco", "ForwardIco", "BackIco", "NextIco",
				"PreviousIco", "StorageIco", "DungeonIco"
			};
			string[] array2 = array;
			foreach (string text in array2)
			{
				Sprites.Add(text, MakeSprite(Internal.FullName, text));
			}
			MainThreadJobber._jobber = _homebreweryGameObject.AddComponent<MainThreadJobber>();
			if (MainConfig._current._newContentLoader.Value)
			{
				ContentLoader._current = _homebreweryGameObject.AddComponent<ContentLoader>();
			}
			else
			{
				OldContentLoader.Load();
			}
			Log("Registering chat commands!");
			Cmd.RegisterCommands();
			if (CT.Enabled)
			{
				CT.RegisterListeners();
			}
			_awakeCompleted = true;
			Application.SetStackTraceLogType((LogType)4, (StackTraceLogType)1);
		}

		internal static async Task Cache_HBScriptableAssets()
		{
			if (!_awakeCompleted)
			{
				Log("HB.Awake() did not complete, skipping Cache_HBScriptableAssets()!", 4);
				return;
			}
			Log("Cache_HBScriptableAssets()", 1);
			Log("Awaiting all import tasks!");
			await Task.WhenAll(OldContentLoader._importTasks).ConfigureAwait(continueOnCapturedContext: true);
			OldContentLoader._importTasks.Clear();
			ModelAliases();
			Log("Doing model part assignments!", 2);
			foreach (List<Action> value7 in OldContentLoader._modelPartAssignments.Values)
			{
				foreach (Action item in value7)
				{
					item();
				}
			}
			if (GM._cachedScriptableConditions.TryGetValue(0, out var value))
			{
				ScriptableStatusCondition val = (ScriptableStatusCondition)(object)((value is ScriptableStatusCondition) ? value : null);
				if (val != null)
				{
					Cond._bleed = val;
				}
			}
			if (GM._cachedScriptableConditions.TryGetValue(2, out value))
			{
				ScriptableStatusCondition val2 = (ScriptableStatusCondition)(object)((value is ScriptableStatusCondition) ? value : null);
				if (val2 != null)
				{
					Cond._cold = val2;
				}
			}
			if (GM._cachedScriptableConditions.TryGetValue(1, out value))
			{
				ScriptableStatusCondition val3 = (ScriptableStatusCondition)(object)((value is ScriptableStatusCondition) ? value : null);
				if (val3 != null)
				{
					Cond._burn = val3;
				}
			}
			if (GM._cachedScriptableConditions.TryGetValue(8, out value))
			{
				ScriptableStatusCondition val4 = (ScriptableStatusCondition)(object)((value is ScriptableStatusCondition) ? value : null);
				if (val4 != null)
				{
					Cond._poison = val4;
				}
			}
			if (MainConfig._current._newContentLoader.Value)
			{
				ContentLoader._current.InitAllItems();
				MouthPartFolder.ByrdleBeaksAndMouths();
			}
			Log("Sorting out fancy consumables!", 2);
			foreach (Action consumableDXAction in OldContentLoader._consumableDXActions)
			{
				consumableDXAction();
			}
			OldContentLoader._consumableDXActions.Clear();
			Log("Inserting Custom items!");
			foreach (Action addNewItem in ItemCraft._addNewItems)
			{
				addNewItem();
			}
			ItemCraft._addNewItems.Clear();
			Log("Sorting out weapon properties!", 2);
			foreach (Action weaponActionsAction in OldContentLoader._weaponActionsActions)
			{
				weaponActionsAction();
			}
			OldContentLoader._weaponActionsActions.Clear();
			Log("Inserting Custom parts!");
			if (_raceStructs.TryGetValue(RaceType.Byrdle, out var value2))
			{
				Log("Inserting Custom parts for Byrdle!", 1);
				OldContentLoader._addParts[RaceType.Byrdle][FolderType.Mouth] = OldContentLoader._addParts[RaceType.Byrdle][FolderType.Mouth].OrderBy((AnyThing m) => (!m._beak) ? 1 : 0).ToList();
				OldContentLoader.PartInserter(value2);
			}
			if (_raceStructs.TryGetValue(RaceType.Chang, out var value3))
			{
				Log("Inserting Custom parts for Chang!", 1);
				OldContentLoader.PartInserter(value3);
			}
			if (_raceStructs.TryGetValue(RaceType.Imp, out var value4))
			{
				Log("Inserting Custom parts for Imp!", 1);
				OldContentLoader.PartInserter(value4);
			}
			if (_raceStructs.TryGetValue(RaceType.Kubold, out var value5))
			{
				Log("Inserting Custom parts for Kubold!", 1);
				OldContentLoader.PartInserter(value5);
			}
			if (_raceStructs.TryGetValue(RaceType.Poon, out var value6))
			{
				Log("Inserting Custom parts for Poon!", 1);
				OldContentLoader.PartInserter(value6);
			}
			if (MainConfig._current._spreadVanillaParts.Value)
			{
				Log("Sharing Vanilla parts around!");
				Log("Sharing Vanilla parts to Byrdle!", 1);
				PartSpreader(value2);
				Log("Sharing Vanilla parts to Chang!", 1);
				PartSpreader(value3);
				Log("Sharing Vanilla parts to Imp!", 1);
				PartSpreader(value4);
				Log("Sharing Vanilla parts to Kubold!", 1);
				PartSpreader(value5);
				Log("Sharing Vanilla parts to Poon!", 1);
				PartSpreader(value6);
			}
			Log("Generating a shop source for some vanilla items!", 2);
			GetVanillaItems();
			Log("Organising the shop sources!", 2);
			for (int i = 1; i < OldContentLoader._modShops.Count; i++)
			{
				OldContentLoader._modShops[i].SortThem();
				OldContentLoader._modShops[i].ChunkThem();
				OldContentLoader._modShops[0]._items_Cons.AddRange(OldContentLoader._modShops[i]._items_Cons);
				OldContentLoader._modShops[0]._items_Gear.AddRange(OldContentLoader._modShops[i]._items_Gear);
				OldContentLoader._modShops[0]._items_Trad.AddRange(OldContentLoader._modShops[i]._items_Trad);
			}
			OldContentLoader._modShops[0].ChunkThem();
			if (MainConfig._current._condenseSmallMods.Value > 0)
			{
				Log("CondenseSmallMods config setting is active!", 2);
				ModShop modShop = new ModShop("Small Mods");
				foreach (ModShop item2 in OldContentLoader._modShops.ToList())
				{
					int num = item2._items_Gear.Count + item2._items_Trad.Count + item2._items_Cons.Count;
					if (num <= MainConfig._current._condenseSmallMods.Value)
					{
						modShop._items_Gear.AddRange(item2._items_Gear);
						modShop._items_Cons.AddRange(item2._items_Cons);
						modShop._items_Trad.AddRange(item2._items_Trad);
						OldContentLoader._modShops.Remove(item2);
					}
				}
				modShop.SortThem();
				modShop.ChunkThem();
				OldContentLoader._modShops.Add(modShop);
			}
			if (!MainConfig._current._noShop.Value)
			{
				Shop._current = _homebreweryGameObject.AddComponent<Shop>();
			}
			else
			{
				Log("NoShop config setting is set to true, so the mod item shop will not be accessible!", 3);
			}
			Phone._current = _homebreweryGameObject.AddComponent<Phone>();
		}

		internal static void ModelAliases()
		{
			string[][] array = new string[12][]
			{
				new string[2] { "hood", "hood01" },
				new string[2] { "robeSkirt", "robeSkirt01" },
				new string[2] { "armCuffs_00", "armCuff01" },
				new string[2] { "armCuffs_01", "armCuff02" },
				new string[2] { "armCuffs_02", "armCuff03" },
				new string[2] { "chestMesh_00", "chestpiece03" },
				new string[2] { "hipMesh_00", "legPads03" },
				new string[2] { "legCuffs_00", "legCuffs03" },
				new string[2] { "legCuffs_01", "shinPads01" },
				new string[2] { "chestTabard_00", "chestTabard02" },
				new string[2] { "chestTabard_01", "chestTabard03" },
				new string[2] { "belt_00", "beltSash02" }
			};
			string[][] array2 = array;
			foreach (string[] array3 in array2)
			{
				if (ARend.TryGetValue(array3[0], out ScriptableArmorRender value))
				{
					ARend[array3[1]] = value;
				}
			}
			string[][] array4 = new string[5][]
			{
				new string[2] { "_collar_00", "vikingArmor_collar" },
				new string[2] { "Catman-Homebrewery-Mesh-warlockArmor_collar", "warlockArmor_collar" },
				new string[2] { "Catman-Homebrewery-Mesh-thiefArmor_collar", "thiefArmor_collar" },
				new string[2] { "Catman-Homebrewery-Mesh-mysticArmor_collar", "mysticArmor_collar" },
				new string[2] { "Catman-Homebrewery-Mesh-maidArmor_collar", "maidArmor_collar" }
			};
			string[][] array5 = array4;
			foreach (string[] array6 in array5)
			{
				AMesh[array6[1]] = (Mesh)(AMesh.TryGetValue(array6[0], out Mesh value2) ? ((object)value2) : ((object)Assign.NothingMesh));
			}
		}

		internal static void WeaponTypeAliases()
		{
			Dictionary<string, string> dictionary = new Dictionary<string, string>
			{
				["Katars"] = "Dexterity_Melee_2H",
				["Scepter"] = "Mind_Ranged_1H",
				["Bell"] = "Mind_Ranged_2H",
				["Blade"] = "Sword",
				["Sword"] = "Strength_Melee_1H0",
				["Mace"] = "Strength_Melee_1H1",
				["Bow"] = "Dexterity_Ranged_2H0",
				["Shotgun"] = "Dexterity_Ranged_2H1",
				["Hammer"] = "Strength_Melee_2H0",
				["Greatblade"] = "Strength_Melee_2H1",
				["Polearm"] = "Strength_Melee_2H2"
			};
			foreach (var (key, key2) in dictionary)
			{
				if (WeaponItemFolder._weaponTypes.TryGetValue(key, out ScriptableWeaponType value))
				{
					WeaponItemFolder._weaponTypes[key2] = value;
				}
			}
		}

		private static void PartSpreader(RaceStruct thisrace)
		{
			foreach (RaceStruct value in _raceStructs.Values)
			{
				if (value._type == thisrace._type)
				{
					continue;
				}
				int num = 0;
				EyeTextureGroup[] eyes = value._eyes;
				foreach (EyeTextureGroup val in eyes)
				{
					int index = thisrace._scriptRace._eyeTextures.Length + num;
					string name = $"Atlyss-Eyes-{value._scriptRace._raceName}{num}";
					num++;
					EyesPartFolder._dictionary.AddName(thisrace._type, name, index);
				}
				ScriptablePlayerRace scriptRace = thisrace._scriptRace;
				EyeTextureGroup[] eyeTextures = thisrace._scriptRace._eyeTextures;
				EyeTextureGroup[] eyes2 = value._eyes;
				int num2 = 0;
				EyeTextureGroup[] array = (EyeTextureGroup[])(object)new EyeTextureGroup[eyeTextures.Length + eyes2.Length];
				ReadOnlySpan<EyeTextureGroup> readOnlySpan = new ReadOnlySpan<EyeTextureGroup>(eyeTextures);
				readOnlySpan.CopyTo(new Span<EyeTextureGroup>(array).Slice(num2, readOnlySpan.Length));
				num2 += readOnlySpan.Length;
				ReadOnlySpan<EyeTextureGroup> readOnlySpan2 = new ReadOnlySpan<EyeTextureGroup>(eyes2);
				readOnlySpan2.CopyTo(new Span<EyeTextureGroup>(array).Slice(num2, readOnlySpan2.Length));
				num2 += readOnlySpan2.Length;
				scriptRace._eyeTextures = array;
				num = 0;
				if (thisrace._type != RaceType.Kubold)
				{
					MouthTextureGroup[] mouth = value._mouth;
					foreach (MouthTextureGroup val2 in mouth)
					{
						int index = thisrace._scriptRace._mouthTextures.Length + num;
						string name2 = $"Atlyss-Mouth-{value._scriptRace._raceName}{num}";
						num++;
						MouthPartFolder._dictionary.AddName(thisrace._type, name2, index);
					}
					ScriptablePlayerRace scriptRace2 = thisrace._scriptRace;
					MouthTextureGroup[] mouthTextures = thisrace._scriptRace._mouthTextures;
					MouthTextureGroup[] mouth2 = value._mouth;
					num2 = 0;
					MouthTextureGroup[] array2 = (MouthTextureGroup[])(object)new MouthTextureGroup[mouthTextures.Length + mouth2.Length];
					ReadOnlySpan<MouthTextureGroup> readOnlySpan3 = new ReadOnlySpan<MouthTextureGroup>(mouthTextures);
					readOnlySpan3.CopyTo(new Span<MouthTextureGroup>(array2).Slice(num2, readOnlySpan3.Length));
					num2 += readOnlySpan3.Length;
					ReadOnlySpan<MouthTextureGroup> readOnlySpan4 = new ReadOnlySpan<MouthTextureGroup>(mouth2);
					readOnlySpan4.CopyTo(new Span<MouthTextureGroup>(array2).Slice(num2, readOnlySpan4.Length));
					num2 += readOnlySpan4.Length;
					scriptRace2._mouthTextures = array2;
				}
				num = 0;
				SkinTextureGroup[] skins = value._skins;
				foreach (SkinTextureGroup val3 in skins)
				{
					int index = thisrace._scriptRace._skinTextureGroups.Length + num;
					string name3 = $"Atlyss-Skin-{value._scriptRace._raceName}{num}";
					num++;
					SkinPartFolder._dictionary.AddName(thisrace._type, name3, index);
				}
				ScriptablePlayerRace scriptRace3 = thisrace._scriptRace;
				SkinTextureGroup[] skinTextureGroups = thisrace._scriptRace._skinTextureGroups;
				SkinTextureGroup[] skins2 = value._skins;
				num2 = 0;
				SkinTextureGroup[] array3 = (SkinTextureGroup[])(object)new SkinTextureGroup[skinTextureGroups.Length + skins2.Length];
				ReadOnlySpan<SkinTextureGroup> readOnlySpan5 = new ReadOnlySpan<SkinTextureGroup>(skinTextureGroups);
				readOnlySpan5.CopyTo(new Span<SkinTextureGroup>(array3).Slice(num2, readOnlySpan5.Length));
				num2 += readOnlySpan5.Length;
				ReadOnlySpan<SkinTextureGroup> readOnlySpan6 = new ReadOnlySpan<SkinTextureGroup>(skins2);
				readOnlySpan6.CopyTo(new Span<SkinTextureGroup>(array3).Slice(num2, readOnlySpan6.Length));
				num2 += readOnlySpan6.Length;
				scriptRace3._skinTextureGroups = array3;
			}
		}

		private static void GetVanillaItems()
		{
			ModShop modShop = new ModShop("Vanilla Items");
			OldContentLoader._modShops.Add(modShop);
			(string, int)[] array = new(string, int)[13]
			{
				("Red Dye", 1),
				("Orange Dye", 2),
				("Lime Dye", 3),
				("Green Dye", 4),
				("Blue Dye", 5),
				("Cyan Dye", 6),
				("Yellow Dye", 7),
				("Brown Dye", 8),
				("Pink Dye", 9),
				("Purple Dye", 10),
				("White Dye", 11),
				("Grey Dye", 12),
				("Black Dye", 13)
			};
			(string, int)[] array2 = array;
			for (int i = 0; i < array2.Length; i++)
			{
				(string, int) tuple = array2[i];
				string item = tuple.Item1;
				int item2 = tuple.Item2;
				VanillaItem vanillaItem = new VanillaItem(null, null, FolderType.Dye, (ShopTab)1)
				{
					_itemName = item,
					Added = true,
					SortTag = (SortTag)2,
					sortindex = item2
				};
				vanillaItem.ShopItem._scriptItem = GM._cachedScriptableItems[item];
				vanillaItem.ShopItem._itemNameTag = item;
				modShop._items_Cons.Add(vanillaItem);
				ScriptableItem scriptItem = vanillaItem.ShopItem._scriptItem;
				ScriptableArmorDye val = (ScriptableArmorDye)(object)((scriptItem is ScriptableArmorDye) ? scriptItem : null);
				if (val != null)
				{
					((ScriptableConsumable)val)._unperishable = true;
				}
			}
			string[] array3 = new string[5] { "Necro Marrow", "Leather Top", "Sagecloth Top", "Aero Top", "Nutso Top" };
			string[] array4 = array3;
			foreach (string text in array4)
			{
				VanillaItem vanillaItem2 = new VanillaItem(null, null, FolderType.Chestpiece, (ShopTab)0)
				{
					_itemName = text,
					Added = true
				};
				vanillaItem2.ShopItem._scriptItem = GM._cachedScriptableItems[text];
				vanillaItem2.ShopItem._itemNameTag = text;
				modShop._items_Gear.Add(vanillaItem2);
			}
			array3 = new string[5] { "Necro Caustics", "Leather Britches", "Sagecloth Shorts", "Aero Pants", "Nutso Pants" };
			string[] array5 = array3;
			foreach (string text2 in array5)
			{
				VanillaItem vanillaItem3 = new VanillaItem(null, null, FolderType.Leggings, (ShopTab)0)
				{
					_itemName = text2,
					Added = true
				};
				vanillaItem3.ShopItem._scriptItem = GM._cachedScriptableItems[text2];
				vanillaItem3.ShopItem._itemNameTag = text2;
				modShop._items_Gear.Add(vanillaItem3);
			}
		}

		private static Sprite MakeSprite(string path, string name)
		{
			//IL_006b: Unknown result type (might be due to invalid IL or missing references)
			//IL_0070: Unknown result type (might be due to invalid IL or missing references)
			//IL_0081: Unknown result type (might be due to invalid IL or missing references)
			//IL_0089: Unknown result type (might be due to invalid IL or missing references)
			//IL_009e: Unknown result type (might be due to invalid IL or missing references)
			//IL_00aa: Expected O, but got Unknown
			//IL_00cc: Unknown result type (might be due to invalid IL or missing references)
			//IL_00db: Unknown result type (might be due to invalid IL or missing references)
			string text = PathUtils.LongCombine(path, name + ".png");
			byte[] array = Array.Empty<byte>();
			if (!File.Exists(text))
			{
				string text2 = text;
				int bepinPathLength = _bepinPathLength;
				Log("[InternalFileMissing] Could not find the file: \"" + text2.Substring(bepinPathLength, text2.Length - bepinPathLength) + "\"", 4);
			}
			else
			{
				array = File.ReadAllBytes(text);
			}
			Texture2D val = new Texture2D(1, 1, (TextureFormat)5, false)
			{
				name = name + "_Tex",
				anisoLevel = 16,
				filterMode = (FilterMode)MainConfig._current._filterMode.Value,
				mipMapBias = 0f
			};
			ImageConversion.LoadImage(val, array, true);
			Sprite val2 = Sprite.Create(val, new Rect(0f, 0f, (float)((Texture)val).width, (float)((Texture)val).height), new Vector2(0.5f, 0.5f));
			((Object)val2).name = name + "_Spr";
			return val2;
		}

		private void Update()
		{
			//IL_015e: Unknown result type (might be due to invalid IL or missing references)
			//IL_0164: Invalid comparison between Unknown and I4
			if (Input.GetKey((KeyCode)308) && Input.GetKeyUp((KeyCode)120))
			{
				_hotkeysOn = !_hotkeysOn;
				Log($"Toggled hotkeysOn to {_hotkeysOn}");
			}
			if (!_chatIsKill)
			{
				try
				{
					SlashShortcut();
				}
				catch (Exception ex) when (((ex is MissingFieldException || ex is NullReferenceException) ? 1 : 0) != 0)
				{
					_chatIsKill = true;
					Log("SlashShortcut experienced a MissingField or NullRef Exception! Not trying again.", 4);
				}
			}
			if (!_hotkeysOn)
			{
				return;
			}
			bool flag = CheckMainPlayer() && !Player._mainPlayer._inChat && !Player._mainPlayer._inUI;
			if (!flag && Input.GetKeyDown((KeyCode)114) && Controls._anyCtrl)
			{
				if (!Controls._anyShift)
				{
					OldContentLoader.ReloadAll(nocheck: false);
				}
				else
				{
					OldContentLoader.ReloadAll(nocheck: true);
				}
			}
			if (flag)
			{
				if (!_shownUpdateMessage)
				{
					_shownUpdateMessage = true;
					if (!MainConfig._current._alwaysShowUpdateMsg.Value)
					{
						MainConfig._current._updateMessage.Value = UpdateCount;
					}
				}
				_foodLevel -= Time.deltaTime / MainConfig._current._foodDigestRate.Value;
				if (_foodLevel < 0f)
				{
					_foodLevel = 0f;
				}
			}
			MainMenuManager? obj = MainMenuManager._current.L<MainMenuManager>();
			if (obj != null && (int)obj._mainMenuCondition == 1 && (Object)(object)MainMenuManager._current._characterSelectManager.L<CharacterSelectManager>()?._setRaceModelED.L<RaceModelEquipDisplay>()?._playerRaceModel != (Object)null && !Controls._anyCtrl)
			{
				if (Input.GetKeyUp((KeyCode)119))
				{
					MainMenuManager._current._characterSelectManager._setRaceModelED._playerRaceModel.Set_EyeCondition((EyeCondition)1, 2f);
				}
				if (Input.GetKeyUp((KeyCode)115))
				{
					MainMenuManager._current._characterSelectManager._setRaceModelED._playerRaceModel.Set_EyeCondition((EyeCondition)2, 2f);
				}
				if (Input.GetKeyUp((KeyCode)97))
				{
					MainMenuManager._current._characterSelectManager._setRaceModelED._playerRaceModel.Set_EyeCondition((EyeCondition)3, 2f);
				}
				if (Input.GetKeyUp((KeyCode)100))
				{
					MainMenuManager._current._characterSelectManager._setRaceModelED._playerRaceModel.Set_EyeCondition((EyeCondition)4, 2f);
				}
				if (Input.GetKeyUp((KeyCode)101))
				{
					MainMenuManager._current._characterSelectManager._setRaceModelED._playerRaceModel.Set_EyeCondition((EyeCondition)8, 2f);
				}
				if (Input.GetKeyUp((KeyCode)113))
				{
					MainMenuManager._current._characterSelectManager._setRaceModelED._playerRaceModel.Set_EyeCondition((EyeCondition)7, 2f);
				}
				if (Input.GetKeyUp((KeyCode)114))
				{
					MainMenuManager._current._characterSelectManager._setRaceModelED._playerRaceModel.Set_EyeCondition((EyeCondition)5, 2f);
				}
				if (Input.GetKeyUp((KeyCode)102))
				{
					MainMenuManager._current._characterSelectManager._setRaceModelED._playerRaceModel.Set_MouthCondition((MouthCondition)1, 2f);
				}
			}
		}

		private void SlashShortcut()
		{
			if (MainConfig._current._slashShortcut.Value && Object.op_Implicit((Object)(object)Player._mainPlayer) && !Player._mainPlayer._bufferingStatus && !HostConsole._current._isOpen && !DialogManager._current._isDialogEnabled && !SettingsManager._current._isOpen && !ChatBehaviour._current._focusedInChat && ChatBehaviour._current._inputBuffer == 0f && Input.GetKeyDown((KeyCode)47))
			{
				if (Object.op_Implicit((Object)(object)ChatBehaviour._current._focusInputSfx))
				{
					ChatBehaviour._current.aSrc.PlayOneShot(ChatBehaviour._current._focusInputSfx, 0.55f);
				}
				ChatBehaviour._current._chatAssets._chatInput.ActivateInputField();
				ChatBehaviour._current._focusedInChat = true;
				ChatBehaviour._current._inputBuffer = 0.12f;
				((MonoBehaviour)this).StartCoroutine(AddSlash());
			}
		}

		[IteratorStateMachine(typeof(<AddSlash>d__69))]
		private static IEnumerator AddSlash()
		{
			//yield-return decompiler failed: Unexpected instruction in Iterator.Dispose()
			return new <AddSlash>d__69(0);
		}

		[DebuggerNonUserCode]
		internal static void DropMe(string item, int n = 1)
		{
			//IL_0021: Unknown result type (might be due to invalid IL or missing references)
			//IL_0026: Unknown result type (might be due to invalid IL or missing references)
			//IL_0032: Unknown result type (might be due to invalid IL or missing references)
			//IL_004d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0063: Expected O, but got Unknown
			if (!Cmd.ItemMatcher(item, out ScriptableItem firstmatch))
			{
				Log(item + " is not a real item!", 3);
				return;
			}
			GameManager._current.Client_SpawnLocalItemObject(new ItemData
			{
				_itemName = firstmatch._itemName,
				_quantity = n
			}, ((NetworkBehaviour)Player._mainPlayer).netIdentity, ((Component)Player._mainPlayer).transform.position, 0, ((Component)Player._mainPlayer).transform, true);
		}

		internal static void LoadVanillaAssets()
		{
			//IL_0106: Unknown result type (might be due to invalid IL or missing references)
			//IL_010b: Unknown result type (might be due to invalid IL or missing references)
			//IL_011b: Unknown result type (might be due to invalid IL or missing references)
			//IL_012c: Expected O, but got Unknown
			//IL_012c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0131: Unknown result type (might be due to invalid IL or missing references)
			//IL_0141: Unknown result type (might be due to invalid IL or missing references)
			//IL_0152: Expected O, but got Unknown
			//IL_0152: Unknown result type (might be due to invalid IL or missing references)
			//IL_0157: Unknown result type (might be due to invalid IL or missing references)
			//IL_0162: Unknown result type (might be due to invalid IL or missing references)
			//IL_016e: Expected O, but got Unknown
			//IL_016e: Unknown result type (might be due to invalid IL or missing references)
			//IL_0173: Unknown result type (might be due to invalid IL or missing references)
			//IL_017a: Unknown result type (might be due to invalid IL or missing references)
			//IL_0182: Expected O, but got Unknown
			_playerRace_imp = Resources.Load<ScriptablePlayerRace>("_race/01_race_imp/playerrace_imp");
			_playerRace_poon = Resources.Load<ScriptablePlayerRace>("_race/02_race_poon/playerrace_poon");
			_playerRace_kubold = Resources.Load<ScriptablePlayerRace>("_race/03_race_kubold/playerrace_kubold");
			_playerRace_byrdle = Resources.Load<ScriptablePlayerRace>("_race/04_race_byrdle/playerrace_byrdle");
			_playerRace_chang = Resources.Load<ScriptablePlayerRace>("_race/05_race_chang/playerrace_chang");
			_byrdleVanillaHairsCount = _playerRace_byrdle._hairStyleMeshes.Length;
			_raceStructs.Add(RaceType.Imp, new RaceStruct(RaceType.Imp, _playerRace_imp, _playerRace_imp._raceModel.GetComponent<PlayerRaceModel>()));
			_raceStructs.Add(RaceType.Poon, new RaceStruct(RaceType.Poon, _playerRace_poon, _playerRace_poon._raceModel.GetComponent<PlayerRaceModel>()));
			_raceStructs.Add(RaceType.Kubold, new RaceStruct(RaceType.Kubold, _playerRace_kubold, _playerRace_kubold._raceModel.GetComponent<PlayerRaceModel>()));
			_raceStructs.Add(RaceType.Chang, new RaceStruct(RaceType.Chang, _playerRace_chang, _playerRace_chang._raceModel.GetComponent<PlayerRaceModel>()));
			_playerRace_byrdle._disableEarSelector = false;
			_playerRace_byrdle._disableMouthSelector = false;
			MouthTextureGroup val = new MouthTextureGroup
			{
				_closed = Resources.Load<Texture>("_graphic/_mesh/00_player/player_meshes/_racemesh_byrdle/byrdlebeaktex_02"),
				_open = Resources.Load<Texture>("_graphic/_mesh/00_player/player_meshes/_racemesh_byrdle/byrdlebeaktex_02")
			};
			MouthTextureGroup val2 = new MouthTextureGroup
			{
				_closed = Resources.Load<Texture>("_graphic/_mesh/00_player/player_meshes/_racemesh_byrdle/byrdlebeaktex_01"),
				_open = Resources.Load<Texture>("_graphic/_mesh/00_player/player_meshes/_racemesh_byrdle/byrdlebeaktex_01")
			};
			MouthTextureGroup val3 = new MouthTextureGroup
			{
				_closed = (Texture)(object)Texture2D.blackTexture,
				_open = (Texture)(object)Texture2D.blackTexture
			};
			MouthTextureGroup val4 = new MouthTextureGroup
			{
				_closed = null,
				_open = null
			};
			_playerRace_byrdle._mouthTextures = Array.Empty<MouthTextureGroup>();
			_raceStructs.Add(RaceType.Byrdle, new RaceStruct(RaceType.Byrdle, _playerRace_byrdle, _playerRace_byrdle._raceModel.GetComponent<PlayerRaceModel>()));
			_byrdleVanillaBeaksCount = _raceStructs[RaceType.Byrdle]._miscSkinned.Length;
			_playerRace_byrdle._mouthTextures = (MouthTextureGroup[])(object)new MouthTextureGroup[4] { val4, val, val2, val3 };
			MouthPartFolder._dictionary.AddName(RaceType.Byrdle, "UseBeak'sTextureIfAny", 0);
			MouthPartFolder._dictionary.AddName(RaceType.Byrdle, "Atlyss-Byrdle-Mouth-ByrdleBeakTex_02", 1);
			MouthPartFolder._dictionary.AddName(RaceType.Byrdle, "Atlyss-Byrdle-Mouth-ByrdleBeakTex_01", 2);
			MouthPartFolder._dictionary.AddName(RaceType.Byrdle, "Catman-Homebrewery-Byrdle-Mouth-hbInvisBeak", 3);
			_unlitColorAdjustCutout = Resources.Load<Shader>("_graphic/_shader/unlit_coloradjust_cutout");
			List<Mesh> list = new List<Mesh>();
			list.AddRange(Resources.LoadAll<Mesh>("_graphic/_mesh/00_player/player_meshes/_armormeshes/_collars"));
			list.AddRange(Resources.LoadAll<Mesh>("_graphic/_mesh/00_player/player_meshes/_armormeshes/_shoulderpads/"));
			list.AddRange(Resources.LoadAll<Mesh>("_graphic/_mesh/00_player/player_meshes/_armormeshes/_helms/"));
			list.AddRange(Resources.LoadAll<Mesh>("_graphic/_mesh/00_player/player_meshes/_armormeshes/_capes/"));
			list.AddRange(Resources.LoadAll<Mesh>("_graphic/_mesh/03_item/03_shield/"));
			list.AddRange(Resources.LoadAll<Mesh>("_graphic/_mesh/03_item/01_weapon/"));
			IEnumerable<Mesh> enumerable = new <>z__ReadOnlyList<Mesh>(list);
			Mesh[] array = Resources.LoadAll<Mesh>("_graphic/_mesh/03_item/01_weapon/weapon_models");
			foreach (Mesh val5 in array)
			{
				Resources.UnloadAsset((Object)(object)val5);
			}
			foreach (Mesh item in enumerable)
			{
				if (!((Object)(object)item == (Object)null))
				{
					if (!AMesh.TryAdd(((Object)item).name, item) && !AMesh.TryAdd(((Object)item).name + "HB", item))
					{
						Log("Vanilla Mesh Name: " + ((Object)item).name + " is too frequent! Cannot add to Mesh Dictionary!", 4);
					}
					MeshObj.StashVanillaMesh(item, out string _);
				}
			}
			if (AMesh.Count == 0)
			{
				Log("No vanilla Meshes loaded! Gonna have to check the container paths in the assets!", 4);
			}
			else
			{
				DataExtractor._loadedAssetsList.AppendLine("Gear Meshes:");
				foreach (string key in AMesh.Keys)
				{
					DataExtractor._loadedAssetsList.AppendLine(key);
				}
			}
			List<Mesh> list2 = new List<Mesh>();
			list2.AddRange(Resources.LoadAll<Mesh>("_graphic/_mesh/00_player/player_meshes/_racemesh_byrdle/_hairstyles/"));
			list2.AddRange(Resources.LoadAll<Mesh>("_graphic/_mesh/00_player/player_meshes/_racemesh_chang/_hairstyles/"));
			list2.AddRange(Resources.LoadAll<Mesh>("_graphic/_mesh/00_player/player_meshes/_racemesh_imp/_hairstyles/"));
			list2.AddRange(Resources.LoadAll<Mesh>("_graphic/_mesh/00_player/player_meshes/_racemesh_kobold/_hairstyles/"));
			list2.AddRange(Resources.LoadAll<Mesh>("_graphic/_mesh/00_player/player_meshes/_racemesh_poon/_hairstyles/"));
			list2.Add(((IEnumerable<Mesh>)Resources.LoadAll<Mesh>("_graphic/_mesh/01_creep/mouth/mouthenemy_fbx")).FirstOrDefault((Func<Mesh, bool>)((Mesh m) => ((Object)m).name.Equals("_mouthEnemy_hair", StringComparison.OrdinalIgnoreCase))));
			list2.Add(((IEnumerable<Mesh>)Resources.LoadAll<Mesh>("_graphic/_mesh/01_creep/mouth/mouthenemy_alt00_fbx")).FirstOrDefault((Func<Mesh, bool>)((Mesh m) => ((Object)m).name.Equals("_mouthEnemy_alt00_hair", StringComparison.OrdinalIgnoreCase))));
			list2.Add(((IEnumerable<Mesh>)Resources.LoadAll<Mesh>("_graphic/_mesh/02_friendlynpc/angela/angela_mesh")).FirstOrDefault((Func<Mesh, bool>)((Mesh m) => ((Object)m).name.Equals("angela_hairTuft", StringComparison.OrdinalIgnoreCase))));
			list2.Add(((IEnumerable<Mesh>)Resources.LoadAll<Mesh>("_graphic/_mesh/02_friendlynpc/rukkah/ruko_fbx")).FirstOrDefault((Func<Mesh, bool>)((Mesh m) => ((Object)m).name.Equals("_ruko_hair", StringComparison.OrdinalIgnoreCase))));
			list2.Add(((IEnumerable<Mesh>)Resources.LoadAll<Mesh>("_graphic/_mesh/02_friendlynpc/sally/sally_fbx")).FirstOrDefault((Func<Mesh, bool>)((Mesh m) => ((Object)m).name.Equals("_sally_hair", StringComparison.OrdinalIgnoreCase))));
			list2.Add(((IEnumerable<Mesh>)Resources.LoadAll<Mesh>("_graphic/_mesh/02_friendlynpc/sallyworkers/_sallyworker_00/_sallyworker_00")).FirstOrDefault((Func<Mesh, bool>)((Mesh m) => ((Object)m).name.Equals("_sallyworker00_hair", StringComparison.OrdinalIgnoreCase))));
			list2.Add(((IEnumerable<Mesh>)Resources.LoadAll<Mesh>("_graphic/_mesh/02_friendlynpc/vivian/vivi_fbx")).FirstOrDefault((Func<Mesh, bool>)((Mesh m) => ((Object)m).name.Equals("_vivi_hair", StringComparison.OrdinalIgnoreCase))));
			IEnumerable<Mesh> enumerable2 = new <>z__ReadOnlyList<Mesh>(list2);
			List<string> list3 = new List<string>();
			foreach (Mesh item2 in enumerable2)
			{
				if (!((Object)(object)item2 == (Object)null) && MeshObj.StashVanillaMesh(item2, out string meshname2))
				{
					list3.Add(meshname2);
				}
			}
			if (list3.Count == 0)
			{
				Log("No vanilla Hair Meshes loaded! Gonna have to check the container paths in the assets!", 4);
			}
			else
			{
				DataExtractor._loadedAssetsList.AppendLine("\nHair Meshes:");
				foreach (string item3 in list3)
				{
					DataExtractor._loadedAssetsList.AppendLine(item3);
				}
			}
			Mesh[] array2 = Resources.LoadAll<Mesh>("_graphic/_mesh/00_player/player_meshes/_racemesh_imp/_horns/");
			Mesh[] array3 = Resources.LoadAll<Mesh>("_graphic/_mesh/00_player/player_meshes/_racemesh_kobold/_horns/");
			Mesh[] array4 = Resources.LoadAll<Mesh>("_graphic/_mesh/00_player/player_meshes/_racemesh_poon/_horns/");
			int num = 0;
			Mesh[] array5 = (Mesh[])(object)new Mesh[8 + (array2.Length + array3.Length + array4.Length)];
			ReadOnlySpan<Mesh> readOnlySpan = new ReadOnlySpan<Mesh>(array2);
			readOnlySpan.CopyTo(new Span<Mesh>(array5).Slice(num, readOnlySpan.Length));
			num += readOnlySpan.Length;
			ReadOnlySpan<Mesh> readOnlySpan2 = new ReadOnlySpan<Mesh>(array3);
			readOnlySpan2.CopyTo(new Span<Mesh>(array5).Slice(num, readOnlySpan2.Length));
			num += readOnlySpan2.Length;
			ReadOnlySpan<Mesh> readOnlySpan3 = new ReadOnlySpan<Mesh>(array4);
			readOnlySpan3.CopyTo(new Span<Mesh>(array5).Slice(num, readOnlySpan3.Length));
			num += readOnlySpan3.Length;
			array5[num] = ((IEnumerable<Mesh>)Resources.LoadAll<Mesh>("_graphic/_mesh/01_creep/lordboar/lordboar")).FirstOrDefault((Func<Mesh, bool>)((Mesh m) => ((Object)m).name.Equals("_lordBoar_horns", StringComparison.OrdinalIgnoreCase)));
			num++;
			array5[num] = ((IEnumerable<Mesh>)Resources.LoadAll<Mesh>("_graphic/_mesh/01_creep/mekboar/mekboar_fbx")).FirstOrDefault((Func<Mesh, bool>)((Mesh m) => ((Object)m).name.Equals("mekboar_horn", StringComparison.OrdinalIgnoreCase)));
			num++;
			array5[num] = ((IEnumerable<Mesh>)Resources.LoadAll<Mesh>("_graphic/_mesh/01_creep/moth/mothcreep_fbx")).FirstOrDefault((Func<Mesh, bool>)((Mesh m) => ((Object)m).name.Equals("_moth_horn", StringComparison.OrdinalIgnoreCase)));
			num++;
			array5[num] = ((IEnumerable<Mesh>)Resources.LoadAll<Mesh>("_graphic/_mesh/01_creep/rageboar/rageboar_fbx")).FirstOrDefault((Func<Mesh, bool>)((Mesh m) => ((Object)m).name.Equals("rageBoar_horn", StringComparison.OrdinalIgnoreCase)));
			num++;
			array5[num] = ((IEnumerable<Mesh>)Resources.LoadAll<Mesh>("_graphic/_mesh/01_creep/warboar/warboar_fbx")).FirstOrDefault((Func<Mesh, bool>)((Mesh m) => ((Object)m).name.Equals("warboar_horn", StringComparison.OrdinalIgnoreCase)));
			num++;
			array5[num] = ((IEnumerable<Mesh>)Resources.LoadAll<Mesh>("_graphic/_mesh/01_creep/wizboar/wizboar")).FirstOrDefault((Func<Mesh, bool>)((Mesh m) => ((Object)m).name.Equals("wizboar_scepter", StringComparison.OrdinalIgnoreCase)));
			num++;
			array5[num] = ((IEnumerable<Mesh>)Resources.LoadAll<Mesh>("_graphic/_mesh/02_friendlynpc/angela/angela_mesh")).FirstOrDefault((Func<Mesh, bool>)((Mesh m) => ((Object)m).name.Equals("angela_horns", StringComparison.OrdinalIgnoreCase)));
			num++;
			array5[num] = ((IEnumerable<Mesh>)Resources.LoadAll<Mesh>("_graphic/_mesh/02_friendlynpc/enok/enok_fbx")).FirstOrDefault((Func<Mesh, bool>)((Mesh m) => ((Object)m).name.Equals("_enok_horns", StringComparison.OrdinalIgnoreCase)));
			IEnumerable<Mesh> enumerable3 = new <>z__ReadOnlyArray<Mesh>(array5);
			List<string> list4 = new List<string>();
			foreach (Mesh item4 in enumerable3)
			{
				if (!((Object)(object)item4 == (Object)null) && MeshObj.StashVanillaMesh(item4, out string meshname3))
				{
					list4.Add(meshname3);
				}
			}
			if (list4.Count == 0)
			{
				Log("No vanilla Static Misc Meshes loaded! Gonna have to check the container paths in the assets!", 4);
			}
			else
			{
				DataExtractor._loadedAssetsList.AppendLine("\nStatic Misc Meshes:");
				foreach (string item5 in list4)
				{
					DataExtractor._loadedAssetsList.AppendLine(item5);
				}
			}
			ScriptableArmorRender[] array6 = Resources.LoadAll<ScriptableArmorRender>("_graphic/_mesh/00_player/player_meshes/_armormeshes");
			foreach (ScriptableArmorRender val6 in array6)
			{
				ARend[((Object)val6).name.Replace("00_armorRender_", string.Empty, StringComparison.OrdinalIgnoreCase).Replace("armorRender_", string.Empty, StringComparison.OrdinalIgnoreCase).Replace("helmRender_", string.Empty, StringComparison.OrdinalIgnoreCase)] = val6;
				ArmorRenderFile.StashVanillaArmorRender(val6);
			}
			if (ARend.Count == 0)
			{
				Log("No vanilla ScriptableArmorRenders loaded! Gonna have to check the container paths in the assets!", 4);
			}
			else
			{
				DataExtractor._loadedAssetsList.AppendLine("\nArmorRenders:");
				foreach (string key2 in ARend.Keys)
				{
					DataExtractor._loadedAssetsList.AppendLine(key2);
				}
			}
			DataExtractor._loadedAssetsList.AppendLine("\nWeaponTypes:");
			ScriptableWeaponType[] array7 = Resources.LoadAll<ScriptableWeaponType>("_weapontype/");
			foreach (ScriptableWeaponType val7 in array7)
			{
				WeaponItemFolder._weaponTypes[val7._weaponTypeClassTag] = val7;
				DataExtractor._loadedAssetsList.AppendLine(val7._weaponTypeClassTag);
			}
			WeaponTypeAliases();
			if (WeaponItemFolder._weaponTypes.Count == 0)
			{
				Log("No ScriptableWeaponTypes loaded! Gonna have to check the container paths in the assets!", 4);
			}
			List<ScriptableWeaponProjectileSet> list5 = new List<ScriptableWeaponProjectileSet>();
			list5.AddRange(Resources.LoadAll<ScriptableWeaponProjectileSet>("_item/01_equipment/02_weapon/01_dexterity/00_rangewe