Decompiled source of Farming and Cooking Mod MelanieMelicious v0.4.0

MelanieMeliciousCooked.dll

Decompiled a day ago
using System;
using System.Collections;
using System.Collections.Generic;
using System.Diagnostics;
using System.IO;
using System.Linq;
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.Versioning;
using System.Security;
using System.Security.Permissions;
using BepInEx;
using BepInEx.Configuration;
using BepInEx.Logging;
using GameNetcodeStuff;
using HarmonyLib;
using LethalLib.Modules;
using MelanieMeliciousCooked;
using MelanieMeliciousCooked.NetcodePatcher;
using Microsoft.CodeAnalysis;
using Unity.Netcode;
using UnityEngine;

[assembly: CompilationRelaxations(8)]
[assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)]
[assembly: Debuggable(DebuggableAttribute.DebuggingModes.Default | DebuggableAttribute.DebuggingModes.DisableOptimizations | DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints | DebuggableAttribute.DebuggingModes.EnableEditAndContinue)]
[assembly: TargetFramework(".NETFramework,Version=v4.7.2", FrameworkDisplayName = ".NET Framework 4.7.2")]
[assembly: SecurityPermission(SecurityAction.RequestMinimum, SkipVerification = true)]
[assembly: AssemblyVersion("0.0.0.0")]
[module: UnverifiableCode]
[module: RefSafetyRules(11)]
[module: NetcodePatchedAssembly]
internal class <Module>
{
	static <Module>()
	{
	}
}
namespace Microsoft.CodeAnalysis
{
	[CompilerGenerated]
	[Microsoft.CodeAnalysis.Embedded]
	internal sealed class EmbeddedAttribute : Attribute
	{
	}
}
namespace System.Runtime.CompilerServices
{
	[CompilerGenerated]
	[Microsoft.CodeAnalysis.Embedded]
	[AttributeUsage(AttributeTargets.Module, AllowMultiple = false, Inherited = false)]
	internal sealed class RefSafetyRulesAttribute : Attribute
	{
		public readonly int Version;

		public RefSafetyRulesAttribute(int P_0)
		{
			Version = P_0;
		}
	}
}
public class HarmonyPatches
{
	[HarmonyPostfix]
	[HarmonyPatch(typeof(StartOfRound), "Start")]
	private static void PostStartRound()
	{
		foreach (Item items in StartOfRound.Instance.allItemsList.itemsList)
		{
			foreach (string item in MelanieCookedConfig.meatGrind.Value.Split(new char[1] { ',' }).Concat(new <>z__ReadOnlyArray<string>(new string[9] { "ManticoilBody", "TulipSnakeBody", "CentipedeBody", "HoarderingBugBody", "CaveDwellerBody", "CrawlerBody", "BaboonHawkBody", "BunkerSpiderBody", "BodyBag" })))
			{
				if (((Object)items.spawnPrefab).name == item)
				{
					Plugin.bodyHash.Add(items);
				}
			}
			foreach (string item2 in MelanieCookedConfig.meatGoop.Value.Split(new char[1] { ',' }).Concat(new <>z__ReadOnlyArray<string>(new string[17]
			{
				"ModdedEnemyPowerLevel1", "ModdedEnemyPowerLevel2", "ModdedEnemyPowerLevel3", "Baboon Hawk Sample", "Bracken Sample", "Bunker Spider Sample", "Eyeless Dog Sample", "Forest Keeper Sample", "Hoarding Bug Sample", "Kidnapper Fox Sample",
				"Maneater Sample", "Manticoil Sample", "Snare Flea Sample", "Spore Lizard Sample", "Thumper Sample", "Tulip Snake Sample", "SampleDriftWoodGiant"
			})))
			{
				if (((Object)items.spawnPrefab).name == item2)
				{
					Plugin.goopHash.Add(items);
				}
			}
			foreach (string item3 in MelanieCookedConfig.meatList.Value.Split(new char[1] { ',' }).Concat(new <>z__ReadOnlyArray<string>(new string[5] { "Meat0", "Meat1", "PackagedMeatMealPrefab", "MeatCube", "PackagedSurvivalMealPrefab" })))
			{
				if (((Object)items.spawnPrefab).name == item3)
				{
					Plugin.meatHash.Add(items);
				}
			}
			foreach (string item4 in MelanieCookedConfig.veggieList.Value.Split(new char[1] { ',' }).Concat(new <>z__ReadOnlyArray<string>(new string[7] { "PickleJar", "Carrot0", "Potato0", "Tomato", "Golden Tomato", "Corn", "PackagedVeganMealPrefab" })))
			{
				if (((Object)items.spawnPrefab).name == item4)
				{
					Plugin.veggieHash.Add(items);
				}
			}
			foreach (string item5 in MelanieCookedConfig.grainList.Value.Split(new char[1] { ',' }).Concat(new <>z__ReadOnlyArray<string>(new string[2] { "Flour0", "LoafBread0" })))
			{
				if (((Object)items.spawnPrefab).name == item5)
				{
					Plugin.grainHash.Add(items);
				}
			}
			foreach (string item6 in MelanieCookedConfig.cheeseList.Value.Split(new char[1] { ',' }).Concat(new <>z__ReadOnlyArray<string>(new string[8] { "BlueCheesePrefab", "CheeseHammerPrefab", "CheesePuffPrefab", "CheeseWedgePrefab", "CheeseWheelPrefab", "DoaWKPrefab", "MrTwistyPrefab", "StinkyCheeseManPrefab" })))
			{
				if (((Object)items.spawnPrefab).name == item6)
				{
					Plugin.cheeseHash.Add(items);
				}
			}
			foreach (string item7 in MelanieCookedConfig.boomList.Value.Split(new char[1] { ',' }).Concat(new <>z__ReadOnlySingleElementList<string>("Gazpacho")))
			{
				if (((Object)items.spawnPrefab).name == item7)
				{
					Plugin.boomHash.Add(items);
				}
			}
		}
	}

	[HarmonyPostfix]
	[HarmonyPatch(typeof(TimeOfDay), "OnHourChanged")]
	private static void HourPatch()
	{
		//IL_0067: Unknown result type (might be due to invalid IL or missing references)
		//IL_0080: Unknown result type (might be due to invalid IL or missing references)
		//IL_0094: Unknown result type (might be due to invalid IL or missing references)
		//IL_00bc: Unknown result type (might be due to invalid IL or missing references)
		//IL_00c1: Unknown result type (might be due to invalid IL or missing references)
		//IL_00e2: Unknown result type (might be due to invalid IL or missing references)
		//IL_0176: Unknown result type (might be due to invalid IL or missing references)
		//IL_018f: Unknown result type (might be due to invalid IL or missing references)
		//IL_01a3: 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_01f1: Unknown result type (might be due to invalid IL or missing references)
		//IL_0285: Unknown result type (might be due to invalid IL or missing references)
		//IL_029e: Unknown result type (might be due to invalid IL or missing references)
		//IL_02b2: Unknown result type (might be due to invalid IL or missing references)
		//IL_02da: Unknown result type (might be due to invalid IL or missing references)
		//IL_02df: Unknown result type (might be due to invalid IL or missing references)
		//IL_0300: Unknown result type (might be due to invalid IL or missing references)
		if (GameNetworkManager.Instance.isHostingGame)
		{
			GameObject val = GameObject.Find("PlotCarrot0Spawn");
			if ((Object)(object)val != (Object)null && Random.Range(0, 99) < MelanieCookedConfig.carrotGrow.Value)
			{
				GameObject val2 = Object.Instantiate<GameObject>(Plugin.itemList.itemsList[1].spawnPrefab, val.transform.position, new Quaternion(0f, 0f, 0f, 0f));
				Transform transform = val2.transform;
				transform.localPosition += new Vector3(Random.Range(-0.3f, 0.3f), 0f, Random.Range(-0.3f, 0.3f));
				val2.transform.localEulerAngles = new Vector3(-90f, 0f, 0f);
				val2.GetComponent<NetworkObject>().Spawn(false);
				val2.GetComponent<GrabbableObject>().SetScrapValue(Random.Range(MelanieCookedConfig.carrotMin.Value, MelanieCookedConfig.carrotMax.Value));
			}
			GameObject val3 = GameObject.Find("PlotPotato0Spawn");
			if ((Object)(object)val3 != (Object)null && Random.Range(0, 99) < MelanieCookedConfig.potatoGrow.Value)
			{
				GameObject val4 = Object.Instantiate<GameObject>(Plugin.itemList.itemsList[5].spawnPrefab, val3.transform.position, new Quaternion(0f, 0f, 0f, 0f));
				Transform transform2 = val4.transform;
				transform2.localPosition += new Vector3(Random.Range(-0.3f, 0.3f), 0f, Random.Range(-0.3f, 0.3f));
				val4.transform.localEulerAngles = new Vector3(-90f, 0f, 0f);
				val4.GetComponent<NetworkObject>().Spawn(false);
				val4.GetComponent<GrabbableObject>().SetScrapValue(Random.Range(MelanieCookedConfig.potatoMin.Value, MelanieCookedConfig.potatoMax.Value));
			}
			GameObject val5 = GameObject.Find("PlotWheat0Spawn");
			if ((Object)(object)val5 != (Object)null && Random.Range(0, 99) < MelanieCookedConfig.wheatGrow.Value)
			{
				GameObject val6 = Object.Instantiate<GameObject>(Plugin.itemList.itemsList[6].spawnPrefab, val5.transform.position, new Quaternion(0f, 0f, 0f, 0f));
				Transform transform3 = val6.transform;
				transform3.localPosition += new Vector3(Random.Range(-0.3f, 0.3f), 0f, Random.Range(-0.3f, 0.3f));
				val6.transform.localEulerAngles = new Vector3(-90f, 0f, 0f);
				val6.GetComponent<NetworkObject>().Spawn(false);
				val6.GetComponent<GrabbableObject>().SetScrapValue(Random.Range(MelanieCookedConfig.wheatMin.Value, MelanieCookedConfig.wheatMax.Value));
			}
		}
	}

	[HarmonyPostfix]
	[HarmonyPatch(typeof(GameNetworkManager), "Start")]
	private static void NetworkPatch(ref GameNetworkManager __instance)
	{
		((Component)__instance).GetComponent<NetworkManager>().AddNetworkPrefab(Plugin.unlockList.unlockables[0].prefabObject);
		((Component)__instance).GetComponent<NetworkManager>().AddNetworkPrefab(Plugin.unlockList.unlockables[1].prefabObject);
		((Component)__instance).GetComponent<NetworkManager>().AddNetworkPrefab(Plugin.unlockList.unlockables[3].prefabObject);
		((Component)__instance).GetComponent<NetworkManager>().AddNetworkPrefab(Plugin.unlockList.unlockables[6].prefabObject);
		((Component)__instance).GetComponent<NetworkManager>().AddNetworkPrefab(Plugin.unlockList.unlockables[8].prefabObject);
	}
}
internal static class MelanieCookedConfig
{
	internal static ConfigEntry<int> grinder0Cost;

	internal static ConfigEntry<int> crockpot0Cost;

	internal static ConfigEntry<int> oven0Cost;

	internal static ConfigEntry<int> oven1Cost;

	internal static ConfigEntry<int> grill0Cost;

	internal static ConfigEntry<int> fridge0Cost;

	internal static ConfigEntry<int> plotCarrot0Cost;

	internal static ConfigEntry<int> plotPotato0Cost;

	internal static ConfigEntry<int> plotWheat0Cost;

	internal static ConfigEntry<int> carrotGrow;

	internal static ConfigEntry<int> potatoGrow;

	internal static ConfigEntry<int> wheatGrow;

	internal static ConfigEntry<float> cookRange0;

	internal static ConfigEntry<float> cookRange1;

	internal static ConfigEntry<int> meatMin;

	internal static ConfigEntry<int> meatMax;

	internal static ConfigEntry<int> carrotMin;

	internal static ConfigEntry<int> carrotMax;

	internal static ConfigEntry<int> potatoMin;

	internal static ConfigEntry<int> potatoMax;

	internal static ConfigEntry<int> wheatMin;

	internal static ConfigEntry<int> wheatMax;

	internal static ConfigEntry<string> meatGrind;

	internal static ConfigEntry<string> meatGoop;

	internal static ConfigEntry<string> meatList;

	internal static ConfigEntry<string> veggieList;

	internal static ConfigEntry<string> grainList;

	internal static ConfigEntry<string> cheeseList;

	internal static ConfigEntry<string> boomList;

	internal static void SetupConfig(ConfigFile config)
	{
		grinder0Cost = config.Bind<int>("Prices", "Meat Grinder", 120, "Modify the price for the meat grinder.");
		crockpot0Cost = config.Bind<int>("Prices", "Crockpot", 100, "Modify the price for the crockpot.");
		oven0Cost = config.Bind<int>("Prices", "Mini Oven", 100, "Modify the price for the mini oven.");
		oven1Cost = config.Bind<int>("Prices", "Oven", 200, "Modify the price for the oven.");
		grill0Cost = config.Bind<int>("Prices", "Mini Grill", 100, "Modify the price for the grill.");
		fridge0Cost = config.Bind<int>("Prices", "Fridge", 120, "Modify the price for the fridge.");
		plotCarrot0Cost = config.Bind<int>("Prices", "Carrot Plot", 100, "Modify the price for carrot plots.");
		plotPotato0Cost = config.Bind<int>("Prices", "Potato Plot", 100, "Modify the price for potato plots.");
		plotWheat0Cost = config.Bind<int>("Prices", "Wheat Plot", 100, "Modify the price for wheat plots.");
		carrotGrow = config.Bind<int>("Growth Chance", "Carrot", 10, "Modify the chance for carrots to progress growing phase per hour.");
		potatoGrow = config.Bind<int>("Growth Chance", "Potato", 15, "Modify the chance for potatoes to progress growing phase per hour.");
		wheatGrow = config.Bind<int>("Growth Chance", "Wheat", 20, "Modify the chance for wheat to progress growing phase per hour.");
		cookRange0 = config.Bind<float>("Item Value", "Cooking Value Minimum", 10f, "Directly change the first random range value (usually minimum) for how much value is added when cooking.");
		cookRange1 = config.Bind<float>("Item Value", "Cooking Value Maximum MULTIPLIER", 0.25f, "Change the multiplier applied to the second random range value (usually maximum) applied to a copy of total dish value.");
		meatMin = config.Bind<int>("Item Value", "Meat Value Minumum", 0, "Change the minimum value ADDED to items turned to meat.");
		meatMax = config.Bind<int>("Item Value", "Meat Value Maximum", 30, "Change the maximum value ADDED to items turned to meat.");
		carrotMin = config.Bind<int>("Item Value", "Carrot Value Minumum", 5, "Change the minimum value of grown carrots.");
		carrotMax = config.Bind<int>("Item Value", "Carrot Value Maximum", 30, "Change the maximum value of grown carrots.");
		potatoMin = config.Bind<int>("Item Value", "Potato Value Minumum", 5, "Change the minimum value of grown potatoes.");
		potatoMax = config.Bind<int>("Item Value", "Potato Value Maximum", 25, "Change the maximum value of grown potatoes.");
		wheatMin = config.Bind<int>("Item Value", "Wheat Value Minumum", 5, "Change the minimum value of grown wheat.");
		wheatMax = config.Bind<int>("Item Value", "Wheat Value Maximum", 20, "Change the maximum value of grown wheat.");
		meatGrind = config.Bind<string>("Custom Ingredients", "Grind to Meat", "Example0,Example1", "Add more items to be ground into meat! (Use PREFAB name; not always the same as item name)");
		meatGoop = config.Bind<string>("Custom Ingredients", "Cook to Imitation Meat", "Example0,Example1", "Add more items to be cooked into imitation meat! (Use PREFAB name; not always the same as item name)");
		meatList = config.Bind<string>("Custom Ingredients", "Cook as Meat", "Example0,Example1", "Add more items to be considered meat ingredients! (Use PREFAB name; not always the same as item name)");
		veggieList = config.Bind<string>("Custom Ingredients", "Cook as Veggie", "Example0,Example1", "Add more items to be considered veggie ingredients! (Use PREFAB name; not always the same as item name)");
		grainList = config.Bind<string>("Custom Ingredients", "Cook as Grain", "Example0,Example1", "Add more items to be considered grain ingredients! (Use PREFAB name; not always the same as item name)");
		cheeseList = config.Bind<string>("Custom Ingredients", "Cook as Cheese", "Example0,Example1", "Add more items to be considered cheese ingredients! (Use PREFAB name; not always the same as item name)");
		boomList = config.Bind<string>("Custom Ingredients", "Cook to Explode", "Example0,Example1", "Add more items to explode when cooked! (Use PREFAB name; not always the same as item name)");
	}
}
namespace MelanieMeliciousCooked
{
	public class ItemManager : NetworkBehaviour
	{
		[CompilerGenerated]
		private sealed class <Boom>d__5 : IEnumerator<object>, IDisposable, IEnumerator
		{
			private int <>1__state;

			private object <>2__current;

			public Vector3 position;

			public ItemManager <>4__this;

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

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

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

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

			private bool MoveNext()
			{
				//IL_0026: Unknown result type (might be due to invalid IL or missing references)
				//IL_0030: Expected O, but got Unknown
				//IL_0041: Unknown result type (might be due to invalid IL or missing references)
				switch (<>1__state)
				{
				default:
					return false;
				case 0:
					<>1__state = -1;
					<>2__current = (object)new WaitForSeconds(2f);
					<>1__state = 1;
					return true;
				case 1:
					<>1__state = -1;
					Landmine.SpawnExplosion(position, true, 1f, 5f, 50, 0f, (GameObject)null, false);
					return false;
				}
			}

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

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

		public Transform oldParent;

		public Transform newParent;

		public char cookType;

		public void Parent(PlayerControllerB playerWhoTriggered)
		{
			if (!((NetworkBehaviour)this).IsServer)
			{
				((Component)this).GetComponent<PlaceableObjectsSurface>().PlaceObject(playerWhoTriggered);
			}
			GrabbableObject currentlyHeldObjectServer = playerWhoTriggered.currentlyHeldObjectServer;
			char c = cookType;
			char c2 = c;
			if (c2 != '0')
			{
				return;
			}
			if (Plugin.bodyHash.Contains(currentlyHeldObjectServer.itemProperties) || ((Object)currentlyHeldObjectServer).name == "RagdollGrabbableObject(Clone)" || ((Object)currentlyHeldObjectServer).name == "CaveDwellerEnemy")
			{
				((Component)currentlyHeldObjectServer).transform.parent = oldParent;
				SpawnItemServerRpc(0, Random.Range(((Component)playerWhoTriggered.currentlyHeldObjectServer).GetComponent<GrabbableObject>().scrapValue + MelanieCookedConfig.meatMin.Value, ((Component)playerWhoTriggered.currentlyHeldObjectServer).GetComponent<GrabbableObject>().scrapValue + MelanieCookedConfig.meatMax.Value), ((Object)currentlyHeldObjectServer).name);
				if (((NetworkBehaviour)this).IsServer)
				{
					((Component)this).GetComponent<PlaceableObjectsSurface>().PlaceObject(playerWhoTriggered);
				}
			}
			else if (((Object)currentlyHeldObjectServer).name.StartsWith("Wheat0"))
			{
				((Component)currentlyHeldObjectServer).transform.parent = oldParent;
				SpawnItemServerRpc(7, Random.Range(((Component)playerWhoTriggered.currentlyHeldObjectServer).GetComponent<GrabbableObject>().scrapValue, ((Component)playerWhoTriggered.currentlyHeldObjectServer).GetComponent<GrabbableObject>().scrapValue + 30), ((Object)currentlyHeldObjectServer).name);
				if (((NetworkBehaviour)this).IsServer)
				{
					((Component)this).GetComponent<PlaceableObjectsSurface>().PlaceObject(playerWhoTriggered);
				}
			}
		}

		public void Cook()
		{
			//IL_0051: Unknown result type (might be due to invalid IL or missing references)
			//IL_0058: Expected O, but got Unknown
			//IL_023a: Unknown result type (might be due to invalid IL or missing references)
			//IL_0246: Unknown result type (might be due to invalid IL or missing references)
			//IL_0252: Unknown result type (might be due to invalid IL or missing references)
			string[] array = new string[4] { "", "", "", "" };
			int num = 0;
			ushort num2 = 0;
			ushort num3 = 0;
			ushort num4 = 0;
			ushort num5 = 0;
			ushort num6 = 0;
			foreach (Transform item in oldParent)
			{
				Transform val = item;
				if (num6 >= 4)
				{
					continue;
				}
				GrabbableObject component = ((Component)val).GetComponent<GrabbableObject>();
				if ((Object)(object)component != (Object)null)
				{
					if (Plugin.goopHash.Contains(component.itemProperties))
					{
						SpawnItemServerRpc(12, Random.Range(((Component)val).gameObject.GetComponent<GrabbableObject>().scrapValue + MelanieCookedConfig.meatMin.Value, ((Component)val).gameObject.GetComponent<GrabbableObject>().scrapValue + MelanieCookedConfig.meatMax.Value), ((Object)val).name);
					}
					else if (Plugin.meatHash.Contains(component.itemProperties))
					{
						array[num6] = ((Object)val).name;
						num += ((Component)val).gameObject.GetComponent<GrabbableObject>().scrapValue;
						num2++;
						num6++;
					}
					else if (Plugin.veggieHash.Contains(component.itemProperties))
					{
						array[num6] = ((Object)val).name;
						num += ((Component)val).gameObject.GetComponent<GrabbableObject>().scrapValue;
						num3++;
						num6++;
					}
					else if (Plugin.grainHash.Contains(component.itemProperties))
					{
						array[num6] = ((Object)val).name;
						num += ((Component)val).gameObject.GetComponent<GrabbableObject>().scrapValue;
						num4++;
						num6++;
					}
					else if (Plugin.cheeseHash.Contains(component.itemProperties))
					{
						array[num6] = ((Object)val).name;
						num += ((Component)val).gameObject.GetComponent<GrabbableObject>().scrapValue;
						num5++;
						num6++;
					}
					else if (Plugin.boomHash.Contains(component.itemProperties))
					{
						BoomServerRpc(val.position.x, val.position.y, val.position.z);
					}
				}
			}
			switch (cookType)
			{
			case '0':
				if (num2 > 1 && num6 == 4)
				{
					SpawnItemServerRpc(3, num + (int)Random.Range(MelanieCookedConfig.cookRange0.Value, (float)num * MelanieCookedConfig.cookRange1.Value), array[0], array[1], array[2], array[3]);
				}
				else if (num3 > 2)
				{
					SpawnItemServerRpc(2, num + (int)Random.Range(MelanieCookedConfig.cookRange0.Value, (float)num * MelanieCookedConfig.cookRange1.Value), array[0], array[1], array[2], array[3]);
				}
				break;
			case '1':
				if (num2 == 1 && num3 == 1 && num4 == 1)
				{
					SpawnItemServerRpc(9, num + (int)Random.Range(MelanieCookedConfig.cookRange0.Value, (float)num * MelanieCookedConfig.cookRange1.Value), array[0], array[1], array[2], array[3]);
				}
				else if (num2 > 2 || (num2 > 0 && num3 > 1))
				{
					SpawnItemServerRpc(4, num + (int)Random.Range(MelanieCookedConfig.cookRange0.Value, (float)num * MelanieCookedConfig.cookRange1.Value), array[0], array[1], array[2], array[3]);
				}
				else if (num4 > 2)
				{
					SpawnItemServerRpc(8, num + (int)Random.Range(MelanieCookedConfig.cookRange0.Value, (float)num * MelanieCookedConfig.cookRange1.Value), array[0], array[1], array[2], array[3]);
				}
				break;
			case '2':
				if (num2 > 0 && num3 > 0 && num4 > 0)
				{
					switch (num6)
					{
					case 3:
						SpawnItemServerRpc(10, (num + (int)Random.Range(MelanieCookedConfig.cookRange0.Value, (float)num * MelanieCookedConfig.cookRange1.Value)) / 2, array[0], array[1], array[2], array[3]);
						SpawnItemServerRpc(10, (num + (int)Random.Range(MelanieCookedConfig.cookRange0.Value, (float)num * MelanieCookedConfig.cookRange1.Value)) / 2);
						break;
					case 4:
						SpawnItemServerRpc(11, num + (int)Random.Range(MelanieCookedConfig.cookRange0.Value, (float)num * MelanieCookedConfig.cookRange1.Value), array[0], array[1], array[2], array[3]);
						break;
					}
				}
				if (num4 > 0 && num5 > 0 && num6 == num4 + num5)
				{
					SpawnItemServerRpc(13, num + (int)Random.Range(MelanieCookedConfig.cookRange0.Value, (float)num * MelanieCookedConfig.cookRange1.Value), array[0], array[1], array[2], array[3]);
				}
				break;
			}
		}

		[IteratorStateMachine(typeof(<Boom>d__5))]
		private IEnumerator Boom(Vector3 position)
		{
			//IL_000e: Unknown result type (might be due to invalid IL or missing references)
			//IL_000f: Unknown result type (might be due to invalid IL or missing references)
			//yield-return decompiler failed: Unexpected instruction in Iterator.Dispose()
			return new <Boom>d__5(0)
			{
				<>4__this = this,
				position = position
			};
		}

		[ServerRpc(RequireOwnership = false)]
		public void BoomServerRpc(float x, float y, float z)
		{
			//IL_0024: Unknown result type (might be due to invalid IL or missing references)
			//IL_002e: Invalid comparison between Unknown and I4
			//IL_00dd: Unknown result type (might be due to invalid IL or missing references)
			//IL_00e7: Invalid comparison between Unknown and I4
			//IL_005f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0068: Unknown result type (might be due to invalid IL or missing references)
			//IL_006d: Unknown result type (might be due to invalid IL or missing references)
			//IL_007d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0083: Unknown result type (might be due to invalid IL or missing references)
			//IL_0098: Unknown result type (might be due to invalid IL or missing references)
			//IL_009e: Unknown result type (might be due to invalid IL or missing references)
			//IL_00b3: Unknown result type (might be due to invalid IL or missing references)
			//IL_00b9: Unknown result type (might be due to invalid IL or missing references)
			//IL_00cd: Unknown result type (might be due to invalid IL or missing references)
			NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager;
			if (networkManager != null && networkManager.IsListening)
			{
				if ((int)base.__rpc_exec_stage != 1 && (networkManager.IsClient || networkManager.IsHost))
				{
					ServerRpcParams val = default(ServerRpcParams);
					FastBufferWriter val2 = ((NetworkBehaviour)this).__beginSendServerRpc(1490214566u, val, (RpcDelivery)0);
					((FastBufferWriter)(ref val2)).WriteValueSafe<float>(ref x, default(ForPrimitives));
					((FastBufferWriter)(ref val2)).WriteValueSafe<float>(ref y, default(ForPrimitives));
					((FastBufferWriter)(ref val2)).WriteValueSafe<float>(ref z, default(ForPrimitives));
					((NetworkBehaviour)this).__endSendServerRpc(ref val2, 1490214566u, val, (RpcDelivery)0);
				}
				if ((int)base.__rpc_exec_stage == 1 && (networkManager.IsServer || networkManager.IsHost))
				{
					BoomClientRpc(x, y, z);
				}
			}
		}

		[ClientRpc]
		public void BoomClientRpc(float x, float y, float z)
		{
			//IL_0024: Unknown result type (might be due to invalid IL or missing references)
			//IL_002e: Invalid comparison between Unknown and I4
			//IL_00dd: Unknown result type (might be due to invalid IL or missing references)
			//IL_00e7: Invalid comparison between Unknown and I4
			//IL_005f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0068: Unknown result type (might be due to invalid IL or missing references)
			//IL_006d: Unknown result type (might be due to invalid IL or missing references)
			//IL_007d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0083: Unknown result type (might be due to invalid IL or missing references)
			//IL_0098: Unknown result type (might be due to invalid IL or missing references)
			//IL_009e: Unknown result type (might be due to invalid IL or missing references)
			//IL_00b3: Unknown result type (might be due to invalid IL or missing references)
			//IL_00b9: Unknown result type (might be due to invalid IL or missing references)
			//IL_00cd: Unknown result type (might be due to invalid IL or missing references)
			//IL_011f: Unknown result type (might be due to invalid IL or missing references)
			//IL_012f: Unknown result type (might be due to invalid IL or missing references)
			NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager;
			if (networkManager != null && networkManager.IsListening)
			{
				if ((int)base.__rpc_exec_stage != 2 && (networkManager.IsServer || networkManager.IsHost))
				{
					ClientRpcParams val = default(ClientRpcParams);
					FastBufferWriter val2 = ((NetworkBehaviour)this).__beginSendClientRpc(1220024282u, val, (RpcDelivery)0);
					((FastBufferWriter)(ref val2)).WriteValueSafe<float>(ref x, default(ForPrimitives));
					((FastBufferWriter)(ref val2)).WriteValueSafe<float>(ref y, default(ForPrimitives));
					((FastBufferWriter)(ref val2)).WriteValueSafe<float>(ref z, default(ForPrimitives));
					((NetworkBehaviour)this).__endSendClientRpc(ref val2, 1220024282u, val, (RpcDelivery)0);
				}
				if ((int)base.__rpc_exec_stage == 2 && (networkManager.IsClient || networkManager.IsHost))
				{
					AudioSource.PlayClipAtPoint(Plugin.bundle.LoadAsset<AudioClip>("Assets/MelanieCooked/Audio/spanishsound.ogg"), new Vector3(x, y, z));
					((MonoBehaviour)this).StartCoroutine(Boom(new Vector3(x, y, z)));
				}
			}
		}

		[ServerRpc(RequireOwnership = false)]
		public void SpawnItemServerRpc(int itemList, int dishValue, string delete0 = "", string delete1 = "", string delete2 = "", string delete3 = "")
		{
			//IL_02eb: Unknown result type (might be due to invalid IL or missing references)
			//IL_0024: Unknown result type (might be due to invalid IL or missing references)
			//IL_002e: Invalid comparison between Unknown and I4
			//IL_019e: Unknown result type (might be due to invalid IL or missing references)
			//IL_01a8: Invalid comparison between Unknown and I4
			//IL_005f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0068: Unknown result type (might be due to invalid IL or missing references)
			//IL_006d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0071: Unknown result type (might be due to invalid IL or missing references)
			//IL_007e: Unknown result type (might be due to invalid IL or missing references)
			//IL_00a2: Unknown result type (might be due to invalid IL or missing references)
			//IL_00a8: Unknown result type (might be due to invalid IL or missing references)
			//IL_0203: Unknown result type (might be due to invalid IL or missing references)
			//IL_020e: Unknown result type (might be due to invalid IL or missing references)
			//IL_00e0: Unknown result type (might be due to invalid IL or missing references)
			//IL_00e6: Unknown result type (might be due to invalid IL or missing references)
			//IL_011e: Unknown result type (might be due to invalid IL or missing references)
			//IL_0124: 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_0162: Unknown result type (might be due to invalid IL or missing references)
			//IL_018e: Unknown result type (might be due to invalid IL or missing references)
			//IL_0269: Unknown result type (might be due to invalid IL or missing references)
			//IL_0270: Expected O, but got Unknown
			NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager;
			if (networkManager == null || !networkManager.IsListening)
			{
				return;
			}
			if ((int)base.__rpc_exec_stage != 1 && (networkManager.IsClient || networkManager.IsHost))
			{
				ServerRpcParams val = default(ServerRpcParams);
				FastBufferWriter val2 = ((NetworkBehaviour)this).__beginSendServerRpc(828491791u, val, (RpcDelivery)0);
				BytePacker.WriteValueBitPacked(val2, itemList);
				BytePacker.WriteValueBitPacked(val2, dishValue);
				bool flag = delete0 != null;
				((FastBufferWriter)(ref val2)).WriteValueSafe<bool>(ref flag, default(ForPrimitives));
				if (flag)
				{
					((FastBufferWriter)(ref val2)).WriteValueSafe(delete0, false);
				}
				bool flag2 = delete1 != null;
				((FastBufferWriter)(ref val2)).WriteValueSafe<bool>(ref flag2, default(ForPrimitives));
				if (flag2)
				{
					((FastBufferWriter)(ref val2)).WriteValueSafe(delete1, false);
				}
				bool flag3 = delete2 != null;
				((FastBufferWriter)(ref val2)).WriteValueSafe<bool>(ref flag3, default(ForPrimitives));
				if (flag3)
				{
					((FastBufferWriter)(ref val2)).WriteValueSafe(delete2, false);
				}
				bool flag4 = delete3 != null;
				((FastBufferWriter)(ref val2)).WriteValueSafe<bool>(ref flag4, default(ForPrimitives));
				if (flag4)
				{
					((FastBufferWriter)(ref val2)).WriteValueSafe(delete3, false);
				}
				((NetworkBehaviour)this).__endSendServerRpc(ref val2, 828491791u, val, (RpcDelivery)0);
			}
			if ((int)base.__rpc_exec_stage != 1 || (!networkManager.IsServer && !networkManager.IsHost))
			{
				return;
			}
			string[] array = new string[4] { delete0, delete1, delete2, delete3 };
			GameObject val3 = Object.Instantiate<GameObject>(Plugin.itemList.itemsList[itemList].spawnPrefab, newParent.position, newParent.rotation, RoundManager.Instance.spawnedScrapContainer);
			val3.GetComponent<NetworkObject>().Spawn(false);
			val3.GetComponent<GrabbableObject>().SetScrapValue(dishValue);
			try
			{
				string[] array2 = array;
				foreach (string text in array2)
				{
					bool flag5 = false;
					foreach (Transform item in oldParent)
					{
						Transform val4 = item;
						if (!flag5 && ((Object)val4).name == text)
						{
							((Object)val4).name = "delete";
							Object.Destroy((Object)(object)((Component)val4).gameObject);
							flag5 = true;
						}
					}
				}
			}
			catch
			{
			}
			DeleteItemClientRpc(NetworkObjectReference.op_Implicit(val3.GetComponent<NetworkObject>()), dishValue, delete0, delete1, delete2, delete3);
		}

		[ClientRpc]
		public void DeleteItemClientRpc(NetworkObjectReference netObjectRef, int dishValue, string delete0 = "", string delete1 = "", string delete2 = "", string delete3 = "")
		{
			//IL_0024: Unknown result type (might be due to invalid IL or missing references)
			//IL_002e: Invalid comparison between Unknown and I4
			//IL_01ac: Unknown result type (might be due to invalid IL or missing references)
			//IL_01b6: Invalid comparison between Unknown and I4
			//IL_005f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0068: Unknown result type (might be due to invalid IL or missing references)
			//IL_006d: Unknown result type (might be due to invalid IL or missing references)
			//IL_007d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0083: Unknown result type (might be due to invalid IL or missing references)
			//IL_008c: Unknown result type (might be due to invalid IL or missing references)
			//IL_00b0: Unknown result type (might be due to invalid IL or missing references)
			//IL_00b6: Unknown result type (might be due to invalid IL or missing references)
			//IL_00ee: Unknown result type (might be due to invalid IL or missing references)
			//IL_00f4: Unknown result type (might be due to invalid IL or missing references)
			//IL_012c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0132: 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_0170: Unknown result type (might be due to invalid IL or missing references)
			//IL_019c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0233: Unknown result type (might be due to invalid IL or missing references)
			//IL_023a: Expected O, but got Unknown
			NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager;
			if (networkManager == null || !networkManager.IsListening)
			{
				return;
			}
			if ((int)base.__rpc_exec_stage != 2 && (networkManager.IsServer || networkManager.IsHost))
			{
				ClientRpcParams val = default(ClientRpcParams);
				FastBufferWriter val2 = ((NetworkBehaviour)this).__beginSendClientRpc(2178165484u, val, (RpcDelivery)0);
				((FastBufferWriter)(ref val2)).WriteValueSafe<NetworkObjectReference>(ref netObjectRef, default(ForNetworkSerializable));
				BytePacker.WriteValueBitPacked(val2, dishValue);
				bool flag = delete0 != null;
				((FastBufferWriter)(ref val2)).WriteValueSafe<bool>(ref flag, default(ForPrimitives));
				if (flag)
				{
					((FastBufferWriter)(ref val2)).WriteValueSafe(delete0, false);
				}
				bool flag2 = delete1 != null;
				((FastBufferWriter)(ref val2)).WriteValueSafe<bool>(ref flag2, default(ForPrimitives));
				if (flag2)
				{
					((FastBufferWriter)(ref val2)).WriteValueSafe(delete1, false);
				}
				bool flag3 = delete2 != null;
				((FastBufferWriter)(ref val2)).WriteValueSafe<bool>(ref flag3, default(ForPrimitives));
				if (flag3)
				{
					((FastBufferWriter)(ref val2)).WriteValueSafe(delete2, false);
				}
				bool flag4 = delete3 != null;
				((FastBufferWriter)(ref val2)).WriteValueSafe<bool>(ref flag4, default(ForPrimitives));
				if (flag4)
				{
					((FastBufferWriter)(ref val2)).WriteValueSafe(delete3, false);
				}
				((NetworkBehaviour)this).__endSendClientRpc(ref val2, 2178165484u, val, (RpcDelivery)0);
			}
			if ((int)base.__rpc_exec_stage != 2 || (!networkManager.IsClient && !networkManager.IsHost) || ((NetworkBehaviour)this).IsServer)
			{
				return;
			}
			try
			{
				string[] array = new string[4] { delete0, delete1, delete2, delete3 };
				string[] array2 = array;
				foreach (string text in array2)
				{
					bool flag5 = false;
					foreach (Transform item in oldParent)
					{
						Transform val3 = item;
						if (!flag5 && ((Object)val3).name == text)
						{
							((Object)val3).name = "delete";
							Object.Destroy((Object)(object)((Component)val3).gameObject);
							flag5 = true;
						}
					}
				}
			}
			catch
			{
			}
		}

		protected override void __initializeVariables()
		{
			((NetworkBehaviour)this).__initializeVariables();
		}

		[RuntimeInitializeOnLoadMethod]
		internal static void InitializeRPCS_ItemManager()
		{
			//IL_0011: Unknown result type (might be due to invalid IL or missing references)
			//IL_001b: Expected O, but got Unknown
			//IL_002c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0036: Expected O, but got Unknown
			//IL_0047: Unknown result type (might be due to invalid IL or missing references)
			//IL_0051: Expected O, but got Unknown
			//IL_0062: Unknown result type (might be due to invalid IL or missing references)
			//IL_006c: Expected O, but got Unknown
			NetworkManager.__rpc_func_table.Add(1490214566u, new RpcReceiveHandler(__rpc_handler_1490214566));
			NetworkManager.__rpc_func_table.Add(1220024282u, new RpcReceiveHandler(__rpc_handler_1220024282));
			NetworkManager.__rpc_func_table.Add(828491791u, new RpcReceiveHandler(__rpc_handler_828491791));
			NetworkManager.__rpc_func_table.Add(2178165484u, new RpcReceiveHandler(__rpc_handler_2178165484));
		}

		private static void __rpc_handler_1490214566(NetworkBehaviour target, FastBufferReader reader, __RpcParams rpcParams)
		{
			//IL_002f: 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)
			//IL_004a: Unknown result type (might be due to invalid IL or missing references)
			//IL_0050: Unknown result type (might be due to invalid IL or missing references)
			//IL_0065: Unknown result type (might be due to invalid IL or missing references)
			//IL_006b: Unknown result type (might be due to invalid IL or missing references)
			//IL_007a: Unknown result type (might be due to invalid IL or missing references)
			//IL_009c: Unknown result type (might be due to invalid IL or missing references)
			NetworkManager networkManager = target.NetworkManager;
			if (networkManager != null && networkManager.IsListening)
			{
				float x = default(float);
				((FastBufferReader)(ref reader)).ReadValueSafe<float>(ref x, default(ForPrimitives));
				float y = default(float);
				((FastBufferReader)(ref reader)).ReadValueSafe<float>(ref y, default(ForPrimitives));
				float z = default(float);
				((FastBufferReader)(ref reader)).ReadValueSafe<float>(ref z, default(ForPrimitives));
				target.__rpc_exec_stage = (__RpcExecStage)1;
				((ItemManager)(object)target).BoomServerRpc(x, y, z);
				target.__rpc_exec_stage = (__RpcExecStage)0;
			}
		}

		private static void __rpc_handler_1220024282(NetworkBehaviour target, FastBufferReader reader, __RpcParams rpcParams)
		{
			//IL_002f: 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)
			//IL_004a: Unknown result type (might be due to invalid IL or missing references)
			//IL_0050: Unknown result type (might be due to invalid IL or missing references)
			//IL_0065: Unknown result type (might be due to invalid IL or missing references)
			//IL_006b: Unknown result type (might be due to invalid IL or missing references)
			//IL_007a: Unknown result type (might be due to invalid IL or missing references)
			//IL_009c: Unknown result type (might be due to invalid IL or missing references)
			NetworkManager networkManager = target.NetworkManager;
			if (networkManager != null && networkManager.IsListening)
			{
				float x = default(float);
				((FastBufferReader)(ref reader)).ReadValueSafe<float>(ref x, default(ForPrimitives));
				float y = default(float);
				((FastBufferReader)(ref reader)).ReadValueSafe<float>(ref y, default(ForPrimitives));
				float z = default(float);
				((FastBufferReader)(ref reader)).ReadValueSafe<float>(ref z, default(ForPrimitives));
				target.__rpc_exec_stage = (__RpcExecStage)2;
				((ItemManager)(object)target).BoomClientRpc(x, y, z);
				target.__rpc_exec_stage = (__RpcExecStage)0;
			}
		}

		private static void __rpc_handler_828491791(NetworkBehaviour target, FastBufferReader reader, __RpcParams rpcParams)
		{
			//IL_0023: Unknown result type (might be due to invalid IL or missing references)
			//IL_0030: Unknown result type (might be due to invalid IL or missing references)
			//IL_0049: Unknown result type (might be due to invalid IL or missing references)
			//IL_004f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0081: Unknown result type (might be due to invalid IL or missing references)
			//IL_0087: Unknown result type (might be due to invalid IL or missing references)
			//IL_00b9: Unknown result type (might be due to invalid IL or missing references)
			//IL_00bf: Unknown result type (might be due to invalid IL or missing references)
			//IL_00f1: Unknown result type (might be due to invalid IL or missing references)
			//IL_00f7: Unknown result type (might be due to invalid IL or missing references)
			//IL_0123: Unknown result type (might be due to invalid IL or missing references)
			//IL_0151: Unknown result type (might be due to invalid IL or missing references)
			NetworkManager networkManager = target.NetworkManager;
			if (networkManager != null && networkManager.IsListening)
			{
				int itemList = default(int);
				ByteUnpacker.ReadValueBitPacked(reader, ref itemList);
				int dishValue = default(int);
				ByteUnpacker.ReadValueBitPacked(reader, ref dishValue);
				bool flag = default(bool);
				((FastBufferReader)(ref reader)).ReadValueSafe<bool>(ref flag, default(ForPrimitives));
				string delete = null;
				if (flag)
				{
					((FastBufferReader)(ref reader)).ReadValueSafe(ref delete, false);
				}
				bool flag2 = default(bool);
				((FastBufferReader)(ref reader)).ReadValueSafe<bool>(ref flag2, default(ForPrimitives));
				string delete2 = null;
				if (flag2)
				{
					((FastBufferReader)(ref reader)).ReadValueSafe(ref delete2, false);
				}
				bool flag3 = default(bool);
				((FastBufferReader)(ref reader)).ReadValueSafe<bool>(ref flag3, default(ForPrimitives));
				string delete3 = null;
				if (flag3)
				{
					((FastBufferReader)(ref reader)).ReadValueSafe(ref delete3, false);
				}
				bool flag4 = default(bool);
				((FastBufferReader)(ref reader)).ReadValueSafe<bool>(ref flag4, default(ForPrimitives));
				string delete4 = null;
				if (flag4)
				{
					((FastBufferReader)(ref reader)).ReadValueSafe(ref delete4, false);
				}
				target.__rpc_exec_stage = (__RpcExecStage)1;
				((ItemManager)(object)target).SpawnItemServerRpc(itemList, dishValue, delete, delete2, delete3, delete4);
				target.__rpc_exec_stage = (__RpcExecStage)0;
			}
		}

		private static void __rpc_handler_2178165484(NetworkBehaviour target, FastBufferReader reader, __RpcParams rpcParams)
		{
			//IL_002f: 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)
			//IL_003e: Unknown result type (might be due to invalid IL or missing references)
			//IL_0057: Unknown result type (might be due to invalid IL or missing references)
			//IL_005d: Unknown result type (might be due to invalid IL or missing references)
			//IL_008f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0095: Unknown result type (might be due to invalid IL or missing references)
			//IL_00c7: Unknown result type (might be due to invalid IL or missing references)
			//IL_00cd: Unknown result type (might be due to invalid IL or missing references)
			//IL_00ff: Unknown result type (might be due to invalid IL or missing references)
			//IL_0105: Unknown result type (might be due to invalid IL or missing references)
			//IL_0131: Unknown result type (might be due to invalid IL or missing references)
			//IL_013c: Unknown result type (might be due to invalid IL or missing references)
			//IL_015f: Unknown result type (might be due to invalid IL or missing references)
			NetworkManager networkManager = target.NetworkManager;
			if (networkManager != null && networkManager.IsListening)
			{
				NetworkObjectReference netObjectRef = default(NetworkObjectReference);
				((FastBufferReader)(ref reader)).ReadValueSafe<NetworkObjectReference>(ref netObjectRef, default(ForNetworkSerializable));
				int dishValue = default(int);
				ByteUnpacker.ReadValueBitPacked(reader, ref dishValue);
				bool flag = default(bool);
				((FastBufferReader)(ref reader)).ReadValueSafe<bool>(ref flag, default(ForPrimitives));
				string delete = null;
				if (flag)
				{
					((FastBufferReader)(ref reader)).ReadValueSafe(ref delete, false);
				}
				bool flag2 = default(bool);
				((FastBufferReader)(ref reader)).ReadValueSafe<bool>(ref flag2, default(ForPrimitives));
				string delete2 = null;
				if (flag2)
				{
					((FastBufferReader)(ref reader)).ReadValueSafe(ref delete2, false);
				}
				bool flag3 = default(bool);
				((FastBufferReader)(ref reader)).ReadValueSafe<bool>(ref flag3, default(ForPrimitives));
				string delete3 = null;
				if (flag3)
				{
					((FastBufferReader)(ref reader)).ReadValueSafe(ref delete3, false);
				}
				bool flag4 = default(bool);
				((FastBufferReader)(ref reader)).ReadValueSafe<bool>(ref flag4, default(ForPrimitives));
				string delete4 = null;
				if (flag4)
				{
					((FastBufferReader)(ref reader)).ReadValueSafe(ref delete4, false);
				}
				target.__rpc_exec_stage = (__RpcExecStage)2;
				((ItemManager)(object)target).DeleteItemClientRpc(netObjectRef, dishValue, delete, delete2, delete3, delete4);
				target.__rpc_exec_stage = (__RpcExecStage)0;
			}
		}

		protected internal override string __getTypeName()
		{
			return "ItemManager";
		}
	}
	[BepInPlugin("MelanieMelicious.FarmAndCook", "MelanieMelicious - Farming and Cooking Mod", "0.4.0")]
	[BepInDependency(/*Could not decode attribute arguments.*/)]
	public class Plugin : BaseUnityPlugin
	{
		private const string GUID = "MelanieMelicious.FarmAndCook";

		private const string NAME = "MelanieMelicious - Farming and Cooking Mod";

		private const string VERSION = "0.4.0";

		private readonly Harmony harmony = new Harmony("MelanieMelicious.FarmAndCook");

		public static ManualLogSource mls;

		public static AssetBundle bundle;

		public static UnlockablesList unlockList;

		public static AllItemsList itemList;

		public static HashSet<Item> bodyHash = new HashSet<Item>();

		public static HashSet<Item> goopHash = new HashSet<Item>();

		public static HashSet<Item> meatHash = new HashSet<Item>();

		public static HashSet<Item> veggieHash = new HashSet<Item>();

		public static HashSet<Item> grainHash = new HashSet<Item>();

		public static HashSet<Item> cheeseHash = new HashSet<Item>();

		public static HashSet<Item> boomHash = new HashSet<Item>();

		public static Plugin instance;

		private void Awake()
		{
			Type[] types = Assembly.GetExecutingAssembly().GetTypes();
			Type[] array = types;
			foreach (Type type in array)
			{
				MethodInfo[] methods = type.GetMethods(BindingFlags.Instance | BindingFlags.Static | BindingFlags.NonPublic);
				MethodInfo[] array2 = methods;
				foreach (MethodInfo methodInfo in array2)
				{
					object[] customAttributes = methodInfo.GetCustomAttributes(typeof(RuntimeInitializeOnLoadMethodAttribute), inherit: false);
					if (customAttributes.Length != 0)
					{
						methodInfo.Invoke(null, null);
					}
				}
			}
			instance = this;
			MelanieCookedConfig.SetupConfig(((BaseUnityPlugin)this).Config);
			mls = Logger.CreateLogSource("MelanieMelicious - Farming and Cooking Mod");
			mls = ((BaseUnityPlugin)this).Logger;
			harmony.PatchAll(typeof(HarmonyPatches));
			string text = Path.Combine(Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location), "melaniecooked");
			bundle = AssetBundle.LoadFromFile(text);
			unlockList = bundle.LoadAsset<UnlockablesList>("Assets/MelanieCooked/Asset/Furniture.asset");
			itemList = bundle.LoadAsset<AllItemsList>("Assets/MelanieCooked/Asset/Food.asset");
			NetworkPrefabs.RegisterNetworkPrefab(unlockList.unlockables[0].prefabObject);
			Unlockables.RegisterUnlockable(unlockList.unlockables[0], (StoreType)1, (TerminalNode)null, (TerminalNode)null, (TerminalNode)null, MelanieCookedConfig.grinder0Cost.Value);
			NetworkPrefabs.RegisterNetworkPrefab(unlockList.unlockables[1].prefabObject);
			Unlockables.RegisterUnlockable(unlockList.unlockables[1], (StoreType)1, (TerminalNode)null, (TerminalNode)null, (TerminalNode)null, MelanieCookedConfig.crockpot0Cost.Value);
			NetworkPrefabs.RegisterNetworkPrefab(unlockList.unlockables[2].prefabObject);
			Unlockables.RegisterUnlockable(unlockList.unlockables[2], (StoreType)1, (TerminalNode)null, (TerminalNode)null, (TerminalNode)null, MelanieCookedConfig.plotCarrot0Cost.Value);
			NetworkPrefabs.RegisterNetworkPrefab(unlockList.unlockables[3].prefabObject);
			Unlockables.RegisterUnlockable(unlockList.unlockables[3], (StoreType)1, (TerminalNode)null, (TerminalNode)null, (TerminalNode)null, MelanieCookedConfig.oven0Cost.Value);
			NetworkPrefabs.RegisterNetworkPrefab(unlockList.unlockables[4].prefabObject);
			Unlockables.RegisterUnlockable(unlockList.unlockables[4], (StoreType)1, (TerminalNode)null, (TerminalNode)null, (TerminalNode)null, MelanieCookedConfig.plotPotato0Cost.Value);
			NetworkPrefabs.RegisterNetworkPrefab(unlockList.unlockables[5].prefabObject);
			Unlockables.RegisterUnlockable(unlockList.unlockables[5], (StoreType)1, (TerminalNode)null, (TerminalNode)null, (TerminalNode)null, MelanieCookedConfig.plotWheat0Cost.Value);
			NetworkPrefabs.RegisterNetworkPrefab(unlockList.unlockables[6].prefabObject);
			Unlockables.RegisterUnlockable(unlockList.unlockables[6], (StoreType)1, (TerminalNode)null, (TerminalNode)null, (TerminalNode)null, MelanieCookedConfig.grill0Cost.Value);
			NetworkPrefabs.RegisterNetworkPrefab(unlockList.unlockables[7].prefabObject);
			Unlockables.RegisterUnlockable(unlockList.unlockables[7], (StoreType)1, (TerminalNode)null, (TerminalNode)null, (TerminalNode)null, MelanieCookedConfig.fridge0Cost.Value);
			NetworkPrefabs.RegisterNetworkPrefab(unlockList.unlockables[8].prefabObject);
			Unlockables.RegisterUnlockable(unlockList.unlockables[8], (StoreType)1, (TerminalNode)null, (TerminalNode)null, (TerminalNode)null, MelanieCookedConfig.oven1Cost.Value);
			foreach (Item items in itemList.itemsList)
			{
				NetworkPrefabs.RegisterNetworkPrefab(items.spawnPrefab);
				Items.RegisterItem(items);
			}
		}
	}
}
[CompilerGenerated]
internal sealed class <>z__ReadOnlyArray<T> : IEnumerable, ICollection, IList, IEnumerable<T>, IReadOnlyCollection<T>, IReadOnlyList<T>, ICollection<T>, IList<T>
{
	int ICollection.Count => _items.Length;

	bool ICollection.IsSynchronized => false;

	object ICollection.SyncRoot => this;

	object IList.this[int index]
	{
		get
		{
			return _items[index];
		}
		set
		{
			throw new NotSupportedException();
		}
	}

	bool IList.IsFixedSize => true;

	bool IList.IsReadOnly => true;

	int IReadOnlyCollection<T>.Count => _items.Length;

	T IReadOnlyList<T>.this[int index] => _items[index];

	int ICollection<T>.Count => _items.Length;

	bool ICollection<T>.IsReadOnly => true;

	T IList<T>.this[int index]
	{
		get
		{
			return _items[index];
		}
		set
		{
			throw new NotSupportedException();
		}
	}

	public <>z__ReadOnlyArray(T[] items)
	{
		_items = items;
	}

	IEnumerator IEnumerable.GetEnumerator()
	{
		return ((IEnumerable)_items).GetEnumerator();
	}

	void ICollection.CopyTo(Array array, int index)
	{
		((ICollection)_items).CopyTo(array, index);
	}

	int IList.Add(object value)
	{
		throw new NotSupportedException();
	}

	void IList.Clear()
	{
		throw new NotSupportedException();
	}

	bool IList.Contains(object value)
	{
		return ((IList)_items).Contains(value);
	}

	int IList.IndexOf(object value)
	{
		return ((IList)_items).IndexOf(value);
	}

	void IList.Insert(int index, object value)
	{
		throw new NotSupportedException();
	}

	void IList.Remove(object value)
	{
		throw new NotSupportedException();
	}

	void IList.RemoveAt(int index)
	{
		throw new NotSupportedException();
	}

	IEnumerator<T> IEnumerable<T>.GetEnumerator()
	{
		return ((IEnumerable<T>)_items).GetEnumerator();
	}

	void ICollection<T>.Add(T item)
	{
		throw new NotSupportedException();
	}

	void ICollection<T>.Clear()
	{
		throw new NotSupportedException();
	}

	bool ICollection<T>.Contains(T item)
	{
		return ((ICollection<T>)_items).Contains(item);
	}

	void ICollection<T>.CopyTo(T[] array, int arrayIndex)
	{
		((ICollection<T>)_items).CopyTo(array, arrayIndex);
	}

	bool ICollection<T>.Remove(T item)
	{
		throw new NotSupportedException();
	}

	int IList<T>.IndexOf(T item)
	{
		return ((IList<T>)_items).IndexOf(item);
	}

	void IList<T>.Insert(int index, T item)
	{
		throw new NotSupportedException();
	}

	void IList<T>.RemoveAt(int index)
	{
		throw new NotSupportedException();
	}
}
[CompilerGenerated]
internal sealed class <>z__ReadOnlySingleElementList<T> : IEnumerable, ICollection, IList, IEnumerable<T>, IReadOnlyCollection<T>, IReadOnlyList<T>, ICollection<T>, IList<T>
{
	private sealed class Enumerator : IDisposable, IEnumerator, IEnumerator<T>
	{
		object IEnumerator.Current => _item;

		T IEnumerator<T>.Current => _item;

		public Enumerator(T item)
		{
			_item = item;
		}

		bool IEnumerator.MoveNext()
		{
			return !_moveNextCalled && (_moveNextCalled = true);
		}

		void IEnumerator.Reset()
		{
			_moveNextCalled = false;
		}

		void IDisposable.Dispose()
		{
		}
	}

	int ICollection.Count => 1;

	bool ICollection.IsSynchronized => false;

	object ICollection.SyncRoot => this;

	object IList.this[int index]
	{
		get
		{
			if (index != 0)
			{
				throw new IndexOutOfRangeException();
			}
			return _item;
		}
		set
		{
			throw new NotSupportedException();
		}
	}

	bool IList.IsFixedSize => true;

	bool IList.IsReadOnly => true;

	int IReadOnlyCollection<T>.Count => 1;

	T IReadOnlyList<T>.this[int index]
	{
		get
		{
			if (index != 0)
			{
				throw new IndexOutOfRangeException();
			}
			return _item;
		}
	}

	int ICollection<T>.Count => 1;

	bool ICollection<T>.IsReadOnly => true;

	T IList<T>.this[int index]
	{
		get
		{
			if (index != 0)
			{
				throw new IndexOutOfRangeException();
			}
			return _item;
		}
		set
		{
			throw new NotSupportedException();
		}
	}

	public <>z__ReadOnlySingleElementList(T item)
	{
		_item = item;
	}

	IEnumerator IEnumerable.GetEnumerator()
	{
		return new Enumerator(_item);
	}

	void ICollection.CopyTo(Array array, int index)
	{
		array.SetValue(_item, index);
	}

	int IList.Add(object value)
	{
		throw new NotSupportedException();
	}

	void IList.Clear()
	{
		throw new NotSupportedException();
	}

	bool IList.Contains(object value)
	{
		return EqualityComparer<T>.Default.Equals(_item, (T)value);
	}

	int IList.IndexOf(object value)
	{
		return (!EqualityComparer<T>.Default.Equals(_item, (T)value)) ? (-1) : 0;
	}

	void IList.Insert(int index, object value)
	{
		throw new NotSupportedException();
	}

	void IList.Remove(object value)
	{
		throw new NotSupportedException();
	}

	void IList.RemoveAt(int index)
	{
		throw new NotSupportedException();
	}

	IEnumerator<T> IEnumerable<T>.GetEnumerator()
	{
		return new Enumerator(_item);
	}

	void ICollection<T>.Add(T item)
	{
		throw new NotSupportedException();
	}

	void ICollection<T>.Clear()
	{
		throw new NotSupportedException();
	}

	bool ICollection<T>.Contains(T item)
	{
		return EqualityComparer<T>.Default.Equals(_item, item);
	}

	void ICollection<T>.CopyTo(T[] array, int arrayIndex)
	{
		array[arrayIndex] = _item;
	}

	bool ICollection<T>.Remove(T item)
	{
		throw new NotSupportedException();
	}

	int IList<T>.IndexOf(T item)
	{
		return (!EqualityComparer<T>.Default.Equals(_item, item)) ? (-1) : 0;
	}

	void IList<T>.Insert(int index, T item)
	{
		throw new NotSupportedException();
	}

	void IList<T>.RemoveAt(int index)
	{
		throw new NotSupportedException();
	}
}
namespace MelanieMeliciousCooked.NetcodePatcher
{
	[AttributeUsage(AttributeTargets.Module)]
	internal class NetcodePatchedAssemblyAttribute : Attribute
	{
	}
}