Decompiled source of TeleportationMeads v1.1.9

TeleportationMeads.dll

Decompiled 6 months ago
using System;
using System.Collections;
using System.Collections.Concurrent;
using System.Collections.Generic;
using System.Collections.ObjectModel;
using System.ComponentModel;
using System.Diagnostics;
using System.Diagnostics.CodeAnalysis;
using System.Globalization;
using System.IO;
using System.IO.Compression;
using System.Linq;
using System.Linq.Expressions;
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;
using System.Runtime.Serialization;
using System.Runtime.Versioning;
using System.Security;
using System.Security.Permissions;
using System.Text;
using System.Text.RegularExpressions;
using BepInEx;
using BepInEx.Bootstrap;
using BepInEx.Configuration;
using BepInEx.Logging;
using HarmonyLib;
using JetBrains.Annotations;
using LocalizationManager;
using Microsoft.CodeAnalysis;
using ServerSync;
using TMPro;
using TeleportationMeads.Patches;
using TeleportationMeads.Utils;
using UnityEngine;
using YamlDotNet.Core;
using YamlDotNet.Core.Events;
using YamlDotNet.Core.Tokens;
using YamlDotNet.Helpers;
using YamlDotNet.Serialization;
using YamlDotNet.Serialization.Converters;
using YamlDotNet.Serialization.EventEmitters;
using YamlDotNet.Serialization.NamingConventions;
using YamlDotNet.Serialization.NodeDeserializers;
using YamlDotNet.Serialization.NodeTypeResolvers;
using YamlDotNet.Serialization.ObjectFactories;
using YamlDotNet.Serialization.ObjectGraphTraversalStrategies;
using YamlDotNet.Serialization.ObjectGraphVisitors;
using YamlDotNet.Serialization.Schemas;
using YamlDotNet.Serialization.TypeInspectors;
using YamlDotNet.Serialization.TypeResolvers;
using YamlDotNet.Serialization.Utilities;
using YamlDotNet.Serialization.ValueDeserializers;

[assembly: Guid("FA376F04-B198-46F3-AB15-BE149FDAD33F")]
[assembly: ComVisible(false)]
[assembly: AssemblyTrademark("")]
[assembly: AssemblyCopyright("Copyright ©  2023")]
[assembly: AssemblyProduct("TeleportationMeads")]
[assembly: AssemblyCompany("blacks7ar")]
[assembly: TargetFramework(".NETFramework,Version=v4.6.2", FrameworkDisplayName = ".NET Framework 4.6.2")]
[assembly: AssemblyDescription("https://valheim.thunderstore.io/package/blacks7ar/TeleportationMeads/")]
[assembly: AssemblyTitle("TeleportationMeads")]
[assembly: Debuggable(DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints)]
[assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)]
[assembly: CompilationRelaxations(8)]
[assembly: AssemblyFileVersion("1.1.9")]
[assembly: AssemblyConfiguration("")]
[assembly: SecurityPermission(SecurityAction.RequestMinimum, SkipVerification = true)]
[assembly: AssemblyVersion("1.1.9.0")]
[module: UnverifiableCode]
namespace TeleportationMeads
{
	[BepInPlugin("blacks7ar.TeleportationMeads", "TeleportationMeads", "1.1.9")]
	public class Plugin : BaseUnityPlugin
	{
		private const string modGUID = "blacks7ar.TeleportationMeads";

		public const string modName = "TeleportationMeads";

		public const string modAuthor = "blacks7ar";

		public const string modVersion = "1.1.9";

		public const string modLink = "https://valheim.thunderstore.io/package/blacks7ar/TeleportationMeads/";

		private static string configFileName = "blacks7ar.TeleportationMeads.cfg";

		private static string configFileFullPath;

		public static readonly ManualLogSource TMLogger;

		private static readonly Harmony _harmony;

		private static readonly ConfigSync _configSync;

		private static ConfigEntry<Toggle> _serverConfigLocked;

		public static ConfigEntry<float> _huginsMeadCD;

		public static ConfigEntry<float> _haldorsMeadCD;

		public static ConfigEntry<float> _odinsMeadCD;

		public static ConfigEntry<float> _knarrsMeadCD;

		public static ConfigEntry<float> _herculesMeadCD;

		public static ConfigEntry<float> _herculesMeadEffectDuration;

		public static ConfigEntry<float> _dvergersMeadCD;

		public static ConfigEntry<float> _hildirsMeadCD;

		public static Vector3 _savedPosition;

		public static Vector3 _spawnPoint;

		public static Vector3 _startPoint;

		public static Vector3 _traderPoint;

		public static Vector3 _hildirPoint;

		public static bool _portalActivated;

		public static bool _haldorsMeadUsed;

		public static bool _odinsMeadUsed;

		public static bool _huginsMeadUsed;

		public static bool _dvergersMeadUsed;

		public static bool _hildirsMeadUsed;

		public static bool _countBegan;

		public static Plugin _Instance;

		public static readonly Dictionary<GameObject, GameObject> ToBeFermented;

		public static readonly Dictionary<GameObject, GameObject> ToBeFermented2;

		public ConfigEntry<T> config<T>(string group, string name, T value, ConfigDescription description, bool synchronizedConfig = true)
		{
			//IL_002a: Unknown result type (might be due to invalid IL or missing references)
			//IL_0030: Expected O, but got Unknown
			ConfigDescription val = new ConfigDescription(description.Description + (synchronizedConfig ? " [Synced with Server]" : " [Not Synced with Server]"), description.AcceptableValues, description.Tags);
			ConfigEntry<T> val2 = ((BaseUnityPlugin)this).Config.Bind<T>(group, name, value, val);
			_configSync.AddConfigEntry<T>(val2).SynchronizedConfig = synchronizedConfig;
			return val2;
		}

		private void ConfigWatcher()
		{
			FileSystemWatcher fileSystemWatcher = new FileSystemWatcher(Paths.ConfigPath, configFileName);
			fileSystemWatcher.Changed += OnConfigChanged;
			fileSystemWatcher.Created += OnConfigChanged;
			fileSystemWatcher.Renamed += OnConfigChanged;
			fileSystemWatcher.IncludeSubdirectories = true;
			fileSystemWatcher.SynchronizingObject = ThreadingHelper.SynchronizingObject;
			fileSystemWatcher.EnableRaisingEvents = true;
		}

		private void OnConfigChanged(object sender, FileSystemEventArgs e)
		{
			if (!File.Exists(configFileFullPath))
			{
				return;
			}
			try
			{
				Logging.LogDebug("ReadConfigValues called");
				((BaseUnityPlugin)this).Config.Reload();
			}
			catch
			{
				Logging.LogError("There was an issue loading your " + configFileName);
				Logging.LogError("Please check your config entries for spelling and format!");
			}
		}

		public void Awake()
		{
			//IL_0022: Unknown result type (might be due to invalid IL or missing references)
			//IL_002d: Expected O, but got Unknown
			//IL_0081: Unknown result type (might be due to invalid IL or missing references)
			//IL_008c: Expected O, but got Unknown
			//IL_00cb: Unknown result type (might be due to invalid IL or missing references)
			//IL_00d6: Expected O, but got Unknown
			//IL_0115: Unknown result type (might be due to invalid IL or missing references)
			//IL_0120: Expected O, but got Unknown
			//IL_015f: Unknown result type (might be due to invalid IL or missing references)
			//IL_016a: Expected O, but got Unknown
			//IL_01ab: Unknown result type (might be due to invalid IL or missing references)
			//IL_01b6: Expected O, but got Unknown
			//IL_01e1: Unknown result type (might be due to invalid IL or missing references)
			//IL_01ec: Expected O, but got Unknown
			//IL_022d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0238: Expected O, but got Unknown
			//IL_0279: Unknown result type (might be due to invalid IL or missing references)
			//IL_0284: Expected O, but got Unknown
			Localizer.Load();
			_Instance = this;
			_serverConfigLocked = config("1- ServerSync", "Lock Configuration", Toggle.On, new ConfigDescription("If On, the configuration is locked and can be changed by server admins only.", (AcceptableValueBase)null, Array.Empty<object>()));
			_configSync.AddLockingConfigEntry<Toggle>(_serverConfigLocked);
			PrefabSetup.Init();
			string group = Localization.instance.Localize("$btm_haldormead").Trim();
			_haldorsMeadCD = config(group, "Haldors Mead Cooldown", 60f, new ConfigDescription("Haldor's mead cooldown duration in seconds. (Recommended: 60)", (AcceptableValueBase)(object)new AcceptableValueRange<float>(30f, 420f), Array.Empty<object>()));
			string group2 = Localization.instance.Localize("$btm_odinmead").Trim();
			_odinsMeadCD = config(group2, "Odins Mead Cooldown", 120f, new ConfigDescription("Odin's mead cooldown duration in seconds. (Recommended: 120)", (AcceptableValueBase)(object)new AcceptableValueRange<float>(30f, 420f), Array.Empty<object>()));
			string group3 = Localization.instance.Localize("$btm_knarrmead").Trim();
			_knarrsMeadCD = config(group3, "Knarrs Mead Cooldown", 60f, new ConfigDescription("Knarr's mead cooldown duration in seconds. (Recommended: 60)", (AcceptableValueBase)(object)new AcceptableValueRange<float>(30f, 420f), Array.Empty<object>()));
			string group4 = Localization.instance.Localize("$btm_huginmead").Trim();
			_huginsMeadCD = config(group4, "Hugins Mead Cooldown", 120f, new ConfigDescription("Knarr's Mead cooldown duration in seconds. (Recommended: 120)", (AcceptableValueBase)(object)new AcceptableValueRange<float>(30f, 420f), Array.Empty<object>()));
			string group5 = Localization.instance.Localize("$btm_herculesmead").Trim();
			_herculesMeadCD = config(group5, "Hercules Mead Cooldown", 420f, new ConfigDescription("Hercules mead cooldown duration in seconds. (Recommended: 420)", (AcceptableValueBase)(object)new AcceptableValueRange<float>(30f, 420f), Array.Empty<object>()));
			_herculesMeadEffectDuration = config(group5, "Herculean Buff Duration", 300f, new ConfigDescription("Herculean Buff duration in seconds. (Recommended: 300)", (AcceptableValueBase)(object)new AcceptableValueRange<float>(30f, 420f), Array.Empty<object>()));
			string group6 = Localization.instance.Localize("$btm_dvergrmead").Trim();
			_dvergersMeadCD = config(group6, "Dvergers Mead Cooldown", 120f, new ConfigDescription("Dvergers mead cooldown duration in seconds. (Recommended: 120)", (AcceptableValueBase)(object)new AcceptableValueRange<float>(30f, 420f), Array.Empty<object>()));
			string group7 = Localization.instance.Localize("$btm_hildirsmead").Trim();
			_hildirsMeadCD = config(group7, "Hildirs Mead Cooldown", 120f, new ConfigDescription("Hildirs mead cooldown duration in seconds.", (AcceptableValueBase)(object)new AcceptableValueRange<float>(30f, 420f), Array.Empty<object>()));
			ToBeFermented.Add(PrefabSetup._haldorMeadBase, PrefabSetup._haldorMead);
			ToBeFermented2.Add(PrefabSetup._odinMeadBase, PrefabSetup._odinMead);
			ToBeFermented.Add(PrefabSetup._knarrMeadBase, PrefabSetup._knarrMead);
			ToBeFermented.Add(PrefabSetup._huginMeadBase, PrefabSetup._huginMead);
			ToBeFermented.Add(PrefabSetup._herculesMeadBase, PrefabSetup._herculesMead);
			ToBeFermented2.Add(PrefabSetup._dvergrMeadBase, PrefabSetup._dvergrMead);
			ToBeFermented2.Add(PrefabSetup._hildirsMeadBase, PrefabSetup._hildirsMead);
			ConfigSetup.Init();
			Assembly executingAssembly = Assembly.GetExecutingAssembly();
			_harmony.PatchAll(executingAssembly);
			ConfigWatcher();
		}

		private void OnDestroy()
		{
			((BaseUnityPlugin)this).Config.Save();
		}

		static Plugin()
		{
			//IL_003f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0049: Expected O, but got Unknown
			string configPath = Paths.ConfigPath;
			char directorySeparatorChar = Path.DirectorySeparatorChar;
			configFileFullPath = configPath + directorySeparatorChar + configFileName;
			TMLogger = Logger.CreateLogSource("TeleportationMeads");
			_harmony = new Harmony("blacks7ar.TeleportationMeads");
			_configSync = new ConfigSync("blacks7ar.TeleportationMeads")
			{
				DisplayName = "TeleportationMeads",
				CurrentVersion = "1.1.9",
				MinimumRequiredVersion = "1.1.9"
			};
			ToBeFermented = new Dictionary<GameObject, GameObject>();
			ToBeFermented2 = new Dictionary<GameObject, GameObject>();
		}
	}
}
namespace TeleportationMeads.Utils
{
	public static class Logging
	{
		public static void LogDebug(string debug)
		{
			Plugin.TMLogger.LogDebug((object)debug);
		}

		public static void LogInfo(string info)
		{
			Plugin.TMLogger.LogInfo((object)info);
		}

		public static void LogWarning(string warning)
		{
			Plugin.TMLogger.LogWarning((object)warning);
		}

		public static void LogError(string error)
		{
			Plugin.TMLogger.LogError((object)error);
		}
	}
	public enum Toggle
	{
		On = 1,
		Off = 0
	}
	internal static class Helper
	{
		public static SE_Stats CreateStatusEffects(string effectName, string m_name, Sprite icon)
		{
			SE_Stats obj = ScriptableObject.CreateInstance<SE_Stats>();
			((Object)obj).name = effectName;
			((StatusEffect)obj).m_name = m_name;
			((StatusEffect)obj).m_tooltip = m_name;
			((StatusEffect)obj).m_icon = icon;
			return obj;
		}

		public static SE_Stats CreateHerculeanBuff(string effectName, string m_name, Sprite icon)
		{
			//IL_0023: Unknown result type (might be due to invalid IL or missing references)
			//IL_0035: Unknown result type (might be due to invalid IL or missing references)
			SE_Stats obj = ScriptableObject.CreateInstance<SE_Stats>();
			((Object)obj).name = effectName;
			((StatusEffect)obj).m_name = m_name;
			((StatusEffect)obj).m_tooltip = m_name;
			((StatusEffect)obj).m_icon = icon;
			((StatusEffect)obj).m_startMessageType = (MessageType)2;
			((StatusEffect)obj).m_startMessage = "<size=28><color=red>Herculean Buff</color> started, your Max Carry Weight is now Doubled.</size>";
			((StatusEffect)obj).m_stopMessageType = (MessageType)2;
			((StatusEffect)obj).m_stopMessage = "<size=28><color=red>Herculean Buff</color> ended, your Max Carry Weight is now back to normal.</size>";
			return obj;
		}

		public static void AddClonedObject(this ZNetScene zNetScene, GameObject gameObject, bool overWrite = true)
		{
			GameObject prefab;
			if ((Object)(object)(prefab = zNetScene.GetPrefab(((Object)gameObject).name)) != (Object)null)
			{
				if (!overWrite)
				{
					return;
				}
				zNetScene.m_prefabs.Remove(prefab);
				zNetScene.m_namedPrefabs.Remove(StringExtensionMethods.GetStableHashCode(((Object)gameObject).name));
			}
			zNetScene.m_prefabs.Add(gameObject);
			zNetScene.m_namedPrefabs.Add(StringExtensionMethods.GetStableHashCode(((Object)gameObject).name), gameObject);
		}

		public static void AddClonedObject(this ObjectDB objectDB, GameObject gameObject, bool overWrite = true)
		{
			GameObject itemPrefab;
			if ((Object)(object)(itemPrefab = objectDB.GetItemPrefab(((Object)gameObject).name)) != (Object)null)
			{
				if (!overWrite)
				{
					return;
				}
				objectDB.m_items.Remove(itemPrefab);
				objectDB.m_itemByHash.Remove(StringExtensionMethods.GetStableHashCode(((Object)gameObject).name));
			}
			objectDB.m_items.Add(gameObject);
			objectDB.m_itemByHash.Add(StringExtensionMethods.GetStableHashCode(((Object)gameObject).name), gameObject);
		}

		public static void AddRecipe(this ObjectDB objectDB, Recipe recipe, bool overWrite = true)
		{
			if (objectDB.m_recipes.Contains(recipe))
			{
				if (!overWrite)
				{
					return;
				}
				objectDB.m_recipes.Remove(recipe);
			}
			objectDB.m_recipes.Add(recipe);
		}

		public static bool ObjectDBAwake()
		{
			if ((Object)(object)ObjectDB.instance != (Object)null && ObjectDB.instance.m_items.Count != 0)
			{
				return (Object)(object)ObjectDB.instance.GetItemPrefab("Wood") != (Object)null;
			}
			return false;
		}

		public static bool ZNetSceneAwake()
		{
			if ((Object)(object)ZNetScene.instance != (Object)null && ZNetScene.instance.m_prefabs.Count != 0)
			{
				return (Object)(object)ZNetScene.instance.GetPrefab("piece_workbench") != (Object)null;
			}
			return false;
		}
	}
}
namespace TeleportationMeads.Patches
{
	public static class ConfigSetup
	{
		public static ConfigEntry<bool> _dvergrMeadBaseEnable;

		public static ConfigEntry<string> _dvergrMeadBaseMat1;

		public static ConfigEntry<string> _dvergrMeadBaseMat2;

		public static ConfigEntry<string> _dvergrMeadBaseMat3;

		public static ConfigEntry<string> _dvergrMeadBaseMat4;

		public static ConfigEntry<bool> _haldorMeadBaseEnable;

		public static ConfigEntry<string> _haldorMeadBaseMat1;

		public static ConfigEntry<string> _haldorMeadBaseMat2;

		public static ConfigEntry<string> _haldorMeadBaseMat3;

		public static ConfigEntry<string> _haldorMeadBaseMat4;

		public static ConfigEntry<bool> _herculesMeadBaseEnable;

		public static ConfigEntry<string> _herculesMeadBaseMat1;

		public static ConfigEntry<string> _herculesMeadBaseMat2;

		public static ConfigEntry<string> _herculesMeadBaseMat3;

		public static ConfigEntry<string> _herculesMeadBaseMat4;

		public static ConfigEntry<bool> _huginMeadBaseEnable;

		public static ConfigEntry<string> _huginMeadBaseMat1;

		public static ConfigEntry<string> _huginMeadBaseMat2;

		public static ConfigEntry<string> _huginMeadBaseMat3;

		public static ConfigEntry<string> _huginMeadBaseMat4;

		public static ConfigEntry<bool> _knarrMeadBaseEnable;

		public static ConfigEntry<string> _knarrMeadBaseMat1;

		public static ConfigEntry<string> _knarrMeadBaseMat2;

		public static ConfigEntry<string> _knarrMeadBaseMat3;

		public static ConfigEntry<string> _knarrMeadBaseMat4;

		public static ConfigEntry<bool> _odinsMeadBaseEnable;

		public static ConfigEntry<string> _odinsMeadBaseMat1;

		public static ConfigEntry<string> _odinsMeadBaseMat2;

		public static ConfigEntry<string> _odinsMeadBaseMat3;

		public static ConfigEntry<string> _odinsMeadBaseMat4;

		public static ConfigEntry<bool> _hildirsMeadBaseEnable;

		public static ConfigEntry<string> _hildirsMeadBaseMat1;

		public static ConfigEntry<string> _hildirsMeadBaseMat2;

		public static ConfigEntry<string> _hildirsMeadBaseMat3;

		public static ConfigEntry<string> _hildirsMeadBaseMat4;

		public static void Init()
		{
			//IL_002c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0037: Expected O, but got Unknown
			//IL_0057: Unknown result type (might be due to invalid IL or missing references)
			//IL_0062: Expected O, but got Unknown
			//IL_0082: Unknown result type (might be due to invalid IL or missing references)
			//IL_008d: Expected O, but got Unknown
			//IL_00ad: Unknown result type (might be due to invalid IL or missing references)
			//IL_00b8: Expected O, but got Unknown
			//IL_00d8: Unknown result type (might be due to invalid IL or missing references)
			//IL_00e3: Expected O, but got Unknown
			//IL_0114: Unknown result type (might be due to invalid IL or missing references)
			//IL_011f: Expected O, but got Unknown
			//IL_013f: Unknown result type (might be due to invalid IL or missing references)
			//IL_014a: Expected O, but got Unknown
			//IL_016a: Unknown result type (might be due to invalid IL or missing references)
			//IL_0175: Expected O, but got Unknown
			//IL_0195: Unknown result type (might be due to invalid IL or missing references)
			//IL_01a0: Expected O, but got Unknown
			//IL_01c0: Unknown result type (might be due to invalid IL or missing references)
			//IL_01cb: Expected O, but got Unknown
			//IL_01fc: Unknown result type (might be due to invalid IL or missing references)
			//IL_0207: Expected O, but got Unknown
			//IL_0227: Unknown result type (might be due to invalid IL or missing references)
			//IL_0232: Expected O, but got Unknown
			//IL_0252: Unknown result type (might be due to invalid IL or missing references)
			//IL_025d: Expected O, but got Unknown
			//IL_027d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0288: Expected O, but got Unknown
			//IL_02a8: Unknown result type (might be due to invalid IL or missing references)
			//IL_02b3: Expected O, but got Unknown
			//IL_02e4: Unknown result type (might be due to invalid IL or missing references)
			//IL_02ef: Expected O, but got Unknown
			//IL_030f: Unknown result type (might be due to invalid IL or missing references)
			//IL_031a: Expected O, but got Unknown
			//IL_033a: Unknown result type (might be due to invalid IL or missing references)
			//IL_0345: Expected O, but got Unknown
			//IL_0365: Unknown result type (might be due to invalid IL or missing references)
			//IL_0370: Expected O, but got Unknown
			//IL_0390: Unknown result type (might be due to invalid IL or missing references)
			//IL_039b: Expected O, but got Unknown
			//IL_03ce: Unknown result type (might be due to invalid IL or missing references)
			//IL_03d9: Expected O, but got Unknown
			//IL_03fa: Unknown result type (might be due to invalid IL or missing references)
			//IL_0405: Expected O, but got Unknown
			//IL_0426: Unknown result type (might be due to invalid IL or missing references)
			//IL_0431: Expected O, but got Unknown
			//IL_0452: Unknown result type (might be due to invalid IL or missing references)
			//IL_045d: Expected O, but got Unknown
			//IL_047e: Unknown result type (might be due to invalid IL or missing references)
			//IL_0489: Expected O, but got Unknown
			//IL_04bc: Unknown result type (might be due to invalid IL or missing references)
			//IL_04c7: Expected O, but got Unknown
			//IL_04e8: Unknown result type (might be due to invalid IL or missing references)
			//IL_04f3: Expected O, but got Unknown
			//IL_0514: Unknown result type (might be due to invalid IL or missing references)
			//IL_051f: Expected O, but got Unknown
			//IL_0540: Unknown result type (might be due to invalid IL or missing references)
			//IL_054b: Expected O, but got Unknown
			//IL_056c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0577: Expected O, but got Unknown
			//IL_05aa: Unknown result type (might be due to invalid IL or missing references)
			//IL_05b5: Expected O, but got Unknown
			//IL_05d6: Unknown result type (might be due to invalid IL or missing references)
			//IL_05e1: Expected O, but got Unknown
			//IL_0602: Unknown result type (might be due to invalid IL or missing references)
			//IL_060d: Expected O, but got Unknown
			//IL_062e: Unknown result type (might be due to invalid IL or missing references)
			//IL_0639: Expected O, but got Unknown
			//IL_065a: Unknown result type (might be due to invalid IL or missing references)
			//IL_0665: Expected O, but got Unknown
			string group = Localization.instance.Localize("$btm_dvergrmeadbase").Trim();
			_dvergrMeadBaseEnable = Plugin._Instance.config(group, "Recipe", value: true, new ConfigDescription("Enable/Disables recipe. (Needs logout)", (AcceptableValueBase)null, Array.Empty<object>()));
			_dvergrMeadBaseMat1 = Plugin._Instance.config(group, "Required Material 1", "BTM_HaldorMead:1", new ConfigDescription("Item name : amount (Needs logout)", (AcceptableValueBase)null, Array.Empty<object>()));
			_dvergrMeadBaseMat2 = Plugin._Instance.config(group, "Required Material 2", "SurtlingCore:1", new ConfigDescription("Item name : amount (Needs logout)", (AcceptableValueBase)null, Array.Empty<object>()));
			_dvergrMeadBaseMat3 = Plugin._Instance.config(group, "Required Material 3", "AncientSeed:10", new ConfigDescription("Item name : amount (Needs logout)", (AcceptableValueBase)null, Array.Empty<object>()));
			_dvergrMeadBaseMat4 = Plugin._Instance.config(group, "Required Material 4", "GreydwarfEye:10", new ConfigDescription("Item name : amount (Needs logout)", (AcceptableValueBase)null, Array.Empty<object>()));
			string group2 = Localization.instance.Localize("$btm_haldormeadbase").Trim();
			_haldorMeadBaseEnable = Plugin._Instance.config(group2, "Recipe", value: true, new ConfigDescription("Enable/Disables recipe. (Needs logout)", (AcceptableValueBase)null, Array.Empty<object>()));
			_haldorMeadBaseMat1 = Plugin._Instance.config(group2, "Required Material 1", "SurtlingCore:1", new ConfigDescription("Item name : amount (Needs logout)", (AcceptableValueBase)null, Array.Empty<object>()));
			_haldorMeadBaseMat2 = Plugin._Instance.config(group2, "Required Material 2", "GreydwarfEye:20", new ConfigDescription("Item name : amount (Needs logout)", (AcceptableValueBase)null, Array.Empty<object>()));
			_haldorMeadBaseMat3 = Plugin._Instance.config(group2, "Required Material 3", "AncientSeed:2", new ConfigDescription("Item name : amount (Needs logout)", (AcceptableValueBase)null, Array.Empty<object>()));
			_haldorMeadBaseMat4 = Plugin._Instance.config(group2, "Required Material 4", "BeechSeeds:20", new ConfigDescription("Item name : amount (Needs logout)", (AcceptableValueBase)null, Array.Empty<object>()));
			string group3 = Localization.instance.Localize("$btm_herculesmeadbase").Trim();
			_herculesMeadBaseEnable = Plugin._Instance.config(group3, "Recipe", value: true, new ConfigDescription("Enable/Disables recipe. (Needs logout)", (AcceptableValueBase)null, Array.Empty<object>()));
			_herculesMeadBaseMat1 = Plugin._Instance.config(group3, "Required Material 1", "SurtlingCore:1", new ConfigDescription("Item name : amount (Needs logout)", (AcceptableValueBase)null, Array.Empty<object>()));
			_herculesMeadBaseMat2 = Plugin._Instance.config(group3, "Required Material 2", "CopperOre:2", new ConfigDescription("Item name : amount (Needs logout)", (AcceptableValueBase)null, Array.Empty<object>()));
			_herculesMeadBaseMat3 = Plugin._Instance.config(group3, "Required Material 3", "AncientSeed:2", new ConfigDescription("Item name : amount (Needs logout)", (AcceptableValueBase)null, Array.Empty<object>()));
			_herculesMeadBaseMat4 = Plugin._Instance.config(group3, "Required Material 4", "GreydwarfEye:10", new ConfigDescription("Item name : amount (Needs logout)", (AcceptableValueBase)null, Array.Empty<object>()));
			string group4 = Localization.instance.Localize("$btm_huginmeadbase").Trim();
			_huginMeadBaseEnable = Plugin._Instance.config(group4, "Recipe", value: true, new ConfigDescription("Enable/Disables recipe. (Needs logout)", (AcceptableValueBase)null, Array.Empty<object>()));
			_huginMeadBaseMat1 = Plugin._Instance.config(group4, "Required Material 1", "SurtlingCore:1", new ConfigDescription("Item name : amount (Needs logout)", (AcceptableValueBase)null, Array.Empty<object>()));
			_huginMeadBaseMat2 = Plugin._Instance.config(group4, "Required Material 2", "GreydwarfEye:20", new ConfigDescription("Item name : amount (Needs logout)", (AcceptableValueBase)null, Array.Empty<object>()));
			_huginMeadBaseMat3 = Plugin._Instance.config(group4, "Required Material 3", "AncientSeed:2", new ConfigDescription("Item name : amount (Needs logout)", (AcceptableValueBase)null, Array.Empty<object>()));
			_huginMeadBaseMat4 = Plugin._Instance.config(group4, "Required Material 4", "Feathers:10", new ConfigDescription("Item name : amount (Needs logout)", (AcceptableValueBase)null, Array.Empty<object>()));
			string group5 = Localization.instance.Localize("$btm_knarrmeadbase").Trim();
			_knarrMeadBaseEnable = Plugin._Instance.config(group5, "Recipe", value: true, new ConfigDescription("Enable/Disables recipe. (Needs logout)", (AcceptableValueBase)null, Array.Empty<object>()));
			_knarrMeadBaseMat1 = Plugin._Instance.config(group5, "Required Material 1", "SurtlingCore:1", new ConfigDescription("Item name : amount (Needs logout)", (AcceptableValueBase)null, Array.Empty<object>()));
			_knarrMeadBaseMat2 = Plugin._Instance.config(group5, "Required Material 2", "GreydwarfEye:20", new ConfigDescription("Item name : amount (Needs logout)", (AcceptableValueBase)null, Array.Empty<object>()));
			_knarrMeadBaseMat3 = Plugin._Instance.config(group5, "Required Material 3", "AncientSeed:2", new ConfigDescription("Item name : amount (Needs logout)", (AcceptableValueBase)null, Array.Empty<object>()));
			_knarrMeadBaseMat4 = Plugin._Instance.config(group5, "Required Material 4", "Resin:20", new ConfigDescription("Item name : amount (Needs logout)", (AcceptableValueBase)null, Array.Empty<object>()));
			string group6 = Localization.instance.Localize("$btm_odinmeadbase").Trim();
			_odinsMeadBaseEnable = Plugin._Instance.config(group6, "Recipe", value: true, new ConfigDescription("Enable/Disables recipe. (Needs logout)", (AcceptableValueBase)null, Array.Empty<object>()));
			_odinsMeadBaseMat1 = Plugin._Instance.config(group6, "Required Material 1", "BTM_HaldorMead:1", new ConfigDescription("Item name : amount (Needs logout)", (AcceptableValueBase)null, Array.Empty<object>()));
			_odinsMeadBaseMat2 = Plugin._Instance.config(group6, "Required Material 2", "SurtlingCore:2", new ConfigDescription("Item name : amount (Needs logout)", (AcceptableValueBase)null, Array.Empty<object>()));
			_odinsMeadBaseMat3 = Plugin._Instance.config(group6, "Required Material 3", "AncientSeed:5", new ConfigDescription("Item name : amount (Needs logout)", (AcceptableValueBase)null, Array.Empty<object>()));
			_odinsMeadBaseMat4 = Plugin._Instance.config(group6, "Required Material 4", "Resin:10", new ConfigDescription("Item name : amount (Needs logout)", (AcceptableValueBase)null, Array.Empty<object>()));
			string group7 = Localization.instance.Localize("$btm_hildirsmeadbase").Trim();
			_hildirsMeadBaseEnable = Plugin._Instance.config(group7, "Recipe", value: true, new ConfigDescription("Enable/Disables recipe. (Needs logout)", (AcceptableValueBase)null, Array.Empty<object>()));
			_hildirsMeadBaseMat1 = Plugin._Instance.config(group7, "Required Material 1", "BTM_HaldorMead:1", new ConfigDescription("Item name : amount (Needs logout)", (AcceptableValueBase)null, Array.Empty<object>()));
			_hildirsMeadBaseMat2 = Plugin._Instance.config(group7, "Required Material 2", "SurtlingCore:1", new ConfigDescription("Item name : amount (Needs logout)", (AcceptableValueBase)null, Array.Empty<object>()));
			_hildirsMeadBaseMat3 = Plugin._Instance.config(group7, "Required Material 3", "AncientSeed:10", new ConfigDescription("Item name : amount (Needs logout)", (AcceptableValueBase)null, Array.Empty<object>()));
			_hildirsMeadBaseMat4 = Plugin._Instance.config(group7, "Required Material 4", "GreydwarfEye:10", new ConfigDescription("Item name : amount (Needs logout)", (AcceptableValueBase)null, Array.Empty<object>()));
		}
	}
	public static class PrefabSetup
	{
		public static AssetBundle _meadBundle;

		public static GameObject _dvergrMead;

		public static GameObject _dvergrMeadBase;

		public static GameObject _haldorMead;

		public static GameObject _haldorMeadBase;

		public static GameObject _herculesMead;

		public static GameObject _herculesMeadBase;

		public static GameObject _huginMead;

		public static GameObject _huginMeadBase;

		public static GameObject _knarrMead;

		public static GameObject _knarrMeadBase;

		public static GameObject _odinMead;

		public static GameObject _odinMeadBase;

		public static Sprite _herculesIcon;

		public static GameObject _hildirsMead;

		public static GameObject _hildirsMeadBase;

		public static void Init()
		{
			_meadBundle = GetAssetBundleFromResources("meadbundle");
			_dvergrMead = _meadBundle.LoadAsset<GameObject>("BTM_DvergrMead");
			_dvergrMeadBase = _meadBundle.LoadAsset<GameObject>("BTM_DvergrMeadBase");
			_haldorMead = _meadBundle.LoadAsset<GameObject>("BTM_HaldorMead");
			_haldorMeadBase = _meadBundle.LoadAsset<GameObject>("BTM_HaldorMeadBase");
			_herculesMead = _meadBundle.LoadAsset<GameObject>("BTM_HerculesMead");
			_herculesMeadBase = _meadBundle.LoadAsset<GameObject>("BTM_HerculesMeadBase");
			_herculesIcon = _herculesMead.GetComponent<ItemDrop>().m_itemData.GetIcon();
			_huginMead = _meadBundle.LoadAsset<GameObject>("BTM_HuginMead");
			_huginMeadBase = _meadBundle.LoadAsset<GameObject>("BTM_HuginMeadBase");
			_knarrMead = _meadBundle.LoadAsset<GameObject>("BTM_KnarrMead");
			_knarrMeadBase = _meadBundle.LoadAsset<GameObject>("BTM_KnarrMeadBase");
			_odinMead = _meadBundle.LoadAsset<GameObject>("BTM_OdinMead");
			_odinMeadBase = _meadBundle.LoadAsset<GameObject>("BTM_OdinMeadBase");
			_hildirsMead = _meadBundle.LoadAsset<GameObject>("BTM_HildirsMead");
			_hildirsMeadBase = _meadBundle.LoadAsset<GameObject>("BTM_HildirsMeadBase");
		}

		private static AssetBundle GetAssetBundleFromResources(string filename)
		{
			Assembly executingAssembly = Assembly.GetExecutingAssembly();
			string name = executingAssembly.GetManifestResourceNames().Single((string x) => x.EndsWith(filename));
			using Stream stream = executingAssembly.GetManifestResourceStream(name);
			return AssetBundle.LoadFromStream(stream);
		}
	}
	public static class RegisterPrefabsToObjectDB
	{
		private static ObjectDB _objectDB => ObjectDB.instance;

		public static void Init()
		{
			if (Helper.ObjectDBAwake())
			{
				DvergrMead();
				HaldorMead();
				HerculesMead();
				HuginMead();
				KnarrMead();
				OdinsMead();
				MeadBase();
				HildirsMead();
			}
		}

		private static void DvergrMead()
		{
			_objectDB.AddClonedObject(PrefabSetup._dvergrMead);
			RegisterStatusEffects(PrefabSetup._dvergrMead.GetComponent<ItemDrop>().m_itemData.m_shared.m_consumeStatusEffect);
		}

		private static void HaldorMead()
		{
			_objectDB.AddClonedObject(PrefabSetup._haldorMead);
			RegisterStatusEffects(PrefabSetup._haldorMead.GetComponent<ItemDrop>().m_itemData.m_shared.m_consumeStatusEffect);
		}

		private static void HerculesMead()
		{
			_objectDB.AddClonedObject(PrefabSetup._herculesMead);
			RegisterStatusEffects(PrefabSetup._herculesMead.GetComponent<ItemDrop>().m_itemData.m_shared.m_consumeStatusEffect);
		}

		private static void HuginMead()
		{
			_objectDB.AddClonedObject(PrefabSetup._huginMead);
			RegisterStatusEffects(PrefabSetup._huginMead.GetComponent<ItemDrop>().m_itemData.m_shared.m_consumeStatusEffect);
		}

		private static void KnarrMead()
		{
			_objectDB.AddClonedObject(PrefabSetup._knarrMead);
			RegisterStatusEffects(PrefabSetup._knarrMead.GetComponent<ItemDrop>().m_itemData.m_shared.m_consumeStatusEffect);
		}

		private static void OdinsMead()
		{
			_objectDB.AddClonedObject(PrefabSetup._odinMead);
			RegisterStatusEffects(PrefabSetup._odinMead.GetComponent<ItemDrop>().m_itemData.m_shared.m_consumeStatusEffect);
		}

		private static void HildirsMead()
		{
			_objectDB.AddClonedObject(PrefabSetup._hildirsMead);
			RegisterStatusEffects(PrefabSetup._hildirsMead.GetComponent<ItemDrop>().m_itemData.m_shared.m_consumeStatusEffect);
		}

		private static void MeadBase()
		{
			_objectDB.AddClonedObject(PrefabSetup._dvergrMeadBase);
			_objectDB.AddClonedObject(PrefabSetup._haldorMeadBase);
			_objectDB.AddClonedObject(PrefabSetup._herculesMeadBase);
			_objectDB.AddClonedObject(PrefabSetup._huginMeadBase);
			_objectDB.AddClonedObject(PrefabSetup._knarrMeadBase);
			_objectDB.AddClonedObject(PrefabSetup._odinMeadBase);
			_objectDB.AddClonedObject(PrefabSetup._hildirsMeadBase);
		}

		private static void RegisterStatusEffects(StatusEffect statusEffect)
		{
			if (statusEffect != null && !Object.op_Implicit((Object)(object)_objectDB.GetStatusEffect(StringExtensionMethods.GetStableHashCode(((Object)statusEffect).name))))
			{
				_objectDB.m_StatusEffects.Add(statusEffect);
			}
		}
	}
	public static class RegisterPrefabsToZNetScene
	{
		private static ZNetScene _zNetScene => ZNetScene.instance;

		public static void Init()
		{
			if (Helper.ZNetSceneAwake())
			{
				_zNetScene.AddClonedObject(PrefabSetup._dvergrMead);
				_zNetScene.AddClonedObject(PrefabSetup._dvergrMeadBase);
				_zNetScene.AddClonedObject(PrefabSetup._haldorMead);
				_zNetScene.AddClonedObject(PrefabSetup._haldorMeadBase);
				_zNetScene.AddClonedObject(PrefabSetup._herculesMead);
				_zNetScene.AddClonedObject(PrefabSetup._herculesMeadBase);
				_zNetScene.AddClonedObject(PrefabSetup._huginMead);
				_zNetScene.AddClonedObject(PrefabSetup._huginMeadBase);
				_zNetScene.AddClonedObject(PrefabSetup._knarrMead);
				_zNetScene.AddClonedObject(PrefabSetup._knarrMeadBase);
				_zNetScene.AddClonedObject(PrefabSetup._odinMead);
				_zNetScene.AddClonedObject(PrefabSetup._odinMeadBase);
				_zNetScene.AddClonedObject(PrefabSetup._hildirsMead);
				_zNetScene.AddClonedObject(PrefabSetup._hildirsMeadBase);
			}
		}
	}
	public static class RegisterRecipesToObjectDB
	{
		private static ZNetScene _zNetScene => ZNetScene.instance;

		private static ObjectDB _objectDB => ObjectDB.instance;

		public static void Init()
		{
			if (Helper.ObjectDBAwake() && Helper.ZNetSceneAwake())
			{
				DvergrMeadBase();
				HaldorMeadBase();
				HerculesMeadBase();
				HuginMeadBase();
				KnarrMeadBase();
				OdinMeadBase();
				HildirsMeadBase();
			}
		}

		private static void DvergrMeadBase()
		{
			//IL_00fc: Unknown result type (might be due to invalid IL or missing references)
			//IL_0101: Unknown result type (might be due to invalid IL or missing references)
			//IL_0119: Unknown result type (might be due to invalid IL or missing references)
			//IL_0127: Unknown result type (might be due to invalid IL or missing references)
			//IL_012e: Unknown result type (might be due to invalid IL or missing references)
			//IL_0135: Unknown result type (might be due to invalid IL or missing references)
			//IL_013d: Expected O, but got Unknown
			//IL_013f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0144: Unknown result type (might be due to invalid IL or missing references)
			//IL_015c: Unknown result type (might be due to invalid IL or missing references)
			//IL_016a: Unknown result type (might be due to invalid IL or missing references)
			//IL_0171: Unknown result type (might be due to invalid IL or missing references)
			//IL_0178: Unknown result type (might be due to invalid IL or missing references)
			//IL_0180: Expected O, but got Unknown
			//IL_0182: Unknown result type (might be due to invalid IL or missing references)
			//IL_0187: Unknown result type (might be due to invalid IL or missing references)
			//IL_019f: Unknown result type (might be due to invalid IL or missing references)
			//IL_01ad: Unknown result type (might be due to invalid IL or missing references)
			//IL_01b4: Unknown result type (might be due to invalid IL or missing references)
			//IL_01bb: Unknown result type (might be due to invalid IL or missing references)
			//IL_01c3: Expected O, but got Unknown
			//IL_01c5: Unknown result type (might be due to invalid IL or missing references)
			//IL_01ca: Unknown result type (might be due to invalid IL or missing references)
			//IL_01e3: Unknown result type (might be due to invalid IL or missing references)
			//IL_01f2: Unknown result type (might be due to invalid IL or missing references)
			//IL_01f9: Unknown result type (might be due to invalid IL or missing references)
			//IL_0200: Unknown result type (might be due to invalid IL or missing references)
			//IL_0208: Expected O, but got Unknown
			Recipe val = ScriptableObject.CreateInstance<Recipe>();
			((Object)val).name = "Recipe_BTM_DvergrMeadBase";
			val.m_item = PrefabSetup._dvergrMeadBase.GetComponent<ItemDrop>();
			val.m_amount = 1;
			val.m_enabled = ConfigSetup._dvergrMeadBaseEnable.Value;
			val.m_qualityResultAmountMultiplier = 1f;
			val.m_craftingStation = _zNetScene.GetPrefab("piece_cauldron").GetComponent<CraftingStation>();
			val.m_repairStation = null;
			val.m_minStationLevel = 1;
			val.m_requireOnlyOneIngredient = false;
			string[] array = ConfigSetup._dvergrMeadBaseMat1.Value.Split(':', ' ');
			string[] array2 = ConfigSetup._dvergrMeadBaseMat2.Value.Split(':', ' ');
			string[] array3 = ConfigSetup._dvergrMeadBaseMat3.Value.Split(':', ' ');
			string[] array4 = ConfigSetup._dvergrMeadBaseMat4.Value.Split(':', ' ');
			val.m_resources = (Requirement[])(object)new Requirement[4]
			{
				new Requirement
				{
					m_resItem = _objectDB.GetItemPrefab(array[0]).GetComponent<ItemDrop>(),
					m_amount = int.Parse(array[1]),
					m_extraAmountOnlyOneIngredient = 0,
					m_amountPerLevel = 0,
					m_recover = true
				},
				new Requirement
				{
					m_resItem = _objectDB.GetItemPrefab(array2[0]).GetComponent<ItemDrop>(),
					m_amount = int.Parse(array2[1]),
					m_extraAmountOnlyOneIngredient = 0,
					m_amountPerLevel = 0,
					m_recover = true
				},
				new Requirement
				{
					m_resItem = _objectDB.GetItemPrefab(array3[0]).GetComponent<ItemDrop>(),
					m_amount = int.Parse(array3[1]),
					m_extraAmountOnlyOneIngredient = 0,
					m_amountPerLevel = 0,
					m_recover = true
				},
				new Requirement
				{
					m_resItem = _objectDB.GetItemPrefab(array4[0]).GetComponent<ItemDrop>(),
					m_amount = int.Parse(array4[1]),
					m_extraAmountOnlyOneIngredient = 0,
					m_amountPerLevel = 0,
					m_recover = true
				}
			};
			_objectDB.AddRecipe(val);
		}

		private static void HaldorMeadBase()
		{
			//IL_00fc: Unknown result type (might be due to invalid IL or missing references)
			//IL_0101: Unknown result type (might be due to invalid IL or missing references)
			//IL_0119: Unknown result type (might be due to invalid IL or missing references)
			//IL_0127: Unknown result type (might be due to invalid IL or missing references)
			//IL_012e: Unknown result type (might be due to invalid IL or missing references)
			//IL_0135: Unknown result type (might be due to invalid IL or missing references)
			//IL_013d: Expected O, but got Unknown
			//IL_013f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0144: Unknown result type (might be due to invalid IL or missing references)
			//IL_015c: Unknown result type (might be due to invalid IL or missing references)
			//IL_016a: Unknown result type (might be due to invalid IL or missing references)
			//IL_0171: Unknown result type (might be due to invalid IL or missing references)
			//IL_0178: Unknown result type (might be due to invalid IL or missing references)
			//IL_0180: Expected O, but got Unknown
			//IL_0182: Unknown result type (might be due to invalid IL or missing references)
			//IL_0187: Unknown result type (might be due to invalid IL or missing references)
			//IL_019f: Unknown result type (might be due to invalid IL or missing references)
			//IL_01ad: Unknown result type (might be due to invalid IL or missing references)
			//IL_01b4: Unknown result type (might be due to invalid IL or missing references)
			//IL_01bb: Unknown result type (might be due to invalid IL or missing references)
			//IL_01c3: Expected O, but got Unknown
			//IL_01c5: Unknown result type (might be due to invalid IL or missing references)
			//IL_01ca: Unknown result type (might be due to invalid IL or missing references)
			//IL_01e3: Unknown result type (might be due to invalid IL or missing references)
			//IL_01f2: Unknown result type (might be due to invalid IL or missing references)
			//IL_01f9: Unknown result type (might be due to invalid IL or missing references)
			//IL_0200: Unknown result type (might be due to invalid IL or missing references)
			//IL_0208: Expected O, but got Unknown
			Recipe val = ScriptableObject.CreateInstance<Recipe>();
			((Object)val).name = "Recipe_BTM_HaldorMeadBase";
			val.m_item = PrefabSetup._haldorMeadBase.GetComponent<ItemDrop>();
			val.m_amount = 1;
			val.m_enabled = ConfigSetup._haldorMeadBaseEnable.Value;
			val.m_qualityResultAmountMultiplier = 1f;
			val.m_craftingStation = _zNetScene.GetPrefab("piece_cauldron").GetComponent<CraftingStation>();
			val.m_repairStation = null;
			val.m_minStationLevel = 1;
			val.m_requireOnlyOneIngredient = false;
			string[] array = ConfigSetup._haldorMeadBaseMat1.Value.Split(':', ' ');
			string[] array2 = ConfigSetup._haldorMeadBaseMat2.Value.Split(':', ' ');
			string[] array3 = ConfigSetup._haldorMeadBaseMat3.Value.Split(':', ' ');
			string[] array4 = ConfigSetup._haldorMeadBaseMat4.Value.Split(':', ' ');
			val.m_resources = (Requirement[])(object)new Requirement[4]
			{
				new Requirement
				{
					m_resItem = _objectDB.GetItemPrefab(array[0]).GetComponent<ItemDrop>(),
					m_amount = int.Parse(array[1]),
					m_extraAmountOnlyOneIngredient = 0,
					m_amountPerLevel = 0,
					m_recover = true
				},
				new Requirement
				{
					m_resItem = _objectDB.GetItemPrefab(array2[0]).GetComponent<ItemDrop>(),
					m_amount = int.Parse(array2[1]),
					m_extraAmountOnlyOneIngredient = 0,
					m_amountPerLevel = 0,
					m_recover = true
				},
				new Requirement
				{
					m_resItem = _objectDB.GetItemPrefab(array3[0]).GetComponent<ItemDrop>(),
					m_amount = int.Parse(array3[1]),
					m_extraAmountOnlyOneIngredient = 0,
					m_amountPerLevel = 0,
					m_recover = true
				},
				new Requirement
				{
					m_resItem = _objectDB.GetItemPrefab(array4[0]).GetComponent<ItemDrop>(),
					m_amount = int.Parse(array4[1]),
					m_extraAmountOnlyOneIngredient = 0,
					m_amountPerLevel = 0,
					m_recover = true
				}
			};
			_objectDB.AddRecipe(val);
		}

		private static void HerculesMeadBase()
		{
			//IL_00fc: Unknown result type (might be due to invalid IL or missing references)
			//IL_0101: Unknown result type (might be due to invalid IL or missing references)
			//IL_0119: Unknown result type (might be due to invalid IL or missing references)
			//IL_0127: Unknown result type (might be due to invalid IL or missing references)
			//IL_012e: Unknown result type (might be due to invalid IL or missing references)
			//IL_0135: Unknown result type (might be due to invalid IL or missing references)
			//IL_013d: Expected O, but got Unknown
			//IL_013f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0144: Unknown result type (might be due to invalid IL or missing references)
			//IL_015c: Unknown result type (might be due to invalid IL or missing references)
			//IL_016a: Unknown result type (might be due to invalid IL or missing references)
			//IL_0171: Unknown result type (might be due to invalid IL or missing references)
			//IL_0178: Unknown result type (might be due to invalid IL or missing references)
			//IL_0180: Expected O, but got Unknown
			//IL_0182: Unknown result type (might be due to invalid IL or missing references)
			//IL_0187: Unknown result type (might be due to invalid IL or missing references)
			//IL_019f: Unknown result type (might be due to invalid IL or missing references)
			//IL_01ad: Unknown result type (might be due to invalid IL or missing references)
			//IL_01b4: Unknown result type (might be due to invalid IL or missing references)
			//IL_01bb: Unknown result type (might be due to invalid IL or missing references)
			//IL_01c3: Expected O, but got Unknown
			//IL_01c5: Unknown result type (might be due to invalid IL or missing references)
			//IL_01ca: Unknown result type (might be due to invalid IL or missing references)
			//IL_01e3: Unknown result type (might be due to invalid IL or missing references)
			//IL_01f2: Unknown result type (might be due to invalid IL or missing references)
			//IL_01f9: Unknown result type (might be due to invalid IL or missing references)
			//IL_0200: Unknown result type (might be due to invalid IL or missing references)
			//IL_0208: Expected O, but got Unknown
			Recipe val = ScriptableObject.CreateInstance<Recipe>();
			((Object)val).name = "Recipe_BTM_HerculesMeadBase";
			val.m_item = PrefabSetup._herculesMeadBase.GetComponent<ItemDrop>();
			val.m_amount = 1;
			val.m_enabled = ConfigSetup._herculesMeadBaseEnable.Value;
			val.m_qualityResultAmountMultiplier = 1f;
			val.m_craftingStation = _zNetScene.GetPrefab("piece_cauldron").GetComponent<CraftingStation>();
			val.m_repairStation = null;
			val.m_minStationLevel = 1;
			val.m_requireOnlyOneIngredient = false;
			string[] array = ConfigSetup._herculesMeadBaseMat1.Value.Split(':', ' ');
			string[] array2 = ConfigSetup._herculesMeadBaseMat2.Value.Split(':', ' ');
			string[] array3 = ConfigSetup._herculesMeadBaseMat3.Value.Split(':', ' ');
			string[] array4 = ConfigSetup._herculesMeadBaseMat4.Value.Split(':', ' ');
			val.m_resources = (Requirement[])(object)new Requirement[4]
			{
				new Requirement
				{
					m_resItem = _objectDB.GetItemPrefab(array[0]).GetComponent<ItemDrop>(),
					m_amount = int.Parse(array[1]),
					m_extraAmountOnlyOneIngredient = 0,
					m_amountPerLevel = 0,
					m_recover = true
				},
				new Requirement
				{
					m_resItem = _objectDB.GetItemPrefab(array2[0]).GetComponent<ItemDrop>(),
					m_amount = int.Parse(array2[1]),
					m_extraAmountOnlyOneIngredient = 0,
					m_amountPerLevel = 0,
					m_recover = true
				},
				new Requirement
				{
					m_resItem = _objectDB.GetItemPrefab(array3[0]).GetComponent<ItemDrop>(),
					m_amount = int.Parse(array3[1]),
					m_extraAmountOnlyOneIngredient = 0,
					m_amountPerLevel = 0,
					m_recover = true
				},
				new Requirement
				{
					m_resItem = _objectDB.GetItemPrefab(array4[0]).GetComponent<ItemDrop>(),
					m_amount = int.Parse(array4[1]),
					m_extraAmountOnlyOneIngredient = 0,
					m_amountPerLevel = 0,
					m_recover = true
				}
			};
			_objectDB.AddRecipe(val);
		}

		private static void HuginMeadBase()
		{
			//IL_00fc: Unknown result type (might be due to invalid IL or missing references)
			//IL_0101: Unknown result type (might be due to invalid IL or missing references)
			//IL_0119: Unknown result type (might be due to invalid IL or missing references)
			//IL_0127: Unknown result type (might be due to invalid IL or missing references)
			//IL_012e: Unknown result type (might be due to invalid IL or missing references)
			//IL_0135: Unknown result type (might be due to invalid IL or missing references)
			//IL_013d: Expected O, but got Unknown
			//IL_013f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0144: Unknown result type (might be due to invalid IL or missing references)
			//IL_015c: Unknown result type (might be due to invalid IL or missing references)
			//IL_016a: Unknown result type (might be due to invalid IL or missing references)
			//IL_0171: Unknown result type (might be due to invalid IL or missing references)
			//IL_0178: Unknown result type (might be due to invalid IL or missing references)
			//IL_0180: Expected O, but got Unknown
			//IL_0182: Unknown result type (might be due to invalid IL or missing references)
			//IL_0187: Unknown result type (might be due to invalid IL or missing references)
			//IL_019f: Unknown result type (might be due to invalid IL or missing references)
			//IL_01ad: Unknown result type (might be due to invalid IL or missing references)
			//IL_01b4: Unknown result type (might be due to invalid IL or missing references)
			//IL_01bb: Unknown result type (might be due to invalid IL or missing references)
			//IL_01c3: Expected O, but got Unknown
			//IL_01c5: Unknown result type (might be due to invalid IL or missing references)
			//IL_01ca: Unknown result type (might be due to invalid IL or missing references)
			//IL_01e3: Unknown result type (might be due to invalid IL or missing references)
			//IL_01f2: Unknown result type (might be due to invalid IL or missing references)
			//IL_01f9: Unknown result type (might be due to invalid IL or missing references)
			//IL_0200: Unknown result type (might be due to invalid IL or missing references)
			//IL_0208: Expected O, but got Unknown
			Recipe val = ScriptableObject.CreateInstance<Recipe>();
			((Object)val).name = "Recipe_BTM_HuginMeadBase";
			val.m_item = PrefabSetup._huginMeadBase.GetComponent<ItemDrop>();
			val.m_amount = 1;
			val.m_enabled = ConfigSetup._huginMeadBaseEnable.Value;
			val.m_qualityResultAmountMultiplier = 1f;
			val.m_craftingStation = _zNetScene.GetPrefab("piece_cauldron").GetComponent<CraftingStation>();
			val.m_repairStation = null;
			val.m_minStationLevel = 1;
			val.m_requireOnlyOneIngredient = false;
			string[] array = ConfigSetup._huginMeadBaseMat1.Value.Split(':', ' ');
			string[] array2 = ConfigSetup._huginMeadBaseMat2.Value.Split(':', ' ');
			string[] array3 = ConfigSetup._huginMeadBaseMat3.Value.Split(':', ' ');
			string[] array4 = ConfigSetup._huginMeadBaseMat4.Value.Split(':', ' ');
			val.m_resources = (Requirement[])(object)new Requirement[4]
			{
				new Requirement
				{
					m_resItem = _objectDB.GetItemPrefab(array[0]).GetComponent<ItemDrop>(),
					m_amount = int.Parse(array[1]),
					m_extraAmountOnlyOneIngredient = 0,
					m_amountPerLevel = 0,
					m_recover = true
				},
				new Requirement
				{
					m_resItem = _objectDB.GetItemPrefab(array2[0]).GetComponent<ItemDrop>(),
					m_amount = int.Parse(array2[1]),
					m_extraAmountOnlyOneIngredient = 0,
					m_amountPerLevel = 0,
					m_recover = true
				},
				new Requirement
				{
					m_resItem = _objectDB.GetItemPrefab(array3[0]).GetComponent<ItemDrop>(),
					m_amount = int.Parse(array3[1]),
					m_extraAmountOnlyOneIngredient = 0,
					m_amountPerLevel = 0,
					m_recover = true
				},
				new Requirement
				{
					m_resItem = _objectDB.GetItemPrefab(array4[0]).GetComponent<ItemDrop>(),
					m_amount = int.Parse(array4[1]),
					m_extraAmountOnlyOneIngredient = 0,
					m_amountPerLevel = 0,
					m_recover = true
				}
			};
			_objectDB.AddRecipe(val);
		}

		private static void KnarrMeadBase()
		{
			//IL_00fc: Unknown result type (might be due to invalid IL or missing references)
			//IL_0101: Unknown result type (might be due to invalid IL or missing references)
			//IL_0119: Unknown result type (might be due to invalid IL or missing references)
			//IL_0127: Unknown result type (might be due to invalid IL or missing references)
			//IL_012e: Unknown result type (might be due to invalid IL or missing references)
			//IL_0135: Unknown result type (might be due to invalid IL or missing references)
			//IL_013d: Expected O, but got Unknown
			//IL_013f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0144: Unknown result type (might be due to invalid IL or missing references)
			//IL_015c: Unknown result type (might be due to invalid IL or missing references)
			//IL_016a: Unknown result type (might be due to invalid IL or missing references)
			//IL_0171: Unknown result type (might be due to invalid IL or missing references)
			//IL_0178: Unknown result type (might be due to invalid IL or missing references)
			//IL_0180: Expected O, but got Unknown
			//IL_0182: Unknown result type (might be due to invalid IL or missing references)
			//IL_0187: Unknown result type (might be due to invalid IL or missing references)
			//IL_019f: Unknown result type (might be due to invalid IL or missing references)
			//IL_01ad: Unknown result type (might be due to invalid IL or missing references)
			//IL_01b4: Unknown result type (might be due to invalid IL or missing references)
			//IL_01bb: Unknown result type (might be due to invalid IL or missing references)
			//IL_01c3: Expected O, but got Unknown
			//IL_01c5: Unknown result type (might be due to invalid IL or missing references)
			//IL_01ca: Unknown result type (might be due to invalid IL or missing references)
			//IL_01e3: Unknown result type (might be due to invalid IL or missing references)
			//IL_01f2: Unknown result type (might be due to invalid IL or missing references)
			//IL_01f9: Unknown result type (might be due to invalid IL or missing references)
			//IL_0200: Unknown result type (might be due to invalid IL or missing references)
			//IL_0208: Expected O, but got Unknown
			Recipe val = ScriptableObject.CreateInstance<Recipe>();
			((Object)val).name = "Recipe_BTM_KnarrMeadBase";
			val.m_item = PrefabSetup._knarrMeadBase.GetComponent<ItemDrop>();
			val.m_amount = 1;
			val.m_enabled = ConfigSetup._knarrMeadBaseEnable.Value;
			val.m_qualityResultAmountMultiplier = 1f;
			val.m_craftingStation = _zNetScene.GetPrefab("piece_cauldron").GetComponent<CraftingStation>();
			val.m_repairStation = null;
			val.m_minStationLevel = 1;
			val.m_requireOnlyOneIngredient = false;
			string[] array = ConfigSetup._knarrMeadBaseMat1.Value.Split(':', ' ');
			string[] array2 = ConfigSetup._knarrMeadBaseMat2.Value.Split(':', ' ');
			string[] array3 = ConfigSetup._knarrMeadBaseMat3.Value.Split(':', ' ');
			string[] array4 = ConfigSetup._knarrMeadBaseMat4.Value.Split(':', ' ');
			val.m_resources = (Requirement[])(object)new Requirement[4]
			{
				new Requirement
				{
					m_resItem = _objectDB.GetItemPrefab(array[0]).GetComponent<ItemDrop>(),
					m_amount = int.Parse(array[1]),
					m_extraAmountOnlyOneIngredient = 0,
					m_amountPerLevel = 0,
					m_recover = true
				},
				new Requirement
				{
					m_resItem = _objectDB.GetItemPrefab(array2[0]).GetComponent<ItemDrop>(),
					m_amount = int.Parse(array2[1]),
					m_extraAmountOnlyOneIngredient = 0,
					m_amountPerLevel = 0,
					m_recover = true
				},
				new Requirement
				{
					m_resItem = _objectDB.GetItemPrefab(array3[0]).GetComponent<ItemDrop>(),
					m_amount = int.Parse(array3[1]),
					m_extraAmountOnlyOneIngredient = 0,
					m_amountPerLevel = 0,
					m_recover = true
				},
				new Requirement
				{
					m_resItem = _objectDB.GetItemPrefab(array4[0]).GetComponent<ItemDrop>(),
					m_amount = int.Parse(array4[1]),
					m_extraAmountOnlyOneIngredient = 0,
					m_amountPerLevel = 0,
					m_recover = true
				}
			};
			_objectDB.AddRecipe(val);
		}

		private static void OdinMeadBase()
		{
			//IL_00fc: Unknown result type (might be due to invalid IL or missing references)
			//IL_0101: Unknown result type (might be due to invalid IL or missing references)
			//IL_0119: Unknown result type (might be due to invalid IL or missing references)
			//IL_0127: Unknown result type (might be due to invalid IL or missing references)
			//IL_012e: Unknown result type (might be due to invalid IL or missing references)
			//IL_0135: Unknown result type (might be due to invalid IL or missing references)
			//IL_013d: Expected O, but got Unknown
			//IL_013f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0144: Unknown result type (might be due to invalid IL or missing references)
			//IL_015c: Unknown result type (might be due to invalid IL or missing references)
			//IL_016a: Unknown result type (might be due to invalid IL or missing references)
			//IL_0171: Unknown result type (might be due to invalid IL or missing references)
			//IL_0178: Unknown result type (might be due to invalid IL or missing references)
			//IL_0180: Expected O, but got Unknown
			//IL_0182: Unknown result type (might be due to invalid IL or missing references)
			//IL_0187: Unknown result type (might be due to invalid IL or missing references)
			//IL_019f: Unknown result type (might be due to invalid IL or missing references)
			//IL_01ad: Unknown result type (might be due to invalid IL or missing references)
			//IL_01b4: Unknown result type (might be due to invalid IL or missing references)
			//IL_01bb: Unknown result type (might be due to invalid IL or missing references)
			//IL_01c3: Expected O, but got Unknown
			//IL_01c5: Unknown result type (might be due to invalid IL or missing references)
			//IL_01ca: Unknown result type (might be due to invalid IL or missing references)
			//IL_01e3: Unknown result type (might be due to invalid IL or missing references)
			//IL_01f2: Unknown result type (might be due to invalid IL or missing references)
			//IL_01f9: Unknown result type (might be due to invalid IL or missing references)
			//IL_0200: Unknown result type (might be due to invalid IL or missing references)
			//IL_0208: Expected O, but got Unknown
			Recipe val = ScriptableObject.CreateInstance<Recipe>();
			((Object)val).name = "Recipe_BTM_OdinMeadBase";
			val.m_item = PrefabSetup._odinMeadBase.GetComponent<ItemDrop>();
			val.m_amount = 1;
			val.m_enabled = ConfigSetup._odinsMeadBaseEnable.Value;
			val.m_qualityResultAmountMultiplier = 1f;
			val.m_craftingStation = _zNetScene.GetPrefab("piece_cauldron").GetComponent<CraftingStation>();
			val.m_repairStation = null;
			val.m_minStationLevel = 1;
			val.m_requireOnlyOneIngredient = false;
			string[] array = ConfigSetup._odinsMeadBaseMat1.Value.Split(':', ' ');
			string[] array2 = ConfigSetup._odinsMeadBaseMat2.Value.Split(':', ' ');
			string[] array3 = ConfigSetup._odinsMeadBaseMat3.Value.Split(':', ' ');
			string[] array4 = ConfigSetup._odinsMeadBaseMat4.Value.Split(':', ' ');
			val.m_resources = (Requirement[])(object)new Requirement[4]
			{
				new Requirement
				{
					m_resItem = _objectDB.GetItemPrefab(array[0]).GetComponent<ItemDrop>(),
					m_amount = int.Parse(array[1]),
					m_extraAmountOnlyOneIngredient = 0,
					m_amountPerLevel = 0,
					m_recover = true
				},
				new Requirement
				{
					m_resItem = _objectDB.GetItemPrefab(array2[0]).GetComponent<ItemDrop>(),
					m_amount = int.Parse(array2[1]),
					m_extraAmountOnlyOneIngredient = 0,
					m_amountPerLevel = 0,
					m_recover = true
				},
				new Requirement
				{
					m_resItem = _objectDB.GetItemPrefab(array3[0]).GetComponent<ItemDrop>(),
					m_amount = int.Parse(array3[1]),
					m_extraAmountOnlyOneIngredient = 0,
					m_amountPerLevel = 0,
					m_recover = true
				},
				new Requirement
				{
					m_resItem = _objectDB.GetItemPrefab(array4[0]).GetComponent<ItemDrop>(),
					m_amount = int.Parse(array4[1]),
					m_extraAmountOnlyOneIngredient = 0,
					m_amountPerLevel = 0,
					m_recover = true
				}
			};
			_objectDB.AddRecipe(val);
		}

		private static void HildirsMeadBase()
		{
			//IL_00fc: Unknown result type (might be due to invalid IL or missing references)
			//IL_0101: Unknown result type (might be due to invalid IL or missing references)
			//IL_0119: Unknown result type (might be due to invalid IL or missing references)
			//IL_0127: Unknown result type (might be due to invalid IL or missing references)
			//IL_012e: Unknown result type (might be due to invalid IL or missing references)
			//IL_0135: Unknown result type (might be due to invalid IL or missing references)
			//IL_013d: Expected O, but got Unknown
			//IL_013f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0144: Unknown result type (might be due to invalid IL or missing references)
			//IL_015c: Unknown result type (might be due to invalid IL or missing references)
			//IL_016a: Unknown result type (might be due to invalid IL or missing references)
			//IL_0171: Unknown result type (might be due to invalid IL or missing references)
			//IL_0178: Unknown result type (might be due to invalid IL or missing references)
			//IL_0180: Expected O, but got Unknown
			//IL_0182: Unknown result type (might be due to invalid IL or missing references)
			//IL_0187: Unknown result type (might be due to invalid IL or missing references)
			//IL_019f: Unknown result type (might be due to invalid IL or missing references)
			//IL_01ad: Unknown result type (might be due to invalid IL or missing references)
			//IL_01b4: Unknown result type (might be due to invalid IL or missing references)
			//IL_01bb: Unknown result type (might be due to invalid IL or missing references)
			//IL_01c3: Expected O, but got Unknown
			//IL_01c5: Unknown result type (might be due to invalid IL or missing references)
			//IL_01ca: Unknown result type (might be due to invalid IL or missing references)
			//IL_01e3: Unknown result type (might be due to invalid IL or missing references)
			//IL_01f2: Unknown result type (might be due to invalid IL or missing references)
			//IL_01f9: Unknown result type (might be due to invalid IL or missing references)
			//IL_0200: Unknown result type (might be due to invalid IL or missing references)
			//IL_0208: Expected O, but got Unknown
			Recipe val = ScriptableObject.CreateInstance<Recipe>();
			((Object)val).name = "Recipe_BTM_HildirsMeadBase";
			val.m_item = PrefabSetup._hildirsMeadBase.GetComponent<ItemDrop>();
			val.m_amount = 1;
			val.m_enabled = ConfigSetup._hildirsMeadBaseEnable.Value;
			val.m_qualityResultAmountMultiplier = 1f;
			val.m_craftingStation = _zNetScene.GetPrefab("piece_cauldron").GetComponent<CraftingStation>();
			val.m_repairStation = null;
			val.m_minStationLevel = 1;
			val.m_requireOnlyOneIngredient = false;
			string[] array = ConfigSetup._hildirsMeadBaseMat1.Value.Split(':', ' ');
			string[] array2 = ConfigSetup._hildirsMeadBaseMat2.Value.Split(':', ' ');
			string[] array3 = ConfigSetup._hildirsMeadBaseMat3.Value.Split(':', ' ');
			string[] array4 = ConfigSetup._hildirsMeadBaseMat4.Value.Split(':', ' ');
			val.m_resources = (Requirement[])(object)new Requirement[4]
			{
				new Requirement
				{
					m_resItem = _objectDB.GetItemPrefab(array[0]).GetComponent<ItemDrop>(),
					m_amount = int.Parse(array[1]),
					m_extraAmountOnlyOneIngredient = 0,
					m_amountPerLevel = 0,
					m_recover = true
				},
				new Requirement
				{
					m_resItem = _objectDB.GetItemPrefab(array2[0]).GetComponent<ItemDrop>(),
					m_amount = int.Parse(array2[1]),
					m_extraAmountOnlyOneIngredient = 0,
					m_amountPerLevel = 0,
					m_recover = true
				},
				new Requirement
				{
					m_resItem = _objectDB.GetItemPrefab(array3[0]).GetComponent<ItemDrop>(),
					m_amount = int.Parse(array3[1]),
					m_extraAmountOnlyOneIngredient = 0,
					m_amountPerLevel = 0,
					m_recover = true
				},
				new Requirement
				{
					m_resItem = _objectDB.GetItemPrefab(array4[0]).GetComponent<ItemDrop>(),
					m_amount = int.Parse(array4[1]),
					m_extraAmountOnlyOneIngredient = 0,
					m_amountPerLevel = 0,
					m_recover = true
				}
			};
			_objectDB.AddRecipe(val);
		}
	}
	[HarmonyPatch(typeof(Game), "Update")]
	public class GamePatch
	{
		public static void Postfix(ref Game __instance)
		{
			//IL_003a: Unknown result type (might be due to invalid IL or missing references)
			//IL_003f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0044: Unknown result type (might be due to invalid IL or missing references)
			if (Plugin._haldorsMeadUsed || Plugin._odinsMeadUsed || Plugin._huginsMeadUsed || Plugin._dvergersMeadUsed || Plugin._hildirsMeadUsed)
			{
				Plugin._spawnPoint = ((PlayerProfile)Traverse.Create((object)__instance).Field("m_playerProfile").GetValue()).GetCustomSpawnPoint();
				Plugin._spawnPoint.y += 0.5f;
				if (!Plugin._portalActivated)
				{
					Plugin._portalActivated = true;
				}
			}
		}
	}
	[HarmonyPatch]
	public class ObjectDBPatch
	{
		[HarmonyPostfix]
		[HarmonyPatch(typeof(ObjectDB), "Awake")]
		[HarmonyPriority(700)]
		public static void Awake_Postfix(ObjectDB __instance)
		{
			__instance.m_StatusEffects.Add((StatusEffect)(object)Helper.CreateStatusEffects("blacks7ar_tpmeads_cd", "TP Cooldown", ((IEnumerable<Sprite>)Resources.FindObjectsOfTypeAll<Sprite>()).LastOrDefault((Func<Sprite, bool>)((Sprite x) => ((Object)x).name == "portal"))));
			__instance.m_StatusEffects.Add((StatusEffect)(object)Helper.CreateStatusEffects("blacks7ar_herculesmead_cd", "Cooldown", PrefabSetup._herculesIcon));
			__instance.m_StatusEffects.Add((StatusEffect)(object)Helper.CreateHerculeanBuff("blacks7ar_herculeanbuff_duration", "Herculean Buff", ((IEnumerable<Sprite>)Resources.FindObjectsOfTypeAll<Sprite>()).LastOrDefault((Func<Sprite, bool>)((Sprite x) => ((Object)x).name == "bronzehead_01"))));
			RegisterPrefabsToObjectDB.Init();
			RegisterRecipesToObjectDB.Init();
			__instance.UpdateItemHashes();
		}

		[HarmonyPatch(typeof(ObjectDB), "CopyOtherDB")]
		[HarmonyPostfix]
		[HarmonyPriority(700)]
		public static void CopyOtherDB_Postfix(ObjectDB __instance)
		{
			RegisterPrefabsToObjectDB.Init();
			RegisterRecipesToObjectDB.Init();
			__instance.UpdateItemHashes();
		}
	}
	[HarmonyPatch]
	public class PlayerPatch
	{
		[HarmonyPatch(typeof(Player), "ConsumeItem")]
		[HarmonyPrefix]
		private static bool ConsumeItem_Prefix(ItemData item, ref Player __instance)
		{
			//IL_05dc: Unknown result type (might be due to invalid IL or missing references)
			//IL_05e1: Unknown result type (might be due to invalid IL or missing references)
			//IL_05e3: Unknown result type (might be due to invalid IL or missing references)
			//IL_05ea: Unknown result type (might be due to invalid IL or missing references)
			//IL_05f1: Unknown result type (might be due to invalid IL or missing references)
			//IL_05f8: Unknown result type (might be due to invalid IL or missing references)
			//IL_05fd: Unknown result type (might be due to invalid IL or missing references)
			//IL_065c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0661: Unknown result type (might be due to invalid IL or missing references)
			//IL_0666: Unknown result type (might be due to invalid IL or missing references)
			//IL_0680: Unknown result type (might be due to invalid IL or missing references)
			//IL_068c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0629: Unknown result type (might be due to invalid IL or missing references)
			//IL_0635: Unknown result type (might be due to invalid IL or missing references)
			//IL_097d: Unknown result type (might be due to invalid IL or missing references)
			//IL_01b6: Unknown result type (might be due to invalid IL or missing references)
			//IL_0990: Unknown result type (might be due to invalid IL or missing references)
			//IL_0992: Unknown result type (might be due to invalid IL or missing references)
			//IL_0997: Unknown result type (might be due to invalid IL or missing references)
			//IL_09a8: Unknown result type (might be due to invalid IL or missing references)
			//IL_09aa: Unknown result type (might be due to invalid IL or missing references)
			//IL_09af: Unknown result type (might be due to invalid IL or missing references)
			//IL_09b4: Unknown result type (might be due to invalid IL or missing references)
			//IL_09b9: Unknown result type (might be due to invalid IL or missing references)
			//IL_09c9: Unknown result type (might be due to invalid IL or missing references)
			//IL_09ce: Unknown result type (might be due to invalid IL or missing references)
			//IL_09d0: Unknown result type (might be due to invalid IL or missing references)
			//IL_09d7: Unknown result type (might be due to invalid IL or missing references)
			//IL_09de: Unknown result type (might be due to invalid IL or missing references)
			//IL_09e5: Unknown result type (might be due to invalid IL or missing references)
			//IL_09ea: Unknown result type (might be due to invalid IL or missing references)
			//IL_0a0f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0a16: Unknown result type (might be due to invalid IL or missing references)
			//IL_033c: Unknown result type (might be due to invalid IL or missing references)
			//IL_033e: Unknown result type (might be due to invalid IL or missing references)
			//IL_0348: Unknown result type (might be due to invalid IL or missing references)
			//IL_034d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0352: Unknown result type (might be due to invalid IL or missing references)
			//IL_0362: Unknown result type (might be due to invalid IL or missing references)
			//IL_0367: Unknown result type (might be due to invalid IL or missing references)
			//IL_0369: Unknown result type (might be due to invalid IL or missing references)
			//IL_0370: Unknown result type (might be due to invalid IL or missing references)
			//IL_0377: Unknown result type (might be due to invalid IL or missing references)
			//IL_037e: Unknown result type (might be due to invalid IL or missing references)
			//IL_0383: Unknown result type (might be due to invalid IL or missing references)
			//IL_03a8: Unknown result type (might be due to invalid IL or missing references)
			//IL_03af: Unknown result type (might be due to invalid IL or missing references)
			//IL_01c9: Unknown result type (might be due to invalid IL or missing references)
			//IL_01cb: Unknown result type (might be due to invalid IL or missing references)
			//IL_01d0: Unknown result type (might be due to invalid IL or missing references)
			//IL_01e1: Unknown result type (might be due to invalid IL or missing references)
			//IL_01e3: Unknown result type (might be due to invalid IL or missing references)
			//IL_01e8: Unknown result type (might be due to invalid IL or missing references)
			//IL_01ed: Unknown result type (might be due to invalid IL or missing references)
			//IL_01f2: Unknown result type (might be due to invalid IL or missing references)
			//IL_0202: Unknown result type (might be due to invalid IL or missing references)
			//IL_0207: Unknown result type (might be due to invalid IL or missing references)
			//IL_0209: Unknown result type (might be due to invalid IL or missing references)
			//IL_0210: Unknown result type (might be due to invalid IL or missing references)
			//IL_0217: Unknown result type (might be due to invalid IL or missing references)
			//IL_021e: Unknown result type (might be due to invalid IL or missing references)
			//IL_0223: Unknown result type (might be due to invalid IL or missing references)
			//IL_0248: Unknown result type (might be due to invalid IL or missing references)
			//IL_024f: Unknown result type (might be due to invalid IL or missing references)
			//IL_047c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0481: Unknown result type (might be due to invalid IL or missing references)
			//IL_0483: Unknown result type (might be due to invalid IL or missing references)
			//IL_048a: Unknown result type (might be due to invalid IL or missing references)
			//IL_0491: Unknown result type (might be due to invalid IL or missing references)
			//IL_0498: Unknown result type (might be due to invalid IL or missing references)
			//IL_049d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0768: Unknown result type (might be due to invalid IL or missing references)
			//IL_0774: Unknown result type (might be due to invalid IL or missing references)
			//IL_04fc: Unknown result type (might be due to invalid IL or missing references)
			//IL_0501: Unknown result type (might be due to invalid IL or missing references)
			//IL_0506: Unknown result type (might be due to invalid IL or missing references)
			//IL_0520: Unknown result type (might be due to invalid IL or missing references)
			//IL_052c: Unknown result type (might be due to invalid IL or missing references)
			//IL_04c9: Unknown result type (might be due to invalid IL or missing references)
			//IL_04d5: Unknown result type (might be due to invalid IL or missing references)
			switch (((Object)item.m_dropPrefab).name)
			{
			case "BTM_DvergrMead":
			{
				if (!((Humanoid)__instance).IsTeleportable())
				{
					MessageHud.instance.ShowMessage((MessageType)2, "<size=28>You can't teleport right now.</size>", 0, (Sprite)null);
					return false;
				}
				if (((Character)__instance).GetSEMan().HaveStatusEffect("blacks7ar_tpmeads_cd"))
				{
					MessageHud.instance.ShowMessage((MessageType)2, "<size=28>You can't teleport right now.</size>", 0, (Sprite)null);
					return false;
				}
				StatusEffect statusEffect2 = ObjectDB.instance.GetStatusEffect(StringExtensionMethods.GetStableHashCode("blacks7ar_tpmeads_cd"));
				Plugin._dvergersMeadCD.SettingChanged += delegate
				{
					statusEffect2.m_ttl = Plugin._dvergersMeadCD.Value;
				};
				statusEffect2.m_ttl = Plugin._dvergersMeadCD.Value;
				((Character)__instance).GetSEMan().AddStatusEffect(statusEffect2, false, 0, 0f);
				Dictionary<Vector3, string> dictionary2 = new Dictionary<Vector3, string>();
				LocationInstance val3 = default(LocationInstance);
				if (ZoneSystem.instance.FindClosestLocation("Vendor_BlackForest", Vector3.zero, ref val3))
				{
					dictionary2[val3.m_position] = val3.m_location.m_prefabName;
					Plugin._traderPoint = val3.m_position + Vector3.up;
					Transform transform3 = ((Component)__instance).transform;
					Vector3 position5 = transform3.position;
					Plugin._savedPosition = new Vector3(position5.x, position5.y, position5.z);
					Plugin._dvergersMeadUsed = true;
					Plugin._huginsMeadUsed = false;
					Plugin._haldorsMeadUsed = false;
					Plugin._odinsMeadUsed = false;
					Plugin._hildirsMeadUsed = false;
					((Character)__instance).TeleportTo(Plugin._traderPoint, transform3.rotation, true);
				}
				else
				{
					Logging.LogInfo("Trader not found, try again later..");
				}
				break;
			}
			case "BTM_HuginMead":
			{
				if (!((Humanoid)__instance).IsTeleportable())
				{
					MessageHud.instance.ShowMessage((MessageType)2, "<size=28>You can't teleport right now.</size>", 0, (Sprite)null);
					return false;
				}
				if (((Character)__instance).GetSEMan().HaveStatusEffect("blacks7ar_tpmeads_cd"))
				{
					MessageHud.instance.ShowMessage((MessageType)2, "<size=28>You can't teleport right now.</size>", 0, (Sprite)null);
					return false;
				}
				StatusEffect statusEffect7 = ObjectDB.instance.GetStatusEffect(StringExtensionMethods.GetStableHashCode("blacks7ar_tpmeads_cd"));
				Plugin._huginsMeadCD.SettingChanged += delegate
				{
					statusEffect7.m_ttl = Plugin._huginsMeadCD.Value;
				};
				statusEffect7.m_ttl = Plugin._huginsMeadCD.Value;
				((Character)__instance).GetSEMan().AddStatusEffect(statusEffect7, false, 0, 0f);
				Game instance2 = Game.instance;
				Vector3 val2 = default(Vector3);
				if (ZoneSystem.instance.GetLocationIcon(instance2.m_StartLocation, ref val2))
				{
					Plugin._startPoint = val2 + Vector3.up * 2f;
					Transform transform2 = ((Component)__instance).transform;
					Vector3 position3 = transform2.position;
					Plugin._savedPosition = new Vector3(position3.x, position3.y, position3.z);
					Plugin._huginsMeadUsed = true;
					Plugin._haldorsMeadUsed = false;
					Plugin._odinsMeadUsed = false;
					Plugin._dvergersMeadUsed = false;
					Plugin._hildirsMeadUsed = false;
					((Character)__instance).TeleportTo(Plugin._startPoint, transform2.rotation, true);
				}
				break;
			}
			case "BTM_HaldorMead":
			{
				if (!((Humanoid)__instance).IsTeleportable())
				{
					MessageHud.instance.ShowMessage((MessageType)2, "<size=28>You can't teleport right now.</size>", 0, (Sprite)null);
					return false;
				}
				if (((Character)__instance).GetSEMan().HaveStatusEffect("blacks7ar_tpmeads_cd"))
				{
					MessageHud.instance.ShowMessage((MessageType)2, "<size=28>You can't teleport right now.</size>", 0, (Sprite)null);
					return false;
				}
				StatusEffect statusEffect6 = ObjectDB.instance.GetStatusEffect(StringExtensionMethods.GetStableHashCode("blacks7ar_tpmeads_cd"));
				Plugin._haldorsMeadCD.SettingChanged += delegate
				{
					statusEffect6.m_ttl = Plugin._haldorsMeadCD.Value;
				};
				statusEffect6.m_ttl = Plugin._haldorsMeadCD.Value;
				((Character)__instance).GetSEMan().AddStatusEffect(statusEffect6, false, 0, 0f);
				Game instance = Game.instance;
				Vector3 position2 = ((Component)__instance).transform.position;
				Plugin._savedPosition = new Vector3(position2.x, position2.y, position2.z);
				Plugin._haldorsMeadUsed = true;
				Plugin._odinsMeadUsed = false;
				Plugin._dvergersMeadUsed = false;
				Plugin._huginsMeadUsed = false;
				Plugin._hildirsMeadUsed = false;
				if (Plugin._portalActivated)
				{
					((Character)__instance).TeleportTo(Plugin._spawnPoint, ((Component)__instance).transform.rotation, true);
					break;
				}
				Plugin._spawnPoint = ((PlayerProfile)Traverse.Create((object)instance).Field("m_playerProfile").GetValue()).GetCustomSpawnPoint();
				Plugin._spawnPoint.y += 0.5f;
				((Character)__instance).TeleportTo(Plugin._spawnPoint, ((Component)__instance).transform.rotation, true);
				break;
			}
			case "BTM_OdinMead":
			{
				if (((Character)__instance).GetSEMan().HaveStatusEffect("blacks7ar_tpmeads_cd"))
				{
					MessageHud.instance.ShowMessage((MessageType)2, "<size=28>You can't teleport right now.</size>", 0, (Sprite)null);
					return false;
				}
				StatusEffect statusEffect3 = ObjectDB.instance.GetStatusEffect(StringExtensionMethods.GetStableHashCode("blacks7ar_tpmeads_cd"));
				Plugin._odinsMeadCD.SettingChanged += delegate
				{
					statusEffect3.m_ttl = Plugin._odinsMeadCD.Value;
				};
				statusEffect3.m_ttl = Plugin._odinsMeadCD.Value;
				((Character)__instance).GetSEMan().AddStatusEffect(statusEffect3, false, 0, 0f);
				Game instance3 = Game.instance;
				Vector3 position4 = ((Component)__instance).transform.position;
				Plugin._savedPosition = new Vector3(position4.x, position4.y, position4.z);
				Plugin._odinsMeadUsed = true;
				Plugin._haldorsMeadUsed = false;
				Plugin._dvergersMeadUsed = false;
				Plugin._huginsMeadUsed = false;
				Plugin._hildirsMeadUsed = false;
				if (Plugin._portalActivated)
				{
					((Character)__instance).TeleportTo(Plugin._spawnPoint, ((Component)__instance).transform.rotation, true);
					break;
				}
				Plugin._spawnPoint = ((PlayerProfile)Traverse.Create((object)instance3).Field("m_playerProfile").GetValue()).GetCustomSpawnPoint();
				Plugin._spawnPoint.y += 0.5f;
				((Character)__instance).TeleportTo(Plugin._spawnPoint, ((Component)__instance).transform.rotation, true);
				break;
			}
			case "BTM_KnarrMead":
			{
				if (!Plugin._portalActivated)
				{
					MessageHud.instance.ShowMessage((MessageType)2, "<size=28>You don't have a previous saved location to go back to.</size>", 0, (Sprite)null);
					return false;
				}
				if (!((Humanoid)__instance).IsTeleportable())
				{
					MessageHud.instance.ShowMessage((MessageType)2, "<size=28>You can't teleport right now.</size>", 0, (Sprite)null);
					return false;
				}
				if (((Character)__instance).GetSEMan().HaveStatusEffect("blacks7ar_tpmeads_cd"))
				{
					MessageHud.instance.ShowMessage((MessageType)2, "<size=28>You can't teleport right now.</size>", 0, (Sprite)null);
					return false;
				}
				StatusEffect statusEffect = ObjectDB.instance.GetStatusEffect(StringExtensionMethods.GetStableHashCode("blacks7ar_tpmeads_cd"));
				Plugin._knarrsMeadCD.SettingChanged += delegate
				{
					statusEffect.m_ttl = Plugin._knarrsMeadCD.Value;
				};
				statusEffect.m_ttl = Plugin._knarrsMeadCD.Value;
				((Character)__instance).GetSEMan().AddStatusEffect(statusEffect, false, 0, 0f);
				((Character)__instance).TeleportTo(Plugin._savedPosition, ((Component)__instance).transform.rotation, true);
				break;
			}
			case "BTM_HerculesMead":
			{
				if (((Character)__instance).GetSEMan().HaveStatusEffect("blacks7ar_herculesmead_cd"))
				{
					MessageHud.instance.ShowMessage((MessageType)2, "<size=28>Can't be use right now.</size>", 0, (Sprite)null);
					return false;
				}
				if (((Character)__instance).GetSEMan().HaveStatusEffect("blacks7ar_herculeanbuff_duration"))
				{
					MessageHud.instance.ShowMessage((MessageType)2, "<size=28>Herculean Buff is still in effect, try again later.</size>", 0, (Sprite)null);
					return false;
				}
				StatusEffect statusEffect5 = ObjectDB.instance.GetStatusEffect(StringExtensionMethods.GetStableHashCode("blacks7ar_herculesmead_cd"));
				Plugin._herculesMeadCD.SettingChanged += delegate
				{
					statusEffect5.m_ttl = Plugin._herculesMeadCD.Value;
				};
				statusEffect5.m_ttl = Plugin._herculesMeadCD.Value;
				((Character)__instance).GetSEMan().AddStatusEffect(statusEffect5, false, 0, 0f);
				StatusEffect statusEffect8 = ObjectDB.instance.GetStatusEffect(StringExtensionMethods.GetStableHashCode("blacks7ar_herculeanbuff_duration"));
				Plugin._herculesMeadEffectDuration.SettingChanged += delegate
				{
					statusEffect8.m_ttl = Plugin._herculesMeadEffectDuration.Value;
				};
				statusEffect8.m_ttl = Plugin._herculesMeadEffectDuration.Value;
				((Character)__instance).GetSEMan().AddStatusEffect(statusEffect8, false, 0, 0f);
				Player obj = __instance;
				obj.m_maxCarryWeight *= 2f;
				Plugin._countBegan = true;
				break;
			}
			case "BTM_HildirsMead":
			{
				if (!((Humanoid)__instance).IsTeleportable())
				{
					MessageHud.instance.ShowMessage((MessageType)2, "<size=28>You can't teleport right now.</size>", 0, (Sprite)null);
					return false;
				}
				if (((Character)__instance).GetSEMan().HaveStatusEffect("blacks7ar_tpmeads_cd"))
				{
					MessageHud.instance.ShowMessage((MessageType)2, "<size=28>You can't teleport right now.</size>", 0, (Sprite)null);
					return false;
				}
				StatusEffect statusEffect4 = ObjectDB.instance.GetStatusEffect(StringExtensionMethods.GetStableHashCode("blacks7ar_tpmeads_cd"));
				Plugin._hildirsMeadCD.SettingChanged += delegate
				{
					statusEffect4.m_ttl = Plugin._hildirsMeadCD.Value;
				};
				statusEffect4.m_ttl = Plugin._hildirsMeadCD.Value;
				((Character)__instance).GetSEMan().AddStatusEffect(statusEffect4, false, 0, 0f);
				Dictionary<Vector3, string> dictionary = new Dictionary<Vector3, string>();
				LocationInstance val = default(LocationInstance);
				if (ZoneSystem.instance.FindClosestLocation("Hildir_camp", Vector3.zero, ref val))
				{
					dictionary[val.m_position] = val.m_location.m_prefabName;
					Plugin._hildirPoint = val.m_position + Vector3.up;
					Transform transform = ((Component)__instance).transform;
					Vector3 position = transform.position;
					Plugin._savedPosition = new Vector3(position.x, position.y, position.z);
					Plugin._dvergersMeadUsed = false;
					Plugin._huginsMeadUsed = false;
					Plugin._haldorsMeadUsed = false;
					Plugin._odinsMeadUsed = false;
					Plugin._hildirsMeadUsed = true;
					((Character)__instance).TeleportTo(Plugin._hildirPoint, transform.rotation, true);
				}
				else
				{
					Logging.LogInfo("Hildirs Camp not found, try again later..");
				}
				break;
			}
			}
			return true;
		}

		[HarmonyPatch(typeof(Player), "FixedUpdate")]
		[HarmonyPostfix]
		public static void FixedUpdate_Postfix(ref Player __instance)
		{
			if (!((Character)__instance).GetSEMan().HaveStatusEffect("blacks7ar_herculeanbuff_duration") && Plugin._countBegan)
			{
				Player obj = __instance;
				obj.m_maxCarryWeight /= 2f;
				Plugin._countBegan = false;
			}
		}
	}
	[HarmonyPatch(typeof(ZNetScene), "Awake")]
	public class ZNetScenePatch
	{
		public static void Postfix(ZNetScene __instance)
		{
			//IL_004f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0054: Unknown result type (might be due to invalid IL or missing references)
			//IL_005c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0079: Unknown result type (might be due to invalid IL or missing references)
			//IL_009b: Expected O, but got Unknown
			//IL_00d0: Unknown result type (might be due to invalid IL or missing references)
			//IL_00d5: Unknown result type (might be due to invalid IL or missing references)
			//IL_00dc: Unknown result type (might be due to invalid IL or missing references)
			//IL_00f9: Unknown result type (might be due to invalid IL or missing references)
			//IL_011b: Expected O, but got Unknown
			if ((Object)(object)__instance == (Object)null)
			{
				return;
			}
			List<GameObject> prefabs = __instance.m_prefabs;
			if (prefabs == null || prefabs.Count <= 0)
			{
				return;
			}
			RegisterPrefabsToZNetScene.Init();
			Fermenter component = __instance.GetPrefab("fermenter").GetComponent<Fermenter>();
			foreach (KeyValuePair<GameObject, GameObject> item in Plugin.ToBeFermented)
			{
				component.m_conversion.Add(new ItemConversion
				{
					m_producedItems = 10,
					m_from = __instance.GetPrefab(((Object)item.Key).name).GetComponent<ItemDrop>(),
					m_to = __instance.GetPrefab(((Object)item.Value).name).GetComponent<ItemDrop>()
				});
			}
			foreach (KeyValuePair<GameObject, GameObject> item2 in Plugin.ToBeFermented2)
			{
				component.m_conversion.Add(new ItemConversion
				{
					m_producedItems = 1,
					m_from = __instance.GetPrefab(((Object)item2.Key).name).GetComponent<ItemDrop>(),
					m_to = __instance.GetPrefab(((Object)item2.Value).name).GetComponent<ItemDrop>()
				});
			}
		}
	}
}
namespace Microsoft.CodeAnalysis
{
	[CompilerGenerated]
	[<b89b921d-8954-4084-bd4d-1feb826a594e>Embedded]
	internal sealed class <b89b921d-8954-4084-bd4d-1feb826a594e>EmbeddedAttribute : Attribute
	{
	}
}
namespace System.Runtime.CompilerServices
{
	[CompilerGenerated]
	[<b89b921d-8954-4084-bd4d-1feb826a594e>Embedded]
	[AttributeUsage(AttributeTargets.Class | AttributeTargets.Property | AttributeTargets.Field | AttributeTargets.Event | AttributeTargets.Parameter | AttributeTargets.ReturnValue | AttributeTargets.GenericParameter, AllowMultiple = false, Inherited = false)]
	internal sealed class <f6f8ff5f-fa45-43ba-9489-b740a9e7c98b>NullableAttribute : Attribute
	{
		public readonly byte[] NullableFlags;

		public <f6f8ff5f-fa45-43ba-9489-b740a9e7c98b>NullableAttribute(byte P_0)
		{
			NullableFlags = new byte[1] { P_0 };
		}

		public <f6f8ff5f-fa45-43ba-9489-b740a9e7c98b>NullableAttribute(byte[] P_0)
		{
			NullableFlags = P_0;
		}
	}
	[CompilerGenerated]
	[<b89b921d-8954-4084-bd4d-1feb826a594e>Embedded]
	[AttributeUsage(AttributeTargets.Class | AttributeTargets.Struct | AttributeTargets.Method | AttributeTargets.Interface | AttributeTargets.Delegate, AllowMultiple = false, Inherited = false)]
	internal sealed class <bb5e3e5e-5c47-485a-88ef-ea5afd7f01c7>NullableContextAttribute : Attribute
	{
		public readonly byte Flag;

		public <bb5e3e5e-5c47-485a-88ef-ea5afd7f01c7>NullableContextAttribute(byte P_0)
		{
			Flag = P_0;
		}
	}
}
namespace LocalizationManager
{
	[<bb5e3e5e-5c47-485a-88ef-ea5afd7f01c7>NullableContext(1)]
	[PublicAPI]
	[<f6f8ff5f-fa45-43ba-9489-b740a9e7c98b>Nullable(0)]
	internal class Localizer
	{
		private static readonly Dictionary<string, Dictionary<string, Func<string>>> PlaceholderProcessors;

		private static readonly Dictionary<string, Dictionary<string, string>> loadedTexts;

		private static readonly ConditionalWeakTable<Localization, string> localizationLanguage;

		private static readonly List<WeakReference<Localization>> localizationObjects;

		[<f6f8ff5f-fa45-43ba-9489-b740a9e7c98b>Nullable(2)]
		private static BaseUnityPlugin _plugin;

		private static readonly List<string> fileExtensions;

		private static BaseUnityPlugin plugin
		{
			get
			{
				//IL_009b: Unknown result type (might be due to invalid IL or missing references)
				//IL_00a5: Expected O, but got Unknown
				if (_plugin == null)
				{
					IEnumerable<TypeInfo> source;
					try
					{
						source = Assembly.GetExecutingAssembly().DefinedTypes.ToList();
					}
					catch (ReflectionTypeLoadException ex)
					{
						source = from t in ex.Types
							where t != null
							select t.GetTypeInfo();
					}
					_plugin = (BaseUnityPlugin)Chainloader.ManagerObject.GetComponent((Type)source.First([<bb5e3e5e-5c47-485a-88ef-ea5afd7f01c7>NullableContext(0)] (TypeInfo t) => t.IsClass && typeof(BaseUnityPlugin).IsAssignableFrom(t)));
				}
				return _plugin;
			}
		}

		private static void UpdatePlaceholderText(Localization localization, string key)
		{
			localizationLanguage.TryGetValue(localization, out var value);
			string text = loadedTexts[value][key];
			if (PlaceholderProcessors.TryGetValue(key, out var value2))
			{
				text = value2.Aggregate(text, [<bb5e3e5e-5c47-485a-88ef-ea5afd7f01c7>NullableContext(0)] (string current, KeyValuePair<string, Func<string>> kv) => current.Replace("{" + kv.Key + "}", kv.Value()));
			}
			localization.AddWord(key, text);
		}

		public static void AddPlaceholder<T>(string key, string placeholder, ConfigEntry<T> config, [<f6f8ff5f-fa45-43ba-9489-b740a9e7c98b>Nullable(new byte[] { 2, 1, 1 })] Func<T, string> convertConfigValue = null)
		{
			if (convertConfigValue == null)
			{
				convertConfigValue = [<bb5e3e5e-5c47-485a-88ef-ea5afd7f01c7>NullableContext(0)] [return: <f6f8ff5f-fa45-43ba-9489-b740a9e7c98b>Nullable(1)] (T val) => val.ToString();
			}
			if (!PlaceholderProcessors.ContainsKey(key))
			{
				PlaceholderProcessors[key] = new Dictionary<string, Func<string>>();
			}
			config.SettingChanged += [<bb5e3e5e-5c47-485a-88ef-ea5afd7f01c7>NullableContext(0)] (object _, EventArgs _) =>
			{
				UpdatePlaceholder();
			};
			if (loadedTexts.ContainsKey(Localization.instance.GetSelectedLanguage()))
			{
				UpdatePlaceholder();
			}
			void UpdatePlaceholder()
			{
				PlaceholderProcessors[key][placeholder] = () => convertConfigValue(config.Value);
				UpdatePlaceholderText(Localization.instance, key);
			}
		}

		public static void AddText(string key, string text)
		{
			List<WeakReference<Localization>> list = new List<WeakReference<Localization>>();
			foreach (WeakReference<Localization> localizationObject in localizationObjects)
			{
				if (localizationObject.TryGetTarget(out var target))
				{
					Dictionary<string, string> dictionary = loadedTexts[localizationLanguage.GetOrCreateValue(target)];
					if (!target.m_translations.ContainsKey(key))
					{
						dictionary[key] = text;
						target.AddWord(key, text);
					}
				}
				else
				{
					list.Add(localizationObject);
				}
			}
			foreach (WeakReference<Localization> item in list)
			{
				localizationObjects.Remove(item);
			}
		}

		public static void Load()
		{
			LoadLocalization(Localization.instance, Localization.instance.GetSelectedLanguage());
		}

		private static void LoadLocalization(Localization __instance, string language)
		{
			if (!localizationLanguage.Remove(__instance))
			{
				localizationObjects.Add(new WeakReference<Localization>(__instance));
			}
			localizationLanguage.Add(__instance, language);
			Dictionary<string, string> dictionary = new Dictionary<string, string>();
			foreach (string item in from f in Directory.GetFiles(Path.GetDirectoryName(Paths.PluginPath), plugin.Info.Metadata.Name + ".*", SearchOption.AllDirectories)
				where fileExtensions.IndexOf(Path.GetExtension(f)) >= 0
				select f)
			{
				string text = Path.GetFileNameWithoutExtension(item).Split(new char[1] { '.' })[1];
				if (dictionary.ContainsKey(text))
				{
					Debug.LogWarning((object)("Duplicate key " + text + " found for " + plugin.Info.Metadata.Name + ". The duplicate file found at " + item + " will be skipped."));
				}
				else
				{
					dictionary[text] = item;
				}
			}
			byte[] array = LoadTranslationFromAssembly("English");
			if (array == null)
			{
				throw new Exception("Found no English localizations in mod " + plugin.Info.Metadata.Name + ". Expected an embedded resource translations/English.json or translations/English.yml.");
			}
			Dictionary<string, string> dictionary2 = new DeserializerBuilder().IgnoreFields().Build().Deserialize<Dictionary<string, string>>(Encoding.UTF8.GetString(array));
			if (dictionary2 == null)
			{
				throw new Exception("Localization for mod " + plugin.Info.Metadata.Name + " failed: Localization file was empty.");
			}
			string text2 = null;
			if (language != "English")
			{
				if (dictionary.ContainsKey(language))
				{
					text2 = File.ReadAllText(dictionary[language]);
				}
				else
				{
					byte[] array2 = LoadTranslationFromAssembly(language);
					if (array2 != null)
					{
						text2 = Encoding.UTF8.GetString(array2);
					}
				}
			}
			if (text2 == null && dictionary.ContainsKey("English"))
			{
				text2 = File.ReadAllText(dictionary["English"]);
			}
			if (text2 != null)
			{
				foreach (KeyValuePair<string, string> item2 in new DeserializerBuilder().IgnoreFields().Build().Deserialize<Dictionary<string, string>>(text2) ?? new Dictionary<string, string>())
				{
					dictionary2[item2.Key] = item2.Value;
				}
			}
			loadedTexts[language] = dictionary2;
			foreach (KeyValuePair<string, string> item3 in dictionary2)
			{
				UpdatePlaceholderText(__instance, item3.Key);
			}
		}

		static Localizer()
		{
			//IL_004d: Unknown result type (might be due to invalid IL or missing references)
			//IL_007f: Unknown result type (might be due to invalid IL or missing references)
			//IL_008c: Expected O, but got Unknown
			PlaceholderProcessors = new Dictionary<string, Dictionary<string, Func<string>>>();
			loadedTexts = new Dictionary<string, Dictionary<string, string>>();
			localizationLanguage = new ConditionalWeakTable<Localization, string>();
			localizationObjects = new List<WeakReference<Localization>>();
			fileExtensions = new List<string> { ".json", ".yml" };
			new Harmony("org.bepinex.helpers.LocalizationManager").Patch((MethodBase)AccessTools.DeclaredMethod(typeof(Localization), "LoadCSV", (Type[])null, (Type[])null), (HarmonyMethod)null, new HarmonyMethod(AccessTools.DeclaredMethod(typeof(Localizer), "LoadLocalization", (Type[])null, (Type[])null)), (HarmonyMethod)null, (HarmonyMethod)null, (HarmonyMethod)null);
		}

		[return: <f6f8ff5f-fa45-43ba-9489-b740a9e7c98b>Nullable(2)]
		private static byte[] LoadTranslationFromAssembly(string language)
		{
			foreach (string fileExtension in fileExtensions)
			{
				byte[] array = ReadEmbeddedFileBytes("translations." + language + fileExtension);
				if (array != null)
				{
					return array;
				}
			}
			return null;
		}

		[<bb5e3e5e-5c47-485a-88ef-ea5afd7f01c7>NullableContext(2)]
		public static byte[] ReadEmbeddedFileBytes([<f6f8ff5f-fa45-43ba-9489-b740a9e7c98b>Nullable(1)] string resourceFileName, Assembly containingAssembly = null)
		{
			using MemoryStream memoryStream = new MemoryStream();
			if ((object)containingAssembly == null)
			{
				containingAssembly = Assembly.GetCallingAssembly();
			}
			string text = containingAssembly.GetManifestResourceNames().FirstOrDefault([<bb5e3e5e-5c47-485a-88ef-ea5afd7f01c7>NullableContext(0)] (string str) => str.EndsWith(resourceFileName, StringComparison.Ordinal));
			if (text != null)
			{
				containingAssembly.GetManifestResourceStream(text)?.CopyTo(memoryStream);
			}
			return (memoryStream.Length == 0L) ? null : memoryStream.ToArray();
		}
	}
}
namespace Microsoft.CodeAnalysis
{
	[CompilerGenerated]
	[<468a189c-2f7c-463b-9ca7-aa05a45f3883>Embedded]
	internal sealed class <468a189c-2f7c-463b-9ca7-aa05a45f3883>EmbeddedAttribute : Attribute
	{
	}
}
namespace System.Runtime.CompilerServices
{
	[<468a189c-2f7c-463b-9ca7-aa05a45f3883>Embedded]
	[CompilerGenerated]
	[AttributeUsage(AttributeTargets.Class | AttributeTargets.Property | AttributeTargets.Field | AttributeTargets.Event | AttributeTargets.Parameter | AttributeTargets.ReturnValue | AttributeTargets.GenericParameter, AllowMultiple = false, Inherited = false)]
	internal sealed class <19c02ad9-e55c-4cfc-a7c2-01ff9ea6b587>NullableAttribute : Attribute
	{
		public readonly byte[] NullableFlags;

		public <19c02ad9-e55c-4cfc-a7c2-01ff9ea6b587>NullableAttribute(byte P_0)
		{
			NullableFlags = new byte[1] { P_0 };
		}

		public <19c02ad9-e55c-4cfc-a7c2-01ff9ea6b587>NullableAttribute(byte[] P_0)
		{
			NullableFlags = P_0;
		}
	}
	[<468a189c-2f7c-463b-9ca7-aa05a45f3883>Embedded]
	[AttributeUsage(AttributeTargets.Class | AttributeTargets.Struct | AttributeTargets.Method | AttributeTargets.Interface | AttributeTargets.Delegate, AllowMultiple = false, Inherited = false)]
	[CompilerGenerated]
	internal sealed class <639f08e7-e74d-44ff-8802-00d2b9023491>NullableContextAttribute : Attribute
	{
		public readonly byte Flag;

		public <639f08e7-e74d-44ff-8802-00d2b9023491>NullableContextAttribute(byte P_0)
		{
			Flag = P_0;
		}
	}
}
namespace System.Diagnostics.CodeAnalysis
{
	[AttributeUsage(AttributeTargets.Property | AttributeTargets.Field | AttributeTargets.Parameter, Inherited = false)]
	internal sealed class AllowNullAttribute : Attribute
	{
	}
	[AttributeUsage(AttributeTargets.Property | AttributeTargets.Field | AttributeTargets.Parameter, Inherited = false)]
	internal sealed class DisallowNullAttribute : Attribute
	{
	}
	[AttributeUsage(AttributeTargets.Method, Inherited = false)]
	internal sealed class DoesNotReturnAttribute : Attribute
	{
	}
	[AttributeUsage(AttributeTargets.Parameter, Inherited = false)]
	internal sealed class DoesNotReturnIfAttribute : Attribute
	{
		public bool ParameterValue { get; }

		public DoesNotReturnIfAttribute(bool parameterValue)
		{
			ParameterValue = parameterValue;
		}
	}
	[AttributeUsage(AttributeTargets.Property | AttributeTargets.Field | AttributeTargets.Parameter | AttributeTargets.ReturnValue, Inherited = false)]
	internal sealed class MaybeNullAttribute : Attribute
	{
	}
	[AttributeUsage(AttributeTargets.Parameter, Inherited = false)]
	internal sealed class MaybeNullWhenAttribute : Attribute
	{
		public bool ReturnValue { get; }

		public MaybeNullWhenAttribute(bool returnValue)
		{
			ReturnValue = returnValue;
		}
	}
	[AttributeUsage(AttributeTargets.Property | AttributeTargets.Field | AttributeTargets.Parameter | AttributeTargets.ReturnValue, Inherited = false)]
	internal sealed class NotNullAttribute : Attribute
	{
	}
	[<639f08e7-e74d-44ff-8802-00d2b9023491>NullableContext(1)]
	[AttributeUsage(AttributeTargets.Property | AttributeTargets.Parameter | AttributeTargets.ReturnValue, AllowMultiple = true, Inherited = false)]
	[<19c02ad9-e55c-4cfc-a7c2-01ff9ea6b587>Nullable(0)]
	internal sealed class NotNullIfNotNullAttribute : Attribute
	{
		public string ParameterName { get; }

		public NotNullIfNotNullAttribute(string parameterName)
		{
			ParameterName = parameterName;
		}
	}
	[AttributeUsage(AttributeTargets.Parameter, Inherited = false)]
	internal sealed class NotNullWhenAttribute : Attribute
	{
		public bool ReturnValue { get; }

		public NotNullWhenAttribute(bool returnValue)
		{
			ReturnValue = returnValue;
		}
	}
}
namespace System.Collections.Generic
{
	internal static class DeconstructionExtensions
	{
		[<639f08e7-e74d-44ff-8802-00d2b9023491>NullableContext(1)]
		public static void Deconstruct<[<19c02ad9-e55c-4cfc-a7c2-01ff9ea6b587>Nullable(2)] TKey, [<19c02ad9-e55c-4cfc-a7c2-01ff9ea6b587>Nullable(2)] TValue>([<19c02ad9-e55c-4cfc-a7c2-01ff9ea6b587>Nullable(new byte[] { 0, 1, 1 })] this KeyValuePair<TKey, TValue> pair, out TKey key, out TValue value)
		{
			key = pair.Key;
			value = pair.Value;
		}
	}
}
namespace YamlDotNet
{
	[<19c02ad9-e55c-4cfc-a7c2-01ff9ea6b587>Nullable(0)]
	[<639f08e7-e74d-44ff-8802-00d2b9023491>NullableContext(1)]
	internal sealed class CultureInfoAdapter : CultureInfo
	{
		private readonly IFormatProvider provider;

		public CultureInfoAdapter(CultureInfo baseCulture, IFormatProvider provider)
			: base(baseCulture.LCID)
		{
			this.provider = provider;
		}

		[<639f08e7-e74d-44ff-8802-00d2b9023491>NullableContext(2)]
		public override object GetFormat(Type formatType)
		{
			return provider.GetFormat(formatType);
		}
	}
	[<639f08e7-e74d-44ff-8802-00d2b9023491>NullableContext(1)]
	[<19c02ad9-e55c-4cfc-a7c2-01ff9ea6b587>Nullable(0)]
	internal static class ReflectionExtensions
	{
		[<19c02ad9-e55c-4cfc-a7c2-01ff9ea6b587>Nullable(2)]
		private static readonly FieldInfo RemoteStackTraceField = typeof(Exception).GetField("_remoteStackTraceString", BindingFlags.Instance | Bin