using System; using System.Collections; using System.Collections.Generic; using System.Diagnostics; using System.Globalization; 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 System.Threading.Tasks; using BepInEx; using BepInEx.Bootstrap; using BepInEx.Configuration; using BepInEx.Logging; using Dawn; using GameNetcodeStuff; using HarmonyLib; using LethalLevelLoader; using MelMelCraft; using MelanieMeliciousCooked; using MelanieMeliciousCooked.NetcodePatcher; using Microsoft.CodeAnalysis; using Newtonsoft.Json; 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(".NETStandard,Version=v2.1", FrameworkDisplayName = ".NET Standard 2.1")] [assembly: SecurityPermission(SecurityAction.RequestMinimum, SkipVerification = true)] [assembly: AssemblyVersion("0.0.0.0")] [module: UnverifiableCode] [module: RefSafetyRules(11)] [module: NetcodePatchedAssembly] [CompilerGenerated] internal sealed class <>z__ReadOnlyArray : IEnumerable, ICollection, IList, IEnumerable, IReadOnlyCollection, IReadOnlyList, ICollection, IList { 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.Count => _items.Length; T IReadOnlyList.this[int index] => _items[index]; int ICollection.Count => _items.Length; bool ICollection.IsReadOnly => true; T IList.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 IEnumerable.GetEnumerator() { return ((IEnumerable)_items).GetEnumerator(); } void ICollection.Add(T item) { throw new NotSupportedException(); } void ICollection.Clear() { throw new NotSupportedException(); } bool ICollection.Contains(T item) { return ((ICollection)_items).Contains(item); } void ICollection.CopyTo(T[] array, int arrayIndex) { ((ICollection)_items).CopyTo(array, arrayIndex); } bool ICollection.Remove(T item) { throw new NotSupportedException(); } int IList.IndexOf(T item) { return ((IList)_items).IndexOf(item); } void IList.Insert(int index, T item) { throw new NotSupportedException(); } void IList.RemoveAt(int index) { throw new NotSupportedException(); } } namespace Microsoft.CodeAnalysis { [CompilerGenerated] [Microsoft.CodeAnalysis.Embedded] internal sealed class EmbeddedAttribute : Attribute { } } namespace System.Runtime.CompilerServices { [CompilerGenerated] [Microsoft.CodeAnalysis.Embedded] [AttributeUsage(AttributeTargets.Class | AttributeTargets.Property | AttributeTargets.Field | AttributeTargets.Event | AttributeTargets.Parameter | AttributeTargets.ReturnValue | AttributeTargets.GenericParameter, AllowMultiple = false, Inherited = false)] internal sealed class NullableAttribute : Attribute { public readonly byte[] NullableFlags; public NullableAttribute(byte P_0) { NullableFlags = new byte[1] { P_0 }; } public NullableAttribute(byte[] P_0) { NullableFlags = P_0; } } [CompilerGenerated] [Microsoft.CodeAnalysis.Embedded] [AttributeUsage(AttributeTargets.Class | AttributeTargets.Struct | AttributeTargets.Method | AttributeTargets.Interface | AttributeTargets.Delegate, AllowMultiple = false, Inherited = false)] internal sealed class NullableContextAttribute : Attribute { public readonly byte Flag; public NullableContextAttribute(byte P_0) { Flag = P_0; } } [CompilerGenerated] [Microsoft.CodeAnalysis.Embedded] [AttributeUsage(AttributeTargets.Module, AllowMultiple = false, Inherited = false)] internal sealed class RefSafetyRulesAttribute : Attribute { public readonly int Version; public RefSafetyRulesAttribute(int P_0) { Version = P_0; } } } public class BeePacifier : NetworkBehaviour { private void OnTriggerEnter(Collider other) { EnemyAICollisionDetect val = default(EnemyAICollisionDetect); if (((NetworkBehaviour)this).IsHost && ((Component)other).gameObject.layer == 19 && ((Component)other).TryGetComponent(ref val)) { if (((object)val.mainScript).GetType() == typeof(RedLocustBees)) { Pacify(((Component)val.mainScript).gameObject, Plugin.itemList[28]); } else if (((object)val.mainScript).GetType() == typeof(ButlerBeesEnemyAI)) { Pacify(((Component)val.mainScript).gameObject, Plugin.itemList[50]); } } } private void Pacify(GameObject obj, Item item) { //IL_000d: Unknown result type (might be due to invalid IL or missing references) //IL_0018: Unknown result type (might be due to invalid IL or missing references) //IL_003a: Unknown result type (might be due to invalid IL or missing references) GameObject val = Object.Instantiate(item.spawnPrefab, ((Component)this).transform.position, ((Component)this).transform.rotation, ((Component)this).transform); NetworkObject component = val.GetComponent(); component.Spawn(false); PacifyClientRpc(NetworkObjectReference.op_Implicit(component), Random.Range(item.minValue, item.maxValue)); Object.Destroy((Object)(object)obj); } [ClientRpc] private void PacifyClientRpc(NetworkObjectReference netObjRef, int value) { //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Invalid comparison between Unknown and I4 //IL_00b4: Unknown result type (might be due to invalid IL or missing references) //IL_00be: 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_00a4: Unknown result type (might be due to invalid IL or missing references) //IL_00e9: Unknown result type (might be due to invalid IL or missing references) //IL_00f5: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager; if (networkManager == null || !networkManager.IsListening) { return; } if ((int)base.__rpc_exec_stage != 1 && (networkManager.IsServer || networkManager.IsHost)) { ClientRpcParams val = default(ClientRpcParams); FastBufferWriter val2 = ((NetworkBehaviour)this).__beginSendClientRpc(1314207286u, val, (RpcDelivery)0); ((FastBufferWriter)(ref val2)).WriteValueSafe(ref netObjRef, default(ForNetworkSerializable)); BytePacker.WriteValueBitPacked(val2, value); ((NetworkBehaviour)this).__endSendClientRpc(ref val2, 1314207286u, val, (RpcDelivery)0); } if ((int)base.__rpc_exec_stage == 1 && (networkManager.IsClient || networkManager.IsHost)) { base.__rpc_exec_stage = (__RpcExecStage)0; StunGrenadeItem.StunExplosion(((Component)this).transform.position, false, 0.8f, 1.75f, 2f, false, (PlayerControllerB)null, (PlayerControllerB)null, 0.3f); NetworkObject val3 = default(NetworkObject); if (((NetworkObjectReference)(ref netObjRef)).TryGet(ref val3, (NetworkManager)null)) { GrabbableObject component = ((Component)val3).GetComponent(); component.SetScrapValue(value); } } } protected override void __initializeVariables() { ((NetworkBehaviour)this).__initializeVariables(); } protected override void __initializeRpcs() { //IL_000d: Unknown result type (might be due to invalid IL or missing references) //IL_001c: Expected O, but got Unknown ((NetworkBehaviour)this).__registerRpc(1314207286u, new RpcReceiveHandler(__rpc_handler_1314207286), "PacifyClientRpc"); ((NetworkBehaviour)this).__initializeRpcs(); } private static void __rpc_handler_1314207286(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_0051: 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_006f: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = target.NetworkManager; if (networkManager != null && networkManager.IsListening) { NetworkObjectReference netObjRef = default(NetworkObjectReference); ((FastBufferReader)(ref reader)).ReadValueSafe(ref netObjRef, default(ForNetworkSerializable)); int value = default(int); ByteUnpacker.ReadValueBitPacked(reader, ref value); target.__rpc_exec_stage = (__RpcExecStage)1; ((BeePacifier)(object)target).PacifyClientRpc(netObjRef, value); target.__rpc_exec_stage = (__RpcExecStage)0; } } protected internal override string __getTypeName() { return "BeePacifier"; } } internal static class MelanieCookedConfig { internal static ConfigEntry noBug; internal static ConfigEntry save; internal static ConfigEntry custom; internal static ConfigEntry enableBurstbush; internal static ConfigEntry immersion; internal static ConfigEntry beeVolume; internal static ConfigEntry grinder0Cost; internal static ConfigEntry blender0Cost; internal static ConfigEntry crockpot0Cost; internal static ConfigEntry oven0Cost; internal static ConfigEntry oven1Cost; internal static ConfigEntry grill0Cost; internal static ConfigEntry fridge0Cost; internal static ConfigEntry plot0Cost; internal static ConfigEntry plot1Cost; internal static ConfigEntry plot2Cost; internal static ConfigEntry barrel0Cost; internal static ConfigEntry rack0Cost; internal static ConfigEntry apiary0Cost; internal static ConfigEntry icecreamer0Cost; internal static ConfigEntry seedMaker0Cost; internal static ConfigEntry seed0Cost; internal static ConfigEntry fertilizer0Cost; internal static ConfigEntry rareGrow; internal static ConfigEntry carrotGrow; internal static ConfigEntry potatoGrow; internal static ConfigEntry wheatGrow; internal static ConfigEntry grape0Grow; internal static ConfigEntry grape1Grow; internal static ConfigEntry tomatoGrow; internal static ConfigEntry alcoholGrow; internal static ConfigEntry burstBerryGrow0; internal static ConfigEntry burstBerryGrow1; internal static ConfigEntry beeGrow0; internal static ConfigEntry grinderCraftList; internal static ConfigEntry blenderCraftList; internal static ConfigEntry crockpotCraftList; internal static ConfigEntry ovenCraftList; internal static ConfigEntry grillCraftList; internal static ConfigEntry icecreamerCraftList; internal static ConfigEntry seederCraftList; internal static ConfigEntry burstBushSpawn0; internal static ConfigEntry burstBushSpawn1; internal static ConfigEntry burstBushSpawn2; internal static ConfigEntry seedTomato0Drop; internal static ConfigEntry cookRange0; internal static ConfigEntry cookRange1; internal static ConfigEntry meatMin; internal static ConfigEntry meatMax; internal static ConfigEntry juiceMax; internal static ConfigEntry carrotMax; internal static ConfigEntry potatoMax; internal static ConfigEntry wheatMax; internal static ConfigEntry grape0Max; internal static ConfigEntry grape1Max; internal static ConfigEntry tomatoMax; internal static ConfigEntry alcoholMax; internal static ConfigEntry burstBerry0Max; internal static ConfigEntry burstBerry1Max; internal static ConfigEntry beeMax; internal static ConfigEntry cropMaxLife; internal static ConfigEntry meatGrind; internal static ConfigEntry meatGoop; internal static ConfigEntry meatList; internal static ConfigEntry veggieList; internal static ConfigEntry grainList; internal static ConfigEntry cheeseList; internal static ConfigEntry boomList; internal static ConfigEntry fruitList; internal static ConfigEntry breadList; internal static ConfigEntry honeyList; internal static ConfigEntry fertilizerList; internal static ConfigEntry appleList; internal static ConfigEntry grape0List; internal static ConfigEntry grape1List; internal static ConfigEntry potatoList; private const string recipeInfo = "Add custom recipes. \n Format: Product1|Product2 : ProductAmount : ToolID0|ToolID1 : IngredientID1;Amount|IngredientID2;Amount : Priority, [SecondRecipe] \n Examples: Aluminium Sheet : 0 : 50;1 : 5"; internal static void SetupConfig(ConfigFile config) { noBug = config.Bind("Features", "INSECTOPHOBIA MODE", false, "Do you want to turn OFF potentially fear-inducing depictions of insects? Added because bee item might freak some people out."); save = config.Bind("Features", "Enable Save System", true, "Toggle if your crops and filled barrels save between sessions."); custom = config.Bind("Features", "Enable Customization", true, "Toggle custom configuration of ingredients."); enableBurstbush = config.Bind("Features", "Enable Burstberry Bushes", true, "Toggle burstberry bushes."); immersion = config.Bind("Features", "Disable Immersion Breaks", false, "Toggle certain default images that some might find don't fit the immersion."); beeVolume = config.Bind("Volume", "Bee Box", 0.25f, "Scale the volume for occupied bee boxes."); grinder0Cost = config.Bind("Prices", "Meat Grinder", 120, "Modify the price for the meat grinder."); blender0Cost = config.Bind("Prices", "Blender", 80, "Modify the price for the blender."); crockpot0Cost = config.Bind("Prices", "Crockpot", 100, "Modify the price for the crockpot."); oven0Cost = config.Bind("Prices", "Mini Oven", 100, "Modify the price for the mini oven."); oven1Cost = config.Bind("Prices", "Oven", 200, "Modify the price for the oven."); grill0Cost = config.Bind("Prices", "Mini Grill", 100, "Modify the price for the grill."); fridge0Cost = config.Bind("Prices", "Fridge", 120, "Modify the price for the fridge."); plot0Cost = config.Bind("Prices", "Small Planter", 100, "Modify the price for small planters."); plot1Cost = config.Bind("Prices", "Trellis Planter", 150, "Modify the price for trellis planters."); plot2Cost = config.Bind("Prices", "Planter Shelf", 325, "Modify the price for planter shelves."); barrel0Cost = config.Bind("Prices", "Fermentation Barrel", 170, "Modify the price for fermentation barrels."); rack0Cost = config.Bind("Prices", "Wine Rack", 180, "Modify the price for the wine rack."); apiary0Cost = config.Bind("Prices", "Bee Box", 100, "Modify the price for bee boxes."); icecreamer0Cost = config.Bind("Prices", "Icecream Maker", 80, "Modify the price for the icecream maker."); seedMaker0Cost = config.Bind("Prices", "Seed Maker", 100, "Modify the price for the seed maker."); seed0Cost = config.Bind("Prices", "Seeds", 15, "Modify the price for seeds."); fertilizer0Cost = config.Bind("Prices", "Fertilizer", 35, "Modify the price for fertilizer."); rareGrow = config.Bind("Growth Chance", "Rare Crops", 2, "Modify the chance for rare variants of crops (if applicable) to grow."); carrotGrow = config.Bind("Growth Chance", "Carrot", 10, "Modify the chance for carrot plants to produce."); potatoGrow = config.Bind("Growth Chance", "Potato", 15, "Modify the chance for potato plants to produce."); wheatGrow = config.Bind("Growth Chance", "Wheat", 20, "Modify the chance for wheat plants to produce."); grape0Grow = config.Bind("Growth Chance", "Red Grapes", 15, "Modify the chance for red grape plants to produce."); grape1Grow = config.Bind("Growth Chance", "Green Grapes", 20, "Modify the chance for green grape plants to produce."); alcoholGrow = config.Bind("Growth Chance", "Alcohol", 20, "Modify the chance for alcohol to have a successful age cycle per hour."); tomatoGrow = config.Bind("Growth Chance", "Tomato", 10, "Modify the chance for tomato plants to produce."); burstBerryGrow0 = config.Bind("Growth Chance", "Burstberry", 20, "Modify the chance for burstberries to progress growing phase per hour."); burstBerryGrow1 = config.Bind("Growth Chance", "Stable Burstberry", 10, "Modify the chance for burstberries to grow stable."); beeGrow0 = config.Bind("Growth Chance", "Bee Queen", 10, "Modify the chance for bee queens to increase in productivity every in-game hour."); grinderCraftList = config.Bind("Custom Cooking Recipes", "Custom Grinder Recipes", string.Empty, "Add custom recipes. \n Format: Product1|Product2 : ProductAmount : ToolID0|ToolID1 : IngredientID1;Amount|IngredientID2;Amount : Priority, [SecondRecipe] \n Examples: Aluminium Sheet : 0 : 50;1 : 5"); blenderCraftList = config.Bind("Custom Cooking Recipes", "Custom Blender Recipes", string.Empty, "Add custom recipes. \n Format: Product1|Product2 : ProductAmount : ToolID0|ToolID1 : IngredientID1;Amount|IngredientID2;Amount : Priority, [SecondRecipe] \n Examples: Aluminium Sheet : 0 : 50;1 : 5"); crockpotCraftList = config.Bind("Custom Cooking Recipes", "Custom Crockpot Recipes", string.Empty, "Add custom recipes. \n Format: Product1|Product2 : ProductAmount : ToolID0|ToolID1 : IngredientID1;Amount|IngredientID2;Amount : Priority, [SecondRecipe] \n Examples: Aluminium Sheet : 0 : 50;1 : 5"); ovenCraftList = config.Bind("Custom Cooking Recipes", "Custom Oven Recipes", string.Empty, "Add custom recipes. \n Format: Product1|Product2 : ProductAmount : ToolID0|ToolID1 : IngredientID1;Amount|IngredientID2;Amount : Priority, [SecondRecipe] \n Examples: Aluminium Sheet : 0 : 50;1 : 5"); grillCraftList = config.Bind("Custom Cooking Recipes", "Custom Grill Recipes", string.Empty, "Add custom recipes. \n Format: Product1|Product2 : ProductAmount : ToolID0|ToolID1 : IngredientID1;Amount|IngredientID2;Amount : Priority, [SecondRecipe] \n Examples: Aluminium Sheet : 0 : 50;1 : 5"); icecreamerCraftList = config.Bind("Custom Cooking Recipes", "Custom Icecream Maker Recipes", string.Empty, "Add custom recipes. \n Format: Product1|Product2 : ProductAmount : ToolID0|ToolID1 : IngredientID1;Amount|IngredientID2;Amount : Priority, [SecondRecipe] \n Examples: Aluminium Sheet : 0 : 50;1 : 5"); seederCraftList = config.Bind("Custom Cooking Recipes", "Custom Seed Maker Recipes", string.Empty, "Add custom recipes. \n Format: Product1|Product2 : ProductAmount : ToolID0|ToolID1 : IngredientID1;Amount|IngredientID2;Amount : Priority, [SecondRecipe] \n Examples: Aluminium Sheet : 0 : 50;1 : 5"); burstBushSpawn0 = config.Bind("Spawn Chance", "Burstberry Bush Global", 2, "Modify the weights for burstberry bushes spawning on any moon."); burstBushSpawn1 = config.Bind("Spawn Chance", "Burstberry Bush By Tag", "lethal_company:forest:20,lethal_company:valley:20", "Modify the weights for burstberry bushes spawning on moons with certain tags."); burstBushSpawn2 = config.Bind("Spawn Chance", "Burstberry Bush By Key", "", "Modify the weights for burstberry bushes spawning on moons by certain keys."); seedTomato0Drop = config.Bind("Resource Chance", "Giant Tomato Seed", 5, "Modify the chances for a giant tomato seed to drop from chopped trees."); cookRange0 = config.Bind("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("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("Item Value", "Meat Value Minumum", 0, "Change the minimum value ADDED to items turned to meat."); meatMax = config.Bind("Item Value", "Meat Value Maximum", 30, "Change the maximum value ADDED to items turned to meat."); juiceMax = config.Bind("Item Value", "Juice Value Maximum", 10, "Change the maximum value ADDED to items blended to juice."); carrotMax = config.Bind("Item Value", "Carrot Value Maximum", 30, "Change the maximum value of grown carrots."); potatoMax = config.Bind("Item Value", "Potato Value Maximum", 25, "Change the maximum value of grown potatoes."); wheatMax = config.Bind("Item Value", "Wheat Value Maximum", 20, "Change the maximum value of grown wheat."); grape0Max = config.Bind("Item Value", "Red Grape Value Maximum", 30, "Change the maximum value of grown wheat."); grape1Max = config.Bind("Item Value", "Green Grape Value Maximum", 20, "Change the maximum value of grown wheat."); tomatoMax = config.Bind("Item Value", "Tomato Value Maximum", 30, "Change the maximum value of grown tomatoes."); alcoholMax = config.Bind("Item Value", "Alcohol Value Maximum", 8, "Change the maximum value ADDED to alcoholic beverages on every successful aging cycle."); burstBerry0Max = config.Bind("Item Value", "Burstberry Chunk Value Maximum", 20, "Change the maximum value of foraged burstberry chunks."); burstBerry1Max = config.Bind("Item Value", "Burstberry Value Maximum", 50, "Change the maximum value of foraged burstberry."); beeMax = config.Bind("Item Value", "Total Bee Product Base Value Maximum", 25, "Change the maximum BASE value of overall bee products, BEFORE hive frame and queen multipliers."); cropMaxLife = config.Bind("Item Value", "Crop Lifetime", 3, "Change the maximum age, in days, before a crop dies."); meatGrind = config.Bind("Custom Ingredients", "Grind to Meat", "Ear,Foot,Hand,Heart,Knee,Tongue,Dead Manticoil,Dead Tulip Snake,Dead Snare Flea,Dead Hoarder Bug,Dead Maneater,Dead Thumper,Dead Baboon Hawk,Dead Bunker Spider", "Add more items to be ground into meat! (Use ITEM name; not always the same as scan or prefab name)"); meatGoop = config.Bind("Custom Ingredients", "Cook to Imitation Meat", "Common Enemy Remains,Rare Enemy Remains,UltraRare Enemy Remains,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", "Add more items to be cooked into imitation meat! (Use ITEM name; not always the same as scan or prefab name)"); meatList = config.Bind("Custom Ingredients", "Cook as Meat", "Meat cube,Clam", "Add more items to be considered meat ingredients! (Use ITEM name; not always the same as scan or prefab name)"); veggieList = config.Bind("Custom Ingredients", "Cook as Veggie", "Jar of pickles,Corn", "Add more items to be considered veggie ingredients! (Use ITEM name; not always the same as scan or prefab name)"); grainList = config.Bind("Custom Ingredients", "Cook as Grain", "", "Add more items to be considered grain ingredients! (Use ITEM name; not always the same as scan or prefab name)"); cheeseList = config.Bind("Custom Ingredients", "Cook as Cheese", "Blue cheese,Cheese puff,Chammer,Cheese wedge,Cheese wheel,Mr. Twisty's Twisted Cheese Curls,Scrap-Its,Stinky cheese man", "Add more items to be considered cheese ingredients! (Use ITEM name; not always the same as scan or prefab name)"); boomList = config.Bind("Custom Ingredients", "Cook to Explode", "", "Add more items to explode when cooked! (Use ITEM name; not always the same as scan or prefab name)"); fruitList = config.Bind("Custom Ingredients", "Cook as Fruit", "Apple,Banana,Biomonty,Coconikki,Coconut,Generic apple,Grapes,Mango,Papaya,Pumpkin,Watermelon", "Add more items to today's fruit haul! (Use ITEM name; not always the same as scan or prefab name)"); breadList = config.Bind("Custom Specific Ingredients", "Cook as Bread", "", "This is bread."); honeyList = config.Bind("Custom Ingredients", "Cook as Honey", "", "This is honey."); fertilizerList = config.Bind("Custom Ingredients", "Use as Fertilizer", "Bone-4-20-0,Ribcage-8-40-0,Poop bucket-75-30-75,Bag of Soil-75-75-75", "Make certain items considered fertilizers, and customize their NPK values. Format: Item A-10-10-10,Item B-10-10-10"); appleList = config.Bind("Custom Specific Ingredients", "Cook as Apple", "Apple,Generic apple", "This is apple."); grape0List = config.Bind("Custom Specific Ingredients", "Cook as Red Grapes", "Grape,Grapes", "This is red grape."); grape1List = config.Bind("Custom Specific Ingredients", "Cook as Green Grapes", "", "This is green grape."); potatoList = config.Bind("Custom Specific Ingredients", "Cook as Potato", "", "This is potato."); } } namespace MelanieMeliciousCooked { public class AimGame : MonoBehaviour { internal bool hit = false; [SerializeField] internal GameObject game; [SerializeField] private Collider2D aim; internal static AimGame Instance { get; private set; } private void OnTriggerEnter2D(Collider2D other) { if ((Object)(object)other == (Object)(object)aim) { hit = true; } } private void OnTriggerExit2D(Collider2D other) { if ((Object)(object)other == (Object)(object)aim) { hit = false; } } private void Awake() { Instance = this; game.SetActive(false); } } public class Apiary : Grower { [ES3Serializable] internal class Save { [CompilerGenerated] [DebuggerBrowsable(DebuggerBrowsableState.Never)] private Apiary <__instance>P; public short queenIndex; public bool queen; public short[] hiveIndex; public short hives; public int queenValue; public float queenMulti; public float hiveMulti; public Save(Apiary __instance) { <__instance>P = __instance; queenIndex = -1; queen = false; hiveIndex = new short[3] { -1, -1, -1 }; hives = 0; queenValue = 0; queenMulti = 1f; hiveMulti = 1f; base..ctor(); } internal Save GetInfo() { queenIndex = <__instance>P.queenIndex; queen = <__instance>P.queen; hiveIndex = <__instance>P.hiveIndex; hives = <__instance>P.hives; queenValue = <__instance>P.queenValue; queenMulti = <__instance>P.queenMulti; hiveMulti = <__instance>P.hiveMulti; return this; } } [HideInInspector] public NetworkVariable queenSync = new NetworkVariable(false, (NetworkVariableReadPermission)0, (NetworkVariableWritePermission)0); [HideInInspector] public NetworkVariable hiveSync = new NetworkVariable((short)0, (NetworkVariableReadPermission)0, (NetworkVariableWritePermission)0); internal Save save; internal short queenIndex = -1; internal bool queen = false; internal short[] hiveIndex = new short[3] { -1, -1, -1 }; internal short hives = 0; [SerializeField] private GameObject queenSpot; [SerializeField] private Transform[] hiveSpots; [SerializeField] private InteractTrigger trigger; internal int queenValue = 0; internal float queenMulti = 1f; internal float hiveMulti = 1f; private short maxValue; private short grow; private List queenList = new List(); private List hiveList = new List(); private const string add = "Add Items : [LMB]\n"; private const string tip0 = " : Has Queen\n"; private const string tip1 = "/3 Hive Frames (Minimum 1)\n(Can also add 1 hive)"; private const string fullTip = "Add Items : [LMB]\nFalse : Has Queen\n0/3 Hive Frames (Minimum 1)\n(Can also add 1 hive)"; public override void OnNetworkSpawn() { ((NetworkBehaviour)this).OnNetworkSpawn(); SyncData(); if (((NetworkBehaviour)this).IsHost) { save = new Save(this); queenList.AddRange(new <>z__ReadOnlyArray((Item[])(object)new Item[3] { Plugin.itemList[48], Plugin.itemList[28], Plugin.itemList[50] })); hiveList.AddRange(new <>z__ReadOnlyArray((Item[])(object)new Item[2] { Plugin.itemList[31], Plugin.itemList[33] })); HarmonyPatches.growers.Add(this); maxValue = (short)MelanieCookedConfig.beeMax.Value; grow = (short)MelanieCookedConfig.beeGrow0.Value; } } private void SyncData() { queen = queenSync.Value; hives = hiveSync.Value; trigger.hoverTip = "Add Items : [LMB]\n" + queen + " : Has Queen\n" + hives + "/3 Hive Frames (Minimum 1)\n(Can also add 1 hive)"; if (queen && hives == 3) { trigger.interactable = false; } queenSpot.SetActive(queen); for (int i = 0; i < hives; i++) { ((Component)hiveSpots[i]).gameObject.SetActive(true); } } [ServerRpc(RequireOwnership = false)] internal void LoadSaveServerRpc(bool queenLoad, short hiveLoad) { //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Invalid comparison between Unknown and I4 //IL_00b4: Unknown result type (might be due to invalid IL or missing references) //IL_00be: 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_00a4: Unknown result type (might be due to invalid IL or missing references) //IL_00e9: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager; if (networkManager != null && networkManager.IsListening) { if ((int)((NetworkBehaviour)this).__rpc_exec_stage != 1 && (networkManager.IsClient || networkManager.IsHost)) { ServerRpcParams val = default(ServerRpcParams); FastBufferWriter val2 = ((NetworkBehaviour)this).__beginSendServerRpc(2208851517u, val, (RpcDelivery)0); ((FastBufferWriter)(ref val2)).WriteValueSafe(ref queenLoad, default(ForPrimitives)); BytePacker.WriteValueBitPacked(val2, hiveLoad); ((NetworkBehaviour)this).__endSendServerRpc(ref val2, 2208851517u, val, (RpcDelivery)0); } if ((int)((NetworkBehaviour)this).__rpc_exec_stage == 1 && (networkManager.IsServer || networkManager.IsHost)) { ((NetworkBehaviour)this).__rpc_exec_stage = (__RpcExecStage)0; queenSync.Value = queenLoad; hiveSync.Value = hiveLoad; SyncData(); } } } internal override void Produce() { if (Random.Range(0, 99) <= grow) { queenValue += Random.Range(1, 5); } } internal override void Age() { //IL_0112: Unknown result type (might be due to invalid IL or missing references) //IL_011d: Unknown result type (might be due to invalid IL or missing references) //IL_013f: 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_0069: Unknown result type (might be due to invalid IL or missing references) //IL_00cb: Unknown result type (might be due to invalid IL or missing references) if (!queen || hives == 0) { return; } Bee bee = default(Bee); for (int i = 0; i < hives; i++) { if (hiveIndex[i] != -1) { GameObject val = Object.Instantiate(hiveList[hiveIndex[i]].spawnPrefab, hiveSpots[i].position, hiveSpots[i].rotation, ((Component)this).transform); if (val.TryGetComponent(ref bee)) { bee.value = (short)((float)queenValue * queenMulti + (float)Random.Range(5, (int)maxValue) * hiveMulti); NetworkObject component = val.GetComponent(); component.Spawn(false); AgeClientRpc(NetworkObjectReference.op_Implicit(component), bee.value, harvest: true); } } } GameObject val2 = Object.Instantiate(queenList[queenIndex].spawnPrefab, ((Component)this).transform.position, ((Component)this).transform.rotation, ((Component)this).transform); NetworkObject component2 = val2.GetComponent(); component2.Spawn(false); AgeClientRpc(NetworkObjectReference.op_Implicit(component2), queenValue); DiscardClientRpc(); } [ClientRpc] private void AgeClientRpc(NetworkObjectReference netObjRef, int value, bool harvest = false) { //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Invalid comparison between Unknown and I4 //IL_00cf: Unknown result type (might be due to invalid IL or missing references) //IL_00d9: 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_00a5: Unknown result type (might be due to invalid IL or missing references) //IL_00ab: 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_0104: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager; if (networkManager == null || !networkManager.IsListening) { return; } if ((int)((NetworkBehaviour)this).__rpc_exec_stage != 1 && (networkManager.IsServer || networkManager.IsHost)) { ClientRpcParams val = default(ClientRpcParams); FastBufferWriter val2 = ((NetworkBehaviour)this).__beginSendClientRpc(1714685434u, val, (RpcDelivery)0); ((FastBufferWriter)(ref val2)).WriteValueSafe(ref netObjRef, default(ForNetworkSerializable)); BytePacker.WriteValueBitPacked(val2, value); ((FastBufferWriter)(ref val2)).WriteValueSafe(ref harvest, default(ForPrimitives)); ((NetworkBehaviour)this).__endSendClientRpc(ref val2, 1714685434u, val, (RpcDelivery)0); } if ((int)((NetworkBehaviour)this).__rpc_exec_stage != 1 || (!networkManager.IsClient && !networkManager.IsHost)) { return; } ((NetworkBehaviour)this).__rpc_exec_stage = (__RpcExecStage)0; NetworkObject val3 = default(NetworkObject); if (((NetworkObjectReference)(ref netObjRef)).TryGet(ref val3, (NetworkManager)null)) { GrabbableObject component = ((Component)val3).GetComponent(); component.SetScrapValue(value); Bee bee = default(Bee); if (harvest && ((Component)val3).TryGetComponent(ref bee)) { bee.harvest.SetActive(true); } } } public void Place(PlayerControllerB playerWhoTriggered) { if (!playerWhoTriggered.isHoldingObject) { return; } Bee bee = default(Bee); if (((Component)playerWhoTriggered.currentlyHeldObjectServer).TryGetComponent(ref bee)) { if (bee.isQueen || hives != 3) { PlaceServerRpc(bee.isQueen, bee.type, bee.multiplier, (short)playerWhoTriggered.currentlyHeldObjectServer.scrapValue); playerWhoTriggered.DespawnHeldObject(); } } else if (playerWhoTriggered.currentlyHeldObjectServer.itemProperties.itemId == 1531 && hives != 3) { PlaceServerRpc(isQueen: true, 0, 1f, (short)Random.Range(5, 20)); PlaceServerRpc(isQueen: false, 0, 1f, 0); playerWhoTriggered.DespawnHeldObject(); } } [ServerRpc(RequireOwnership = false)] private void PlaceServerRpc(bool isQueen, short type, float multiplier, short value = 0) { //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Invalid comparison between Unknown and I4 //IL_00dc: Unknown result type (might be due to invalid IL or missing references) //IL_00e6: 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_00a5: Unknown result type (might be due to invalid IL or missing references) //IL_00ab: Unknown result type (might be due to invalid IL or missing references) //IL_00b4: Unknown result type (might be due to invalid IL or missing references) //IL_00cc: Unknown result type (might be due to invalid IL or missing references) //IL_0111: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager; if (networkManager == null || !networkManager.IsListening) { return; } if ((int)((NetworkBehaviour)this).__rpc_exec_stage != 1 && (networkManager.IsClient || networkManager.IsHost)) { ServerRpcParams val = default(ServerRpcParams); FastBufferWriter val2 = ((NetworkBehaviour)this).__beginSendServerRpc(1201096395u, val, (RpcDelivery)0); ((FastBufferWriter)(ref val2)).WriteValueSafe(ref isQueen, default(ForPrimitives)); BytePacker.WriteValueBitPacked(val2, type); ((FastBufferWriter)(ref val2)).WriteValueSafe(ref multiplier, default(ForPrimitives)); BytePacker.WriteValueBitPacked(val2, value); ((NetworkBehaviour)this).__endSendServerRpc(ref val2, 1201096395u, val, (RpcDelivery)0); } if ((int)((NetworkBehaviour)this).__rpc_exec_stage != 1 || (!networkManager.IsServer && !networkManager.IsHost)) { return; } ((NetworkBehaviour)this).__rpc_exec_stage = (__RpcExecStage)0; if (isQueen) { if (queen) { queenValue += value / 2; } queenSync.Value = true; queen = true; if (type > queenIndex) { queenIndex = type; } if (multiplier > queenMulti) { queenMulti = multiplier; } if (value > queenValue) { queenValue = value; } } else { NetworkVariable obj = hiveSync; short value2 = obj.Value; obj.Value = (short)(value2 + 1); hiveIndex[hives] = type; hiveMulti *= multiplier; } PlaceClientRpc(isQueen); } [ClientRpc] private void PlaceClientRpc(bool isQueen) { //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Invalid comparison between Unknown and I4 //IL_00a7: Unknown result type (might be due to invalid IL or missing references) //IL_00b1: 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_0097: 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) NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager; if (networkManager == null || !networkManager.IsListening) { return; } if ((int)((NetworkBehaviour)this).__rpc_exec_stage != 1 && (networkManager.IsServer || networkManager.IsHost)) { ClientRpcParams val = default(ClientRpcParams); FastBufferWriter val2 = ((NetworkBehaviour)this).__beginSendClientRpc(950914400u, val, (RpcDelivery)0); ((FastBufferWriter)(ref val2)).WriteValueSafe(ref isQueen, default(ForPrimitives)); ((NetworkBehaviour)this).__endSendClientRpc(ref val2, 950914400u, val, (RpcDelivery)0); } if ((int)((NetworkBehaviour)this).__rpc_exec_stage == 1 && (networkManager.IsClient || networkManager.IsHost)) { ((NetworkBehaviour)this).__rpc_exec_stage = (__RpcExecStage)0; if (isQueen) { queenSpot.SetActive(true); queen = true; } else { ((Component)hiveSpots[hives]).gameObject.SetActive(true); hives++; } if (queen && hives == 3) { trigger.interactable = false; } trigger.hoverTip = "Add Items : [LMB]\n" + queen + " : Has Queen\n" + hives + "/3 Hive Frames (Minimum 1)\n(Can also add 1 hive)"; } } [ClientRpc] private void DiscardClientRpc() { //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Invalid comparison between Unknown and I4 //IL_008c: Unknown result type (might be due to invalid IL or missing references) //IL_0096: 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_007c: 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) NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager; if (networkManager == null || !networkManager.IsListening) { return; } if ((int)((NetworkBehaviour)this).__rpc_exec_stage != 1 && (networkManager.IsServer || networkManager.IsHost)) { ClientRpcParams val = default(ClientRpcParams); FastBufferWriter val2 = ((NetworkBehaviour)this).__beginSendClientRpc(1825899610u, val, (RpcDelivery)0); ((NetworkBehaviour)this).__endSendClientRpc(ref val2, 1825899610u, val, (RpcDelivery)0); } if ((int)((NetworkBehaviour)this).__rpc_exec_stage == 1 && (networkManager.IsClient || networkManager.IsHost)) { ((NetworkBehaviour)this).__rpc_exec_stage = (__RpcExecStage)0; trigger.interactable = true; trigger.hoverTip = "Add Items : [LMB]\nFalse : Has Queen\n0/3 Hive Frames (Minimum 1)\n(Can also add 1 hive)"; queen = false; hives = 0; queenSpot.SetActive(false); Transform[] array = hiveSpots; foreach (Transform val3 in array) { ((Component)val3).gameObject.SetActive(false); } if (((NetworkBehaviour)this).IsHost) { queenIndex = -1; hiveIndex = new short[3] { -1, -1, -1 }; queenValue = 0; queenMulti = 1f; hiveMulti = 1f; } } } public override void OnDestroy() { ((NetworkBehaviour)this).OnDestroy(); ((NetworkVariableBase)queenSync).Dispose(); ((NetworkVariableBase)hiveSync).Dispose(); if (((NetworkBehaviour)this).IsHost && HarmonyPatches.growers.Contains(this)) { HarmonyPatches.growers.Remove(this); } } protected override void __initializeVariables() { if (queenSync == null) { throw new Exception("Apiary.queenSync cannot be null. All NetworkVariableBase instances must be initialized."); } ((NetworkVariableBase)queenSync).Initialize((NetworkBehaviour)(object)this); ((NetworkBehaviour)this).__nameNetworkVariable((NetworkVariableBase)(object)queenSync, "queenSync"); ((NetworkBehaviour)this).NetworkVariableFields.Add((NetworkVariableBase)(object)queenSync); if (hiveSync == null) { throw new Exception("Apiary.hiveSync cannot be null. All NetworkVariableBase instances must be initialized."); } ((NetworkVariableBase)hiveSync).Initialize((NetworkBehaviour)(object)this); ((NetworkBehaviour)this).__nameNetworkVariable((NetworkVariableBase)(object)hiveSync, "hiveSync"); ((NetworkBehaviour)this).NetworkVariableFields.Add((NetworkVariableBase)(object)hiveSync); base.__initializeVariables(); } protected override void __initializeRpcs() { //IL_000d: Unknown result type (might be due to invalid IL or missing references) //IL_001c: Expected O, but got Unknown //IL_0029: Unknown result type (might be due to invalid IL or missing references) //IL_0038: Expected O, but got Unknown //IL_0045: Unknown result type (might be due to invalid IL or missing references) //IL_0054: Expected O, but got Unknown //IL_0061: Unknown result type (might be due to invalid IL or missing references) //IL_0070: Expected O, but got Unknown //IL_007d: Unknown result type (might be due to invalid IL or missing references) //IL_008c: Expected O, but got Unknown ((NetworkBehaviour)this).__registerRpc(2208851517u, new RpcReceiveHandler(__rpc_handler_2208851517), "LoadSaveServerRpc"); ((NetworkBehaviour)this).__registerRpc(1714685434u, new RpcReceiveHandler(__rpc_handler_1714685434), "AgeClientRpc"); ((NetworkBehaviour)this).__registerRpc(1201096395u, new RpcReceiveHandler(__rpc_handler_1201096395), "PlaceServerRpc"); ((NetworkBehaviour)this).__registerRpc(950914400u, new RpcReceiveHandler(__rpc_handler_950914400), "PlaceClientRpc"); ((NetworkBehaviour)this).__registerRpc(1825899610u, new RpcReceiveHandler(__rpc_handler_1825899610), "DiscardClientRpc"); base.__initializeRpcs(); } private static void __rpc_handler_2208851517(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_0051: Unknown result type (might be due to invalid IL or missing references) //IL_006f: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = target.NetworkManager; if (networkManager != null && networkManager.IsListening) { bool queenLoad = default(bool); ((FastBufferReader)(ref reader)).ReadValueSafe(ref queenLoad, default(ForPrimitives)); short hiveLoad = default(short); ByteUnpacker.ReadValueBitPacked(reader, ref hiveLoad); target.__rpc_exec_stage = (__RpcExecStage)1; ((Apiary)(object)target).LoadSaveServerRpc(queenLoad, hiveLoad); target.__rpc_exec_stage = (__RpcExecStage)0; } } private static void __rpc_handler_1714685434(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_006c: Unknown result type (might be due to invalid IL or missing references) //IL_0077: Unknown result type (might be due to invalid IL or missing references) //IL_008e: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = target.NetworkManager; if (networkManager != null && networkManager.IsListening) { NetworkObjectReference netObjRef = default(NetworkObjectReference); ((FastBufferReader)(ref reader)).ReadValueSafe(ref netObjRef, default(ForNetworkSerializable)); int value = default(int); ByteUnpacker.ReadValueBitPacked(reader, ref value); bool harvest = default(bool); ((FastBufferReader)(ref reader)).ReadValueSafe(ref harvest, default(ForPrimitives)); target.__rpc_exec_stage = (__RpcExecStage)1; ((Apiary)(object)target).AgeClientRpc(netObjRef, value, harvest); target.__rpc_exec_stage = (__RpcExecStage)0; } } private static void __rpc_handler_1201096395(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_0066: 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_009f: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = target.NetworkManager; if (networkManager != null && networkManager.IsListening) { bool isQueen = default(bool); ((FastBufferReader)(ref reader)).ReadValueSafe(ref isQueen, default(ForPrimitives)); short type = default(short); ByteUnpacker.ReadValueBitPacked(reader, ref type); float multiplier = default(float); ((FastBufferReader)(ref reader)).ReadValueSafe(ref multiplier, default(ForPrimitives)); short value = default(short); ByteUnpacker.ReadValueBitPacked(reader, ref value); target.__rpc_exec_stage = (__RpcExecStage)1; ((Apiary)(object)target).PlaceServerRpc(isQueen, type, multiplier, value); target.__rpc_exec_stage = (__RpcExecStage)0; } } private static void __rpc_handler_950914400(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_0044: Unknown result type (might be due to invalid IL or missing references) //IL_005e: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = target.NetworkManager; if (networkManager != null && networkManager.IsListening) { bool isQueen = default(bool); ((FastBufferReader)(ref reader)).ReadValueSafe(ref isQueen, default(ForPrimitives)); target.__rpc_exec_stage = (__RpcExecStage)1; ((Apiary)(object)target).PlaceClientRpc(isQueen); target.__rpc_exec_stage = (__RpcExecStage)0; } } private static void __rpc_handler_1825899610(NetworkBehaviour target, FastBufferReader reader, __RpcParams rpcParams) { //IL_0029: 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) NetworkManager networkManager = target.NetworkManager; if (networkManager != null && networkManager.IsListening) { target.__rpc_exec_stage = (__RpcExecStage)1; ((Apiary)(object)target).DiscardClientRpc(); target.__rpc_exec_stage = (__RpcExecStage)0; } } protected internal override string __getTypeName() { return "Apiary"; } } public class Bait : MonoBehaviour { public float multi = 1f; } public class Barrel : Grower { [ES3Serializable] internal class Save { [CompilerGenerated] [DebuggerBrowsable(DebuggerBrowsableState.Never)] private Barrel <__instance>P; public short index; public short inputSync; public short ogValue; public Save(Barrel __instance) { <__instance>P = __instance; base..ctor(); } internal Save GetInfo() { index = <__instance>P.index.Value; inputSync = <__instance>P.inputSync.Value; ogValue = <__instance>P.ogValue; return this; } } public NetworkVariable index = new NetworkVariable((short)(-1), (NetworkVariableReadPermission)0, (NetworkVariableWritePermission)0); public NetworkVariable inputSync = new NetworkVariable((short)0, (NetworkVariableReadPermission)0, (NetworkVariableWritePermission)0); internal Save save; internal short ogValue = 0; [SerializeField] private InteractTrigger trigger; private List ingredients = new List(); private Item ingredient; private short maxValue; private short input = 0; private const string add = "Add Ingredient : [LMB]\n"; private const string tip = "/4 "; private const string fullTip = "Add Ingredient : [LMB]\n0/4 Ingredients"; public override void OnNetworkSpawn() { ((NetworkBehaviour)this).OnNetworkSpawn(); ingredients.AddRange(new <>z__ReadOnlyArray((Item[])(object)new Item[6] { Plugin.itemList[5], Plugin.itemList[6], Plugin.itemList[15], Plugin.itemList[17], Plugin.itemList[23], Plugin.itemList[29] })); if (!((NetworkBehaviour)this).IsHost) { SyncData(); return; } save = new Save(this); HarmonyPatches.growers.Add(this); maxValue = (short)MelanieCookedConfig.alcoholMax.Value; } private void SyncData() { input = inputSync.Value; if (index.Value != -1) { ingredient = ingredients[index.Value]; if (input == 4) { trigger.interactable = false; return; } trigger.hoverTip = string.Format("{0}{1}{2}{3}", "Add Ingredient : [LMB]\n", input, "/4 ", ingredient.itemName); } else { trigger.hoverTip = "Add Ingredient : [LMB]\n0/4 Ingredients"; } } [ServerRpc(RequireOwnership = false)] internal void LoadSaveServerRpc(short indexLoad, short inputLoad) { //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Invalid comparison between Unknown and I4 //IL_00a6: Unknown result type (might be due to invalid IL or missing references) //IL_00b0: 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_0096: Unknown result type (might be due to invalid IL or missing references) //IL_00db: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager; if (networkManager != null && networkManager.IsListening) { if ((int)((NetworkBehaviour)this).__rpc_exec_stage != 1 && (networkManager.IsClient || networkManager.IsHost)) { ServerRpcParams val = default(ServerRpcParams); FastBufferWriter val2 = ((NetworkBehaviour)this).__beginSendServerRpc(872338705u, val, (RpcDelivery)0); BytePacker.WriteValueBitPacked(val2, indexLoad); BytePacker.WriteValueBitPacked(val2, inputLoad); ((NetworkBehaviour)this).__endSendServerRpc(ref val2, 872338705u, val, (RpcDelivery)0); } if ((int)((NetworkBehaviour)this).__rpc_exec_stage == 1 && (networkManager.IsServer || networkManager.IsHost)) { ((NetworkBehaviour)this).__rpc_exec_stage = (__RpcExecStage)0; index.Value = indexLoad; inputSync.Value = inputLoad; SyncData(); } } } internal override void Age() { //IL_0057: Unknown result type (might be due to invalid IL or missing references) //IL_0062: Unknown result type (might be due to invalid IL or missing references) //IL_00a1: Unknown result type (might be due to invalid IL or missing references) //IL_00ac: Unknown result type (might be due to invalid IL or missing references) //IL_01fe: Unknown result type (might be due to invalid IL or missing references) //IL_00ec: 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_0137: Unknown result type (might be due to invalid IL or missing references) //IL_0142: Unknown result type (might be due to invalid IL or missing references) //IL_0182: Unknown result type (might be due to invalid IL or missing references) //IL_018d: 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_01d5: Unknown result type (might be due to invalid IL or missing references) if (input < 4) { return; } Ingredient val = default(Ingredient); if (ingredient.spawnPrefab.TryGetComponent(ref val)) { GameObject val2; if (val.ingredient.Contains(12)) { val2 = Object.Instantiate(Plugin.itemList[22].spawnPrefab, ((Component)this).transform.position, ((Component)this).transform.rotation, ((Component)this).transform); } else if (val.ingredient.Contains(4)) { val2 = Object.Instantiate(Plugin.itemList[21].spawnPrefab, ((Component)this).transform.position, ((Component)this).transform.rotation, ((Component)this).transform); } else if (val.ingredient.Contains(13)) { val2 = Object.Instantiate(Plugin.itemList[18].spawnPrefab, ((Component)this).transform.position, ((Component)this).transform.rotation, ((Component)this).transform); } else if (val.ingredient.Contains(14)) { val2 = Object.Instantiate(Plugin.itemList[19].spawnPrefab, ((Component)this).transform.position, ((Component)this).transform.rotation, ((Component)this).transform); } else if (val.ingredient.Contains(15)) { val2 = Object.Instantiate(Plugin.itemList[20].spawnPrefab, ((Component)this).transform.position, ((Component)this).transform.rotation, ((Component)this).transform); } else { if (!val.ingredient.Contains(18)) { return; } val2 = Object.Instantiate(Plugin.itemList[32].spawnPrefab, ((Component)this).transform.position, ((Component)this).transform.rotation, ((Component)this).transform); } NetworkObject component = val2.GetComponent(); component.Spawn(false); AgeClientRpc(NetworkObjectReference.op_Implicit(component), ogValue + Random.Range(5, (int)maxValue)); } ingredient = null; DiscardClientRpc(); } [ClientRpc] private void AgeClientRpc(NetworkObjectReference netObjRef, int value) { //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Invalid comparison between Unknown and I4 //IL_00b4: Unknown result type (might be due to invalid IL or missing references) //IL_00be: 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_00a4: Unknown result type (might be due to invalid IL or missing references) //IL_00e9: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager; if (networkManager == null || !networkManager.IsListening) { return; } if ((int)((NetworkBehaviour)this).__rpc_exec_stage != 1 && (networkManager.IsServer || networkManager.IsHost)) { ClientRpcParams val = default(ClientRpcParams); FastBufferWriter val2 = ((NetworkBehaviour)this).__beginSendClientRpc(4080424806u, val, (RpcDelivery)0); ((FastBufferWriter)(ref val2)).WriteValueSafe(ref netObjRef, default(ForNetworkSerializable)); BytePacker.WriteValueBitPacked(val2, value); ((NetworkBehaviour)this).__endSendClientRpc(ref val2, 4080424806u, val, (RpcDelivery)0); } if ((int)((NetworkBehaviour)this).__rpc_exec_stage == 1 && (networkManager.IsClient || networkManager.IsHost)) { ((NetworkBehaviour)this).__rpc_exec_stage = (__RpcExecStage)0; NetworkObject val3 = default(NetworkObject); if (((NetworkObjectReference)(ref netObjRef)).TryGet(ref val3, (NetworkManager)null)) { GrabbableObject component = ((Component)val3).GetComponent(); component.SetScrapValue(value); } } } public void Place(PlayerControllerB playerWhoTriggered) { //IL_0065: Unknown result type (might be due to invalid IL or missing references) if (!playerWhoTriggered.isHoldingObject) { return; } GrabbableObject currentlyHeldObjectServer = playerWhoTriggered.currentlyHeldObjectServer; if ((Object)(object)ingredient == (Object)null) { if (!ingredients.Contains(currentlyHeldObjectServer.itemProperties)) { return; } } else if ((Object)(object)currentlyHeldObjectServer.itemProperties != (Object)(object)ingredient) { return; } PlaceServerRpc(NetworkObjectReference.op_Implicit(((Component)currentlyHeldObjectServer).GetComponent()), (short)currentlyHeldObjectServer.scrapValue); playerWhoTriggered.DespawnHeldObject(); } [ServerRpc(RequireOwnership = false)] private void PlaceServerRpc(NetworkObjectReference netObjRef, short value) { //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Invalid comparison between Unknown and I4 //IL_00b4: Unknown result type (might be due to invalid IL or missing references) //IL_00be: 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_00a4: Unknown result type (might be due to invalid IL or missing references) //IL_00e9: 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) NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager; if (networkManager != null && networkManager.IsListening) { if ((int)((NetworkBehaviour)this).__rpc_exec_stage != 1 && (networkManager.IsClient || networkManager.IsHost)) { ServerRpcParams val = default(ServerRpcParams); FastBufferWriter val2 = ((NetworkBehaviour)this).__beginSendServerRpc(3891749198u, val, (RpcDelivery)0); ((FastBufferWriter)(ref val2)).WriteValueSafe(ref netObjRef, default(ForNetworkSerializable)); BytePacker.WriteValueBitPacked(val2, value); ((NetworkBehaviour)this).__endSendServerRpc(ref val2, 3891749198u, val, (RpcDelivery)0); } if ((int)((NetworkBehaviour)this).__rpc_exec_stage == 1 && (networkManager.IsServer || networkManager.IsHost)) { ((NetworkBehaviour)this).__rpc_exec_stage = (__RpcExecStage)0; ogValue += value; PlaceClientRpc(netObjRef); } } } [ClientRpc] private void PlaceClientRpc(NetworkObjectReference netObjRef) { //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Invalid comparison between Unknown and I4 //IL_00a7: Unknown result type (might be due to invalid IL or missing references) //IL_00b1: 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_0097: 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) NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager; if (networkManager == null || !networkManager.IsListening) { return; } if ((int)((NetworkBehaviour)this).__rpc_exec_stage != 1 && (networkManager.IsServer || networkManager.IsHost)) { ClientRpcParams val = default(ClientRpcParams); FastBufferWriter val2 = ((NetworkBehaviour)this).__beginSendClientRpc(1516274574u, val, (RpcDelivery)0); ((FastBufferWriter)(ref val2)).WriteValueSafe(ref netObjRef, default(ForNetworkSerializable)); ((NetworkBehaviour)this).__endSendClientRpc(ref val2, 1516274574u, val, (RpcDelivery)0); } if ((int)((NetworkBehaviour)this).__rpc_exec_stage != 1 || (!networkManager.IsClient && !networkManager.IsHost)) { return; } ((NetworkBehaviour)this).__rpc_exec_stage = (__RpcExecStage)0; NetworkObject val3 = default(NetworkObject); if (((NetworkObjectReference)(ref netObjRef)).TryGet(ref val3, (NetworkManager)null)) { GrabbableObject component = ((Component)val3).GetComponent(); ingredient = component.itemProperties; input++; if (input == 4) { trigger.interactable = false; } else { trigger.hoverTip = string.Format("{0}{1}{2}{3}", "Add Ingredient : [LMB]\n", input, "/4 ", ingredient.itemName); } if (((NetworkBehaviour)this).IsHost) { inputSync.Value = input; index.Value = (short)ingredients.IndexOf(component.itemProperties); } } } public void Discard() { DiscardServerRpc(); } [ServerRpc(RequireOwnership = false)] private void DiscardServerRpc() { //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Invalid comparison between Unknown and I4 //IL_008c: Unknown result type (might be due to invalid IL or missing references) //IL_0096: 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_007c: 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) NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager; if (networkManager != null && networkManager.IsListening) { if ((int)((NetworkBehaviour)this).__rpc_exec_stage != 1 && (networkManager.IsClient || networkManager.IsHost)) { ServerRpcParams val = default(ServerRpcParams); FastBufferWriter val2 = ((NetworkBehaviour)this).__beginSendServerRpc(3241937993u, val, (RpcDelivery)0); ((NetworkBehaviour)this).__endSendServerRpc(ref val2, 3241937993u, val, (RpcDelivery)0); } if ((int)((NetworkBehaviour)this).__rpc_exec_stage == 1 && (networkManager.IsServer || networkManager.IsHost)) { ((NetworkBehaviour)this).__rpc_exec_stage = (__RpcExecStage)0; DiscardClientRpc(); } } } [ClientRpc] private void DiscardClientRpc() { //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Invalid comparison between Unknown and I4 //IL_008c: Unknown result type (might be due to invalid IL or missing references) //IL_0096: 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_007c: 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) NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager; if (networkManager == null || !networkManager.IsListening) { return; } if ((int)((NetworkBehaviour)this).__rpc_exec_stage != 1 && (networkManager.IsServer || networkManager.IsHost)) { ClientRpcParams val = default(ClientRpcParams); FastBufferWriter val2 = ((NetworkBehaviour)this).__beginSendClientRpc(2912601765u, val, (RpcDelivery)0); ((NetworkBehaviour)this).__endSendClientRpc(ref val2, 2912601765u, val, (RpcDelivery)0); } if ((int)((NetworkBehaviour)this).__rpc_exec_stage == 1 && (networkManager.IsClient || networkManager.IsHost)) { ((NetworkBehaviour)this).__rpc_exec_stage = (__RpcExecStage)0; trigger.interactable = true; trigger.hoverTip = "Add Ingredient : [LMB]\n0/4 Ingredients"; input = 0; ingredient = null; if (((NetworkBehaviour)this).IsHost) { index.Value = -1; ogValue = 0; inputSync.Value = 0; } } } public override void OnDestroy() { ((NetworkBehaviour)this).OnDestroy(); ((NetworkVariableBase)index).Dispose(); ((NetworkVariableBase)inputSync).Dispose(); if (((NetworkBehaviour)this).IsHost && HarmonyPatches.growers.Contains(this)) { HarmonyPatches.growers.Remove(this); } } protected override void __initializeVariables() { if (index == null) { throw new Exception("Barrel.index cannot be null. All NetworkVariableBase instances must be initialized."); } ((NetworkVariableBase)index).Initialize((NetworkBehaviour)(object)this); ((NetworkBehaviour)this).__nameNetworkVariable((NetworkVariableBase)(object)index, "index"); ((NetworkBehaviour)this).NetworkVariableFields.Add((NetworkVariableBase)(object)index); if (inputSync == null) { throw new Exception("Barrel.inputSync cannot be null. All NetworkVariableBase instances must be initialized."); } ((NetworkVariableBase)inputSync).Initialize((NetworkBehaviour)(object)this); ((NetworkBehaviour)this).__nameNetworkVariable((NetworkVariableBase)(object)inputSync, "inputSync"); ((NetworkBehaviour)this).NetworkVariableFields.Add((NetworkVariableBase)(object)inputSync); base.__initializeVariables(); } protected override void __initializeRpcs() { //IL_000d: Unknown result type (might be due to invalid IL or missing references) //IL_001c: Expected O, but got Unknown //IL_0029: Unknown result type (might be due to invalid IL or missing references) //IL_0038: Expected O, but got Unknown //IL_0045: Unknown result type (might be due to invalid IL or missing references) //IL_0054: Expected O, but got Unknown //IL_0061: Unknown result type (might be due to invalid IL or missing references) //IL_0070: Expected O, but got Unknown //IL_007d: Unknown result type (might be due to invalid IL or missing references) //IL_008c: Expected O, but got Unknown //IL_0099: Unknown result type (might be due to invalid IL or missing references) //IL_00a8: Expected O, but got Unknown ((NetworkBehaviour)this).__registerRpc(872338705u, new RpcReceiveHandler(__rpc_handler_872338705), "LoadSaveServerRpc"); ((NetworkBehaviour)this).__registerRpc(4080424806u, new RpcReceiveHandler(__rpc_handler_4080424806), "AgeClientRpc"); ((NetworkBehaviour)this).__registerRpc(3891749198u, new RpcReceiveHandler(__rpc_handler_3891749198), "PlaceServerRpc"); ((NetworkBehaviour)this).__registerRpc(1516274574u, new RpcReceiveHandler(__rpc_handler_1516274574), "PlaceClientRpc"); ((NetworkBehaviour)this).__registerRpc(3241937993u, new RpcReceiveHandler(__rpc_handler_3241937993), "DiscardServerRpc"); ((NetworkBehaviour)this).__registerRpc(2912601765u, new RpcReceiveHandler(__rpc_handler_2912601765), "DiscardClientRpc"); base.__initializeRpcs(); } private static void __rpc_handler_872338705(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_0043: Unknown result type (might be due to invalid IL or missing references) //IL_0061: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = target.NetworkManager; if (networkManager != null && networkManager.IsListening) { short indexLoad = default(short); ByteUnpacker.ReadValueBitPacked(reader, ref indexLoad); short inputLoad = default(short); ByteUnpacker.ReadValueBitPacked(reader, ref inputLoad); target.__rpc_exec_stage = (__RpcExecStage)1; ((Barrel)(object)target).LoadSaveServerRpc(indexLoad, inputLoad); target.__rpc_exec_stage = (__RpcExecStage)0; } } private static void __rpc_handler_4080424806(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_0051: 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_006f: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = target.NetworkManager; if (networkManager != null && networkManager.IsListening) { NetworkObjectReference netObjRef = default(NetworkObjectReference); ((FastBufferReader)(ref reader)).ReadValueSafe(ref netObjRef, default(ForNetworkSerializable)); int value = default(int); ByteUnpacker.ReadValueBitPacked(reader, ref value); target.__rpc_exec_stage = (__RpcExecStage)1; ((Barrel)(object)target).AgeClientRpc(netObjRef, value); target.__rpc_exec_stage = (__RpcExecStage)0; } } private static void __rpc_handler_3891749198(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_0051: 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_006f: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = target.NetworkManager; if (networkManager != null && networkManager.IsListening) { NetworkObjectReference netObjRef = default(NetworkObjectReference); ((FastBufferReader)(ref reader)).ReadValueSafe(ref netObjRef, default(ForNetworkSerializable)); short value = default(short); ByteUnpacker.ReadValueBitPacked(reader, ref value); target.__rpc_exec_stage = (__RpcExecStage)1; ((Barrel)(object)target).PlaceServerRpc(netObjRef, value); target.__rpc_exec_stage = (__RpcExecStage)0; } } private static void __rpc_handler_1516274574(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_0044: 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_005e: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = target.NetworkManager; if (networkManager != null && networkManager.IsListening) { NetworkObjectReference netObjRef = default(NetworkObjectReference); ((FastBufferReader)(ref reader)).ReadValueSafe(ref netObjRef, default(ForNetworkSerializable)); target.__rpc_exec_stage = (__RpcExecStage)1; ((Barrel)(object)target).PlaceClientRpc(netObjRef); target.__rpc_exec_stage = (__RpcExecStage)0; } } private static void __rpc_handler_3241937993(NetworkBehaviour target, FastBufferReader reader, __RpcParams rpcParams) { //IL_0029: 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) NetworkManager networkManager = target.NetworkManager; if (networkManager != null && networkManager.IsListening) { target.__rpc_exec_stage = (__RpcExecStage)1; ((Barrel)(object)target).DiscardServerRpc(); target.__rpc_exec_stage = (__RpcExecStage)0; } } private static void __rpc_handler_2912601765(NetworkBehaviour target, FastBufferReader reader, __RpcParams rpcParams) { //IL_0029: 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) NetworkManager networkManager = target.NetworkManager; if (networkManager != null && networkManager.IsListening) { target.__rpc_exec_stage = (__RpcExecStage)1; ((Barrel)(object)target).DiscardClientRpc(); target.__rpc_exec_stage = (__RpcExecStage)0; } } protected internal override string __getTypeName() { return "Barrel"; } } public class Bee : NetworkBehaviour { public short type = 0; public bool isQueen; public float multiplier = 1f; public short value = 0; [SerializeField] internal GameObject harvest; public void SpawnItem() { SpawnItemServerRpc(29); SpawnItemServerRpc(30); } [ServerRpc(RequireOwnership = false)] private void SpawnItemServerRpc(int itemList) { //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Invalid comparison between Unknown and I4 //IL_0099: Unknown result type (might be due to invalid IL or missing references) //IL_00a3: 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_0089: Unknown result type (might be due to invalid IL or missing references) //IL_00ce: Unknown result type (might be due to invalid IL or missing references) //IL_00ea: Unknown result type (might be due to invalid IL or missing references) //IL_00f5: 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) 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(1347203381u, val, (RpcDelivery)0); BytePacker.WriteValueBitPacked(val2, itemList); ((NetworkBehaviour)this).__endSendServerRpc(ref val2, 1347203381u, val, (RpcDelivery)0); } if ((int)base.__rpc_exec_stage == 1 && (networkManager.IsServer || networkManager.IsHost)) { base.__rpc_exec_stage = (__RpcExecStage)0; GameObject val3 = Object.Instantiate(Plugin.itemList[itemList].spawnPrefab, ((Component)this).transform.position, ((Component)this).transform.rotation, ((Component)this).transform.parent); val3.GetComponent().Spawn(false); SpawnItemClientRpc(NetworkObjectReference.op_Implicit(val3.GetComponent())); } } } [ClientRpc] private void SpawnItemClientRpc(NetworkObjectReference netObjRef) { //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Invalid comparison between Unknown and I4 //IL_00a7: Unknown result type (might be due to invalid IL or missing references) //IL_00b1: 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_0097: 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) NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager; if (networkManager == null || !networkManager.IsListening) { return; } if ((int)base.__rpc_exec_stage != 1 && (networkManager.IsServer || networkManager.IsHost)) { ClientRpcParams val = default(ClientRpcParams); FastBufferWriter val2 = ((NetworkBehaviour)this).__beginSendClientRpc(96840184u, val, (RpcDelivery)0); ((FastBufferWriter)(ref val2)).WriteValueSafe(ref netObjRef, default(ForNetworkSerializable)); ((NetworkBehaviour)this).__endSendClientRpc(ref val2, 96840184u, val, (RpcDelivery)0); } if ((int)base.__rpc_exec_stage == 1 && (networkManager.IsClient || networkManager.IsHost)) { base.__rpc_exec_stage = (__RpcExecStage)0; NetworkObject val3 = default(NetworkObject); if (((NetworkObjectReference)(ref netObjRef)).TryGet(ref val3, (NetworkManager)null)) { ((Component)val3).GetComponent().SetScrapValue(value / 2); } ((Component)this).GetComponent().SetScrapValue(0); harvest.SetActive(false); } } protected override void __initializeVariables() { ((NetworkBehaviour)this).__initializeVariables(); } protected override void __initializeRpcs() { //IL_000d: Unknown result type (might be due to invalid IL or missing references) //IL_001c: Expected O, but got Unknown //IL_0029: Unknown result type (might be due to invalid IL or missing references) //IL_0038: Expected O, but got Unknown ((NetworkBehaviour)this).__registerRpc(1347203381u, new RpcReceiveHandler(__rpc_handler_1347203381), "SpawnItemServerRpc"); ((NetworkBehaviour)this).__registerRpc(96840184u, new RpcReceiveHandler(__rpc_handler_96840184), "SpawnItemClientRpc"); ((NetworkBehaviour)this).__initializeRpcs(); } private static void __rpc_handler_1347203381(NetworkBehaviour target, FastBufferReader reader, __RpcParams rpcParams) { //IL_0023: Unknown result type (might be due to invalid IL or missing references) //IL_0036: 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) NetworkManager networkManager = target.NetworkManager; if (networkManager != null && networkManager.IsListening) { int itemList = default(int); ByteUnpacker.ReadValueBitPacked(reader, ref itemList); target.__rpc_exec_stage = (__RpcExecStage)1; ((Bee)(object)target).SpawnItemServerRpc(itemList); target.__rpc_exec_stage = (__RpcExecStage)0; } } private static void __rpc_handler_96840184(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_0044: 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_005e: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = target.NetworkManager; if (networkManager != null && networkManager.IsListening) { NetworkObjectReference netObjRef = default(NetworkObjectReference); ((FastBufferReader)(ref reader)).ReadValueSafe(ref netObjRef, default(ForNetworkSerializable)); target.__rpc_exec_stage = (__RpcExecStage)1; ((Bee)(object)target).SpawnItemClientRpc(netObjRef); target.__rpc_exec_stage = (__RpcExecStage)0; } } protected internal override string __getTypeName() { return "Bee"; } } public class Blender : Refine { public override void OnNetworkSpawn() { ((Refine)this).OnNetworkSpawn(); base.recipeList = Plugin.blender.ToArray(); base.refineMax = MelanieCookedConfig.juiceMax.Value; } protected override void __initializeVariables() { ((Refine)this).__initializeVariables(); } protected override void __initializeRpcs() { ((Refine)this).__initializeRpcs(); } protected internal override string __getTypeName() { return "Blender"; } } public class Bobber : MonoBehaviour { [CompilerGenerated] private sealed class d__8 : IEnumerator, IEnumerator, IDisposable { private int <>1__state; private object <>2__current; public Bobber <>4__this; object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } [DebuggerHidden] public d__8(int <>1__state) { this.<>1__state = <>1__state; } [DebuggerHidden] void IDisposable.Dispose() { <>1__state = -2; } private bool MoveNext() { //IL_00cd: Unknown result type (might be due to invalid IL or missing references) //IL_00d7: Expected O, but got Unknown //IL_0147: Unknown result type (might be due to invalid IL or missing references) //IL_0151: 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 switch (<>1__state) { default: return false; case 0: <>1__state = -1; break; case 1: <>1__state = -1; <>4__this.isBiting = true; AimGame.Instance.game.SetActive(true); <>4__this.anim.SetInteger("play", 1); <>4__this.fisher.anim.Play(<>4__this.fisher.bite); HUDManager.Instance.ShakeCamera((ScreenShakeType)0); <>2__current = (object)new WaitForSeconds(1.5f); <>1__state = 2; return true; case 2: <>1__state = -1; <>4__this.isBiting = false; AimGame.Instance.game.SetActive(false); <>4__this.anim.SetInteger("play", 0); <>4__this.fisher.anim.Play(<>4__this.fisher.lose); <>2__current = (object)new WaitForSeconds(0.4f); <>1__state = 3; return true; case 3: <>1__state = -1; if ((Object)(object)((GrabbableObject)<>4__this.fisher).playerHeldBy != (Object)null) { HUDManager.Instance.ShakeCamera((ScreenShakeType)1); ((GrabbableObject)<>4__this.fisher).playerHeldBy.playerBodyAnimator.SetTrigger("Damage"); ((GrabbableObject)<>4__this.fisher).playerHeldBy.PlayQuickSpecialAnimation(0.7f); } break; } if (!<>4__this.isBiting) { <>2__current = (object)new WaitForSeconds((float)Random.Range(5, 16)); <>1__state = 1; return true; } 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 Fisher fisher; internal bool isBiting = false; private bool isFishing = false; [SerializeField] private Rigidbody rb; [SerializeField] private LineRenderer line; [SerializeField] private Animator anim; private const string play = "play"; public void OnTriggerEnter(Collider other) { QuicksandTrigger val = default(QuicksandTrigger); if (!isFishing && ((Component)other).TryGetComponent(ref val) && val.isWater) { isFishing = true; rb.isKinematic = true; ((Behaviour)anim).enabled = true; ((MonoBehaviour)this).StopAllCoroutines(); ((MonoBehaviour)this).StartCoroutine(StartFish()); } } [IteratorStateMachine(typeof(d__8))] internal IEnumerator StartFish() { //yield-return decompiler failed: Unexpected instruction in Iterator.Dispose() return new d__8(0) { <>4__this = this }; } private void Update() { //IL_0014: Unknown result type (might be due to invalid IL or missing references) //IL_0019: Unknown result type (might be due to invalid IL or missing references) //IL_002b: 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) line.SetPositions((Vector3[])(object)new Vector3[2] { ((Component)this).transform.position, fisher.line.position }); } private void Start() { line.widthMultiplier = 0.02f; } } public class BurstBerry : NetworkBehaviour { [SerializeField] private Animator animator; [SerializeField] private GameObject spawn0; [SerializeField] private GameObject spawn1; [SerializeField] private Collider range; private const string play = "play"; private short grow0; private short grow1; private short maxValue0; private short maxValue1; private bool grown = false; public void SpawnItem() { SpawnItemServerRpc(); } [ServerRpc(RequireOwnership = false)] private void SpawnItemServerRpc() { //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Invalid comparison between Unknown and I4 //IL_008c: Unknown result type (might be due to invalid IL or missing references) //IL_0096: 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_007c: 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_00d3: Unknown result type (might be due to invalid IL or missing references) //IL_00de: Unknown result type (might be due to invalid IL or missing references) //IL_010b: Unknown result type (might be due to invalid IL or missing references) 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(1816177754u, val, (RpcDelivery)0); ((NetworkBehaviour)this).__endSendServerRpc(ref val2, 1816177754u, val, (RpcDelivery)0); } if ((int)base.__rpc_exec_stage == 1 && (networkManager.IsServer || networkManager.IsHost)) { base.__rpc_exec_stage = (__RpcExecStage)0; GameObject val3 = Object.Instantiate(spawn0, ((Component)this).transform.position, ((Component)this).transform.rotation, ((Component)this).transform); val3.GetComponent().Spawn(false); AnimateClientRpc(2); SpawnItemClientRpc(NetworkObjectReference.op_Implicit(val3.GetComponent()), Random.Range(maxValue0 / 2, (int)maxValue0)); } } } [ClientRpc] private void SpawnItemClientRpc(NetworkObjectReference netObjRef, int value) { //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Invalid comparison between Unknown and I4 //IL_00b4: Unknown result type (might be due to invalid IL or missing references) //IL_00be: 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_00a4: Unknown result type (might be due to invalid IL or missing references) //IL_00e9: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager; if (networkManager == null || !networkManager.IsListening) { return; } if ((int)base.__rpc_exec_stage != 1 && (networkManager.IsServer || networkManager.IsHost)) { ClientRpcParams val = default(ClientRpcParams); FastBufferWriter val2 = ((NetworkBehaviour)this).__beginSendClientRpc(2932696052u, val, (RpcDelivery)0); ((FastBufferWriter)(ref val2)).WriteValueSafe(ref netObjRef, default(ForNetworkSerializable)); BytePacker.WriteValueBitPacked(val2, value); ((NetworkBehaviour)this).__endSendClientRpc(ref val2, 2932696052u, val, (RpcDelivery)0); } if ((int)base.__rpc_exec_stage == 1 && (networkManager.IsClient || networkManager.IsHost)) { base.__rpc_exec_stage = (__RpcExecStage)0; NetworkObject val3 = default(NetworkObject); if (((NetworkObjectReference)(ref netObjRef)).TryGet(ref val3, (NetworkManager)null)) { ((Component)val3).GetComponent().SetScrapValue(value); } } } public void Boom() { //IL_0012: Unknown result type (might be due to invalid IL or missing references) //IL_0017: Unknown result type (might be due to invalid IL or missing references) //IL_0020: Unknown result type (might be due to invalid IL or missing references) //IL_0039: 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_0061: Unknown result type (might be due to invalid IL or missing references) //IL_0091: Unknown result type (might be due to invalid IL or missing references) //IL_009d: Unknown result type (might be due to invalid IL or missing references) PlayerControllerB localPlayerController = GameNetworkManager.Instance.localPlayerController; Bounds bounds = range.bounds; if (((Bounds)(ref bounds)).Contains(((Component)localPlayerController).transform.position)) { localPlayerController.DamagePlayer(30, true, true, (CauseOfDeath)16, 0, false, default(Vector3)); } if (!((NetworkBehaviour)this).IsHost) { return; } Collider[] array = Physics.OverlapSphere(((Component)this).transform.position, 6f, 2621448, (QueryTriggerInteraction)2); Collider[] array2 = array; foreach (Collider val in array2) { float num = Vector3.Distance(((Component)this).transform.position, ((Component)val).transform.position); if (((Component)val).gameObject.layer == 19) { EnemyAICollisionDetect componentInChildren = ((Component)val).GetComponentInChildren(); if ((Object)(object)componentInChildren != (Object)null && ((NetworkBehaviour)componentInChildren.mainScript).IsOwner) { componentInChildren.mainScript.HitFromExplosion((float)((double)num * 1.5)); } } } } internal void Produce() { //IL_0050: Unknown result type (might be due to invalid IL or missing references) //IL_005b: 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) if (!grown && Random.Range(0, 99) <= grow0) { if (Random.Range(0, 99) > grow1) { AnimateClientRpc(1); } else { GameObject val = Object.Instantiate(spawn1, ((Component)this).transform.position, ((Component)this).transform.rotation, ((Component)this).transform); val.GetComponent().Spawn(false); SpawnItemClientRpc(NetworkObjectReference.op_Implicit(val.GetComponent()), Random.Range(maxValue1 / 2, (int)maxValue1)); AnimateClientRpc(3); } grown = true; } } [ClientRpc] private void AnimateClientRpc(int set) { //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Invalid comparison between Unknown and I4 //IL_0099: Unknown result type (might be due to invalid IL or missing references) //IL_00a3: 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_0089: Unknown result type (might be due to invalid IL or missing references) //IL_00ce: 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.IsServer || networkManager.IsHost)) { ClientRpcParams val = default(ClientRpcParams); FastBufferWriter val2 = ((NetworkBehaviour)this).__beginSendClientRpc(251502498u, val, (RpcDelivery)0); BytePacker.WriteValueBitPacked(val2, set); ((NetworkBehaviour)this).__endSendClientRpc(ref val2, 251502498u, val, (RpcDelivery)0); } if ((int)base.__rpc_exec_stage == 1 && (networkManager.IsClient || networkManager.IsHost)) { base.__rpc_exec_stage = (__RpcExecStage)0; animator.SetInteger("play", set); } } } public override void OnNetworkSpawn() { if (((NetworkBehaviour)this).IsHost) { maxValue0 = (short)MelanieCookedConfig.burstBerry0Max.Value; maxValue1 = (short)MelanieCookedConfig.burstBerry1Max.Value; grow0 = (short)MelanieCookedConfig.burstBerryGrow0.Value; grow1 = (short)MelanieCookedConfig.burstBerryGrow1.Value; HarmonyPatches.burstBushes.Add(this); } } private void Start() { //IL_0046: Unknown result type (might be due to invalid IL or missing references) //IL_004b: Unknown result type (might be due to invalid IL or missing references) //IL_0055: Unknown result type (might be due to invalid IL or missing references) //IL_005a: Unknown result type (might be due to invalid IL or missing references) //IL_005f: Unknown result type (might be due to invalid IL or missing references) //IL_0087: Unknown result type (might be due to invalid IL or missing references) //IL_009f: Unknown result type (might be due to invalid IL or missing references) //IL_00b5: Unknown result type (might be due to invalid IL or missing references) //IL_00ca: Unknown result type (might be due to invalid IL or missing references) if (!GameNetworkManager.Instance.isHostingGame) { if (!((NetworkBehaviour)this).IsSpawned) { Object.Destroy((Object)(object)((Component)((Component)this).transform.parent).gameObject); } return; } RaycastHit val = default(RaycastHit); if (Physics.Raycast(((Component)this).transform.parent.position + Vector3.up * 2f, Vector3.down, ref val, 3f, 1107298561)) { ((Component)this).transform.parent.position = ((RaycastHit)(ref val)).point; ((Component)this).transform.parent.up = ((RaycastHit)(ref val)).normal; ((Component)this).transform.parent.Rotate(Vector3.up * (float)Random.Range(-180, 180), (Space)1); } ((Component)((Component)this).transform.parent).GetComponent().Spawn(true); } protected override void __initializeVariables() { ((NetworkBehaviour)this).__initializeVariables(); } protected override void __initializeRpcs() { //IL_000d: Unknown result type (might be due to invalid IL or missing references) //IL_001c: Expected O, but got Unknown //IL_0029: Unknown result type (might be due to invalid IL or missing references) //IL_0038: Expected O, but got Unknown //IL_0045: Unknown result type (might be due to invalid IL or missing references) //IL_0054: Expected O, but got Unknown ((NetworkBehaviour)this).__registerRpc(1816177754u, new RpcReceiveHandler(__rpc_handler_1816177754), "SpawnItemServerRpc"); ((NetworkBehaviour)this).__registerRpc(2932696052u, new RpcReceiveHandler(__rpc_handler_2932696052), "SpawnItemClientRpc"); ((NetworkBehaviour)this).__registerRpc(251502498u, new RpcReceiveHandler(__rpc_handler_251502498), "AnimateClientRpc"); ((NetworkBehaviour)this).__initializeRpcs(); } private static void __rpc_handler_1816177754(NetworkBehaviour target, FastBufferReader reader, __RpcParams rpcParams) { //IL_0029: 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) NetworkManager networkManager = target.NetworkManager; if (networkManager != null && networkManager.IsListening) { target.__rpc_exec_stage = (__RpcExecStage)1; ((BurstBerry)(object)target).SpawnItemServerRpc(); target.__rpc_exec_stage = (__RpcExecStage)0; } } private static void __rpc_handler_2932696052(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_0051: 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_006f: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = target.NetworkManager; if (networkManager != null && networkManager.IsListening) { NetworkObjectReference netObjRef = default(NetworkObjectReference); ((FastBufferReader)(ref reader)).ReadValueSafe(ref netObjRef, default(ForNetworkSerializable)); int value = default(int); ByteUnpacker.ReadValueBitPacked(reader, ref value); target.__rpc_exec_stage = (__RpcExecStage)1; ((BurstBerry)(object)target).SpawnItemClientRpc(netObjRef, value); target.__rpc_exec_stage = (__RpcExecStage)0; } } private static void __rpc_handler_251502498(NetworkBehaviour target, FastBufferReader reader, __RpcParams rpcParams) { //IL_0023: Unknown result type (might be due to invalid IL or missing references) //IL_0036: 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) NetworkManager networkManager = target.NetworkManager; if (networkManager != null && networkManager.IsListening) { int set = default(int); ByteUnpacker.ReadValueBitPacked(reader, ref set); target.__rpc_exec_stage = (__RpcExecStage)1; ((BurstBerry)(object)target).AnimateClientRpc(set); target.__rpc_exec_stage = (__RpcExecStage)0; } } protected internal override string __getTypeName() { return "BurstBerry"; } } public class Crockpot : Crafter { public override void OnNetworkSpawn() { ((NetworkBehaviour)this).OnNetworkSpawn(); base.recipeList = Plugin.crockpot.ToArray(); base.craftMin = MelanieCookedConfig.cookRange0.Value; base.craftMax = MelanieCookedConfig.cookRange1.Value; } protected override void __initializeVariables() { ((Crafter)this).__initializeVariables(); } protected override void __initializeRpcs() { ((Crafter)this).__initializeRpcs(); } protected internal override string __getTypeName() { return "Crockpot"; } } public class Fisher : GrabbableObject { [CompilerGenerated] private sealed class <>c__DisplayClass21_0 { public NetworkObject netObj; internal bool b__0() { return netObj.IsSpawned; } } [CompilerGenerated] private sealed class d__21 : IEnumerator, IEnumerator, IDisposable { private int <>1__state; private object <>2__current; public NetworkObject netObj; public int value; public Fisher <>4__this; private <>c__DisplayClass21_0 <>8__1; object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } [DebuggerHidden] public d__21(int <>1__state) { this.<>1__state = <>1__state; } [DebuggerHidden] void IDisposable.Dispose() { <>8__1 = null; <>1__state = -2; } private bool MoveNext() { //IL_0062: Unknown result type (might be due to invalid IL or missing references) //IL_006c: Expected O, but got Unknown //IL_007d: Unknown result type (might be due to invalid IL or missing references) //IL_0087: Expected O, but got Unknown //IL_0098: Unknown result type (might be due to invalid IL or missing references) //IL_00a2: Expected O, but got Unknown //IL_00e7: Unknown result type (might be due to invalid IL or missing references) //IL_00ec: Unknown result type (might be due to invalid IL or missing references) switch (<>1__state) { default: return false; case 0: <>1__state = -1; <>8__1 = new <>c__DisplayClass21_0(); <>8__1.netObj = netObj; <>2__current = (object)new WaitUntil((Func)(() => <>8__1.netObj.IsSpawned)); <>1__state = 1; return true; case 1: <>1__state = -1; <>2__current = (object)new WaitForEndOfFrame(); <>1__state = 2; return true; case 2: <>1__state = -1; <>2__current = (object)new WaitForEndOfFrame(); <>1__state = 3; return true; case 3: <>1__state = -1; if ((Object)(object)((GrabbableObject)<>4__this).playerHeldBy != (Object)null) { ((Component)<>8__1.netObj).GetComponent().targetFloorPosition = ((Component)((GrabbableObject)<>4__this).playerHeldBy).transform.position; } 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 List catches = new List(); public GameObject bobberPrefab; private Bobber bobber; [SerializeField] internal Transform line; [SerializeField] internal Animator anim; internal int lose = Animator.StringToHash("Lose"); internal int bite = Animator.StringToHash("Bite"); internal int cast = Animator.StringToHash("Cast"); [SerializeField] private InteractTrigger trigger; private short baitAmount = 0; private float baitMulti = 1f; private const string tip0 = "Add Seed or Bait : [LMB]\n"; private const string tip1 = "/10 Uses Left\nCurrent Bait Effectiveness: "; public override void ItemActivate(bool used, bool buttonDown = true) { //IL_0085: Unknown result type (might be due to invalid IL or missing references) //IL_009a: Unknown result type (might be due to invalid IL or missing references) //IL_00af: Unknown result type (might be due to invalid IL or missing references) if ((Object)(object)base.playerHeldBy == (Object)null) { return; } if (baitAmount == 0) { HUDManager.Instance.DisplayTip("Error:", "There is no bait on the hook!", true, false, "LC_Tip1"); } else if ((Object)(object)bobber != (Object)null) { if (bobber.isBiting) { if (AimGame.Instance.hit) { SpawnItemServerRpc(((Component)bobber).transform.position.x, ((Component)bobber).transform.position.y, ((Component)bobber).transform.position.z); } SetBaitServerRpc((short)(baitAmount - 1), baitMulti); AimGame.Instance.game.SetActive(false); } bobber.isBiting = false; Object.Destroy((Object)(object)((Component)bobber).gameObject); anim.Play(lose); HUDManager.Instance.ShakeCamera((ScreenShakeType)0); } else { anim.Play(cast); } } public void SpawnBobber() { //IL_000e: Unknown result type (might be due to invalid IL or missing references) //IL_0019: Unknown result type (might be due to invalid IL or missing references) //IL_004b: Unknown result type (might be due to invalid IL or missing references) //IL_0055: Unknown result type (might be due to invalid IL or missing references) //IL_0067: Unknown result type (might be due to invalid IL or missing references) bobber = Object.Instantiate(bobberPrefab, ((Component)this).transform.position, ((Component)this).transform.rotation).GetComponent(); ((Component)bobber).GetComponent().fisher = this; Rigidbody component = ((Component)bobber).GetComponent(); component.AddRelativeForce(Vector3.up * 20f, (ForceMode)2); ((Component)component).transform.rotation = Quaternion.identity; } public void SetBait(PlayerControllerB player) { Bait bait = default(Bait); if (player.isHoldingObject && ((Component)player.currentlyHeldObjectServer).TryGetComponent(ref bait)) { SetBaitServerRpc(10, bait.multi); player.DespawnHeldObject(); } } [ServerRpc(RequireOwnership = false)] private void SetBaitServerRpc(short uses, float multi) { //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Invalid comparison between Unknown and I4 //IL_00b4: Unknown result type (might be due to invalid IL or missing references) //IL_00be: 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_008a: Unknown result type (might be due to invalid IL or missing references) //IL_0090: Unknown result type (might be due to invalid IL or missing references) //IL_00a4: Unknown result type (might be due to invalid IL or missing references) //IL_00e9: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager; if (networkManager != null && networkManager.IsListening) { if ((int)((NetworkBehaviour)this).__rpc_exec_stage != 1 && (networkManager.IsClient || networkManager.IsHost)) { ServerRpcParams val = default(ServerRpcParams); FastBufferWriter val2 = ((NetworkBehaviour)this).__beginSendServerRpc(1128447683u, val, (RpcDelivery)0); BytePacker.WriteValueBitPacked(val2, uses); ((FastBufferWriter)(ref val2)).WriteValueSafe(ref multi, default(ForPrimitives)); ((NetworkBehaviour)this).__endSendServerRpc(ref val2, 1128447683u, val, (RpcDelivery)0); } if ((int)((NetworkBehaviour)this).__rpc_exec_stage == 1 && (networkManager.IsServer || networkManager.IsHost)) { ((NetworkBehaviour)this).__rpc_exec_stage = (__RpcExecStage)0; SetBaitClientRpc(uses, multi); } } } [ClientRpc] private void SetBaitClientRpc(short uses, float multi) { //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Invalid comparison between Unknown and I4 //IL_00b4: Unknown result type (might be due to invalid IL or missing references) //IL_00be: 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_008a: Unknown result type (might be due to invalid IL or missing references) //IL_0090: Unknown result type (might be due to invalid IL or missing references) //IL_00a4: Unknown result type (might be due to invalid IL or missing references) //IL_00e9: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager; if (networkManager != null && networkManager.IsListening) { if ((int)((NetworkBehaviour)this).__rpc_exec_stage != 1 && (networkManager.IsServer || networkManager.IsHost)) { ClientRpcParams val = default(ClientRpcParams); FastBufferWriter val2 = ((NetworkBehaviour)this).__beginSendClientRpc(1612129145u, val, (RpcDelivery)0); BytePacker.WriteValueBitPacked(val2, uses); ((FastBufferWriter)(ref val2)).WriteValueSafe(ref multi, default(ForPrimitives)); ((NetworkBehaviour)this).__endSendClientRpc(ref val2, 1612129145u, val, (RpcDelivery)0); } if ((int)((NetworkBehaviour)this).__rpc_exec_stage == 1 && (networkManager.IsClient || networkManager.IsHost)) { ((NetworkBehaviour)this).__rpc_exec_stage = (__RpcExecStage)0; baitAmount = uses; baitMulti = multi; trigger.hoverTip = "Add Seed or Bait : [LMB]\n" + uses + "/10 Uses Left\nCurrent Bait Effectiveness: " + multi; } } } [ServerRpc(RequireOwnership = false)] private void SyncBaitServerRpc() { //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Invalid comparison between Unknown and I4 //IL_008c: Unknown result type (might be due to invalid IL or missing references) //IL_0096: 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_007c: 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) NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager; if (networkManager != null && networkManager.IsListening) { if ((int)((NetworkBehaviour)this).__rpc_exec_stage != 1 && (networkManager.IsClient || networkManager.IsHost)) { ServerRpcParams val = default(ServerRpcParams); FastBufferWriter val2 = ((NetworkBehaviour)this).__beginSendServerRpc(166827970u, val, (RpcDelivery)0); ((NetworkBehaviour)this).__endSendServerRpc(ref val2, 166827970u, val, (RpcDelivery)0); } if ((int)((NetworkBehaviour)this).__rpc_exec_stage == 1 && (networkManager.IsServer || networkManager.IsHost)) { ((NetworkBehaviour)this).__rpc_exec_stage = (__RpcExecStage)0; SetBaitClientRpc(baitAmount, baitMulti); } } } [ServerRpc(RequireOwnership = false)] private void SpawnItemServerRpc(float posX, float posY, float posZ) { //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_0112: Unknown result type (might be due to invalid IL or missing references) //IL_013e: Unknown result type (might be due to invalid IL or missing references) //IL_0143: Unknown result type (might be due to invalid IL or missing references) //IL_0169: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager; if (networkManager != null && networkManager.IsListening) { if ((int)((NetworkBehaviour)this).__rpc_exec_stage != 1 && (networkManager.IsClient || networkManager.IsHost)) { ServerRpcParams val = default(ServerRpcParams); FastBufferWriter val2 = ((NetworkBehaviour)this).__beginSendServerRpc(2055057075u, val, (RpcDelivery)0); ((FastBufferWriter)(ref val2)).WriteValueSafe(ref posX, default(ForPrimitives)); ((FastBufferWriter)(ref val2)).WriteValueSafe(ref posY, default(ForPrimitives)); ((FastBufferWriter)(ref val2)).WriteValueSafe(ref posZ, default(ForPrimitives)); ((NetworkBehaviour)this).__endSendServerRpc(ref val2, 2055057075u, val, (RpcDelivery)0); } if ((int)((NetworkBehaviour)this).__rpc_exec_stage == 1 && (networkManager.IsServer || networkManager.IsHost)) { ((NetworkBehaviour)this).__rpc_exec_stage = (__RpcExecStage)0; Item val3 = catches[Random.Range(0, catches.Count)]; GameObject val4 = Object.Instantiate(val3.spawnPrefab, new Vector3(posX, posY, posZ), Quaternion.identity, RoundManager.Instance.spawnedScrapContainer); NetworkObject component = val4.GetComponent(); component.Spawn(false); SpawnItemClientRpc(NetworkObjectReference.op_Implicit(component), (int)((float)Random.Range(val3.minValue, val3.maxValue) * baitMulti)); } } } [ClientRpc] private void SpawnItemClientRpc(NetworkObjectReference netObjRef, int value) { //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Invalid comparison between Unknown and I4 //IL_00b4: Unknown result type (might be due to invalid IL or missing references) //IL_00be: 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_00a4: Unknown result type (might be due to invalid IL or missing references) //IL_00e9: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager; if (networkManager == null || !networkManager.IsListening) { return; } if ((int)((NetworkBehaviour)this).__rpc_exec_stage != 1 && (networkManager.IsServer || networkManager.IsHost)) { ClientRpcParams val = default(ClientRpcParams); FastBufferWriter val2 = ((NetworkBehaviour)this).__beginSendClientRpc(3438050179u, val, (RpcDelivery)0); ((FastBufferWriter)(ref val2)).WriteValueSafe(ref netObjRef, default(ForNetworkSerializable)); BytePacker.WriteValueBitPacked(val2, value); ((NetworkBehaviour)this).__endSendClientRpc(ref val2, 3438050179u, val, (RpcDelivery)0); } if ((int)((NetworkBehaviour)this).__rpc_exec_stage == 1 && (networkManager.IsClient || networkManager.IsHost)) { ((NetworkBehaviour)this).__rpc_exec_stage = (__RpcExecStage)0; NetworkObject val3 = default(NetworkObject); if (((NetworkObjectReference)(ref netObjRef)).TryGet(ref val3, (NetworkManager)null)) { ((Component)val3).GetComponent().SetScrapValue(value); ((MonoBehaviour)this).StartCoroutine(SpawnItem(val3, value)); } } } [IteratorStateMachine(typeof(d__21))] private IEnumerator SpawnItem(NetworkObject netObj, int value) { //yield-return decompiler failed: Unexpected instruction in Iterator.Dispose() return new d__21(0) { <>4__this = this, netObj = netObj, value = value }; } public override void PocketItem() { if ((Object)(object)bobber != (Object)null) { Object.Destroy((Object)(object)((Component)bobber).gameObject); } anim.Play(lose); ((GrabbableObject)this).PocketItem(); } public override void DiscardItem() { if ((Object)(object)bobber != (Object)null) { Object.Destroy((Object)(object)((Component)bobber).gameObject); } anim.Play(lose); ((GrabbableObject)this).DiscardItem(); } public override void OnNetworkSpawn() { ((NetworkBehaviour)this).OnNetworkSpawn(); SyncBaitServerRpc(); } protected override void __initializeVariables() { ((GrabbableObject)this).__initializeVariables(); } protected override void __initializeRpcs() { //IL_000d: Unknown result type (might be due to invalid IL or missing references) //IL_001c: Expected O, but got Unknown //IL_0029: Unknown result type (might be due to invalid IL or missing references) //IL_0038: Expected O, but got Unknown //IL_0045: Unknown result type (might be due to invalid IL or missing references) //IL_0054: Expected O, but got Unknown //IL_0061: Unknown result type (might be due to invalid IL or missing references) //IL_0070: Expected O, but got Unknown //IL_007d: Unknown result type (might be due to invalid IL or missing references) //IL_008c: Expected O, but got Unknown ((NetworkBehaviour)this).__registerRpc(1128447683u, new RpcReceiveHandler(__rpc_handler_1128447683), "SetBaitServerRpc"); ((NetworkBehaviour)this).__registerRpc(1612129145u, new RpcReceiveHandler(__rpc_handler_1612129145), "SetBaitClientRpc"); ((NetworkBehaviour)this).__registerRpc(166827970u, new RpcReceiveHandler(__rpc_handler_166827970), "SyncBaitServerRpc"); ((NetworkBehaviour)this).__registerRpc(2055057075u, new RpcReceiveHandler(__rpc_handler_2055057075), "SpawnItemServerRpc"); ((NetworkBehaviour)this).__registerRpc(3438050179u, new RpcReceiveHandler(__rpc_handler_3438050179), "SpawnItemClientRpc"); ((GrabbableObject)this).__initializeRpcs(); } private static void __rpc_handler_1128447683(NetworkBehaviour target, FastBufferReader reader, __RpcParams rpcParams) { //IL_0023: Unknown result type (might be due to invalid IL or missing references) //IL_003c: Unknown result type (might be due to invalid IL or missing references) //IL_0042: Unknown result type (might be due to invalid IL or missing references) //IL_0051: Unknown result type (might be due to invalid IL or missing references) //IL_006f: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = target.NetworkManager; if (networkManager != null && networkManager.IsListening) { short uses = default(short); ByteUnpacker.ReadValueBitPacked(reader, ref uses); float multi = default(float); ((FastBufferReader)(ref reader)).ReadValueSafe(ref multi, default(ForPrimitives)); target.__rpc_exec_stage = (__RpcExecStage)1; ((Fisher)(object)target).SetBaitServerRpc(uses, multi); target.__rpc_exec_stage = (__RpcExecStage)0; } } private static void __rpc_handler_1612129145(NetworkBehaviour target, FastBufferReader reader, __RpcParams rpcParams) { //IL_0023: Unknown result type (might be due to invalid IL or missing references) //IL_003c: Unknown result type (might be due to invalid IL or missing references) //IL_0042: Unknown result type (might be due to invalid IL or missing references) //IL_0051: Unknown result type (might be due to invalid IL or missing references) //IL_006f: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = target.NetworkManager; if (networkManager != null && networkManager.IsListening) { short uses = default(short); ByteUnpacker.ReadValueBitPacked(reader, ref uses); float multi = default(float); ((FastBufferReader)(ref reader)).ReadValueSafe(ref multi, default(ForPrimitives)); target.__rpc_exec_stage = (__RpcExecStage)1; ((Fisher)(object)target).SetBaitClientRpc(uses, multi); target.__rpc_exec_stage = (__RpcExecStage)0; } } private static void __rpc_handler_166827970(NetworkBehaviour target, FastBufferReader reader, __RpcParams rpcParams) { //IL_0029: 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) NetworkManager networkManager = target.NetworkManager; if (networkManager != null && networkManager.IsListening) { target.__rpc_exec_stage = (__RpcExecStage)1; ((Fisher)(object)target).SyncBaitServerRpc(); target.__rpc_exec_stage = (__RpcExecStage)0; } } private static void __rpc_handler_2055057075(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 posX = default(float); ((FastBufferReader)(ref reader)).ReadValueSafe(ref posX, default(ForPrimitives)); float posY = default(float); ((FastBufferReader)(ref reader)).ReadValueSafe(ref posY, default(ForPrimitives)); float posZ = default(float); ((FastBufferReader)(ref reader)).ReadValueSafe(ref posZ, default(ForPrimitives)); target.__rpc_exec_stage = (__RpcExecStage)1; ((Fisher)(object)target).SpawnItemServerRpc(posX, posY, posZ); target.__rpc_exec_stage = (__RpcExecStage)0; } } private static void __rpc_handler_3438050179(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_0051: 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_006f: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = target.NetworkManager; if (networkManager != null && networkManager.IsListening) { NetworkObjectReference netObjRef = default(NetworkObjectReference); ((FastBufferReader)(ref reader)).ReadValueSafe(ref netObjRef, default(ForNetworkSerializable)); int value = default(int); ByteUnpacker.ReadValueBitPacked(reader, ref value); target.__rpc_exec_stage = (__RpcExecStage)1; ((Fisher)(object)target).SpawnItemClientRpc(netObjRef, value); target.__rpc_exec_stage = (__RpcExecStage)0; } } protected internal override string __getTypeName() { return "Fisher"; } } public class Grill : Crafter { public override void OnNetworkSpawn() { ((NetworkBehaviour)this).OnNetworkSpawn(); base.recipeList = Plugin.grill.ToArray(); base.craftMin = MelanieCookedConfig.cookRange0.Value; base.craftMax = MelanieCookedConfig.cookRange1.Value; } protected override void __initializeVariables() { ((Crafter)this).__initializeVariables(); } protected override void __initializeRpcs() { ((Crafter)this).__initializeRpcs(); } protected internal override string __getTypeName() { return "Grill"; } } public class Grinder : Refine { public override void OnNetworkSpawn() { ((Refine)this).OnNetworkSpawn(); base.recipeList = Plugin.grinder.ToArray(); base.refineMin = MelanieCookedConfig.meatMin.Value; base.refineMax = MelanieCookedConfig.meatMax.Value; } protected override void __initializeVariables() { ((Refine)this).__initializeVariables(); } protected override void __initializeRpcs() { ((Refine)this).__initializeRpcs(); } protected internal override string __getTypeName() { return "Grinder"; } } public class Grower : NetworkBehaviour { internal virtual void Produce() { } internal virtual void Age() { } protected override void __initializeVariables() { ((NetworkBehaviour)this).__initializeVariables(); } protected override void __initializeRpcs() { ((NetworkBehaviour)this).__initializeRpcs(); } protected internal override string __getTypeName() { return "Grower"; } } public class HarmonyPatches { internal static List growers = new List(); internal static List burstBushes = new List(); private static int treeSeedDrop = MelanieCookedConfig.seedTomato0Drop.Value; private static bool loaded = false; [HarmonyPostfix] [HarmonyPatch(typeof(Terminal), "Awake")] private static void PostText(Terminal __instance) { try { TerminalNode specialKeywordResult = __instance.terminalNodes.allKeywords[7].specialKeywordResult; if (!specialKeywordResult.displayText.Contains("SHIP UPGRADES:") || specialKeywordResult.displayText.Contains("PotA")) { return; } string text = string.Empty; foreach (ExtendedUnlockableItem extendedUnlockableItem in Plugin.extMod.ExtendedUnlockableItems) { text += $"\n* {extendedUnlockableItem.UnlockableItem.unlockableName} // Price: ${extendedUnlockableItem.ItemCost}"; } specialKeywordResult.displayText = specialKeywordResult.displayText.Insert(specialKeywordResult.displayText.IndexOf(":") + 1, text); } catch { Plugin.mls.LogError((object)"Could not find vanilla store terminal node!"); } } [HarmonyPostfix] [HarmonyPatch(typeof(TimeOfDay), "OnHourChanged")] private static void HourPatch() { if (!GameNetworkManager.Instance.isHostingGame) { return; } foreach (Grower grower in growers) { if ((Object)(object)grower != (Object)null) { grower.Produce(); } } foreach (BurstBerry burstBush in burstBushes) { if ((Object)(object)burstBush != (Object)null) { burstBush.Produce(); } } } [HarmonyPostfix] [HarmonyPatch(typeof(TimeOfDay), "OnDayChanged")] private static void NewDayPatch() { if (!GameNetworkManager.Instance.isHostingGame) { return; } foreach (Grower grower in growers) { if ((Object)(object)grower != (Object)null) { grower.Age(); } } burstBushes.Clear(); } [HarmonyPostfix] [HarmonyPatch(typeof(StartOfRound), "Start")] private static void PostStart(StartOfRound __instance) { //IL_06b3: Unknown result type (might be due to invalid IL or missing references) //IL_06bd: Expected O, but got Unknown //IL_07b4: Unknown result type (might be due to invalid IL or missing references) //IL_07be: Expected O, but got Unknown //IL_08e0: Unknown result type (might be due to invalid IL or missing references) //IL_08ea: Expected O, but got Unknown if (loaded) { return; } foreach (Item items in __instance.allItemsList.itemsList) { if ((Object)(object)items == (Object)null) { continue; } if (items.itemName == "Cookie pan") { AddIngredient(items, 28, consume: false); } string[] array = MelanieCookedConfig.appleList.Value.Split(','); foreach (string text in array) { if (items.itemName == text) { AddIngredient(items, 10); } } string[] array2 = MelanieCookedConfig.grape0List.Value.Split(','); foreach (string text2 in array2) { if (items.itemName == text2) { AddIngredient(items, 8); } } string[] array3 = MelanieCookedConfig.grape1List.Value.Split(','); foreach (string text3 in array3) { if (items.itemName == text3) { AddIngredient(items, 9); } } string[] array4 = MelanieCookedConfig.potatoList.Value.Split(','); foreach (string text4 in array4) { if (items.itemName == text4) { AddIngredient(items, 12); } } if (Plugin.bodyHash.Contains(items)) { AddIngredient(items, 0); } string[] array5 = MelanieCookedConfig.meatGrind.Value.Split(','); foreach (string text5 in array5) { if (items.itemName == text5) { AddIngredient(items, 0); } } string[] array6 = MelanieCookedConfig.meatGoop.Value.Split(','); foreach (string text6 in array6) { if (items.itemName == text6) { AddIngredient(items, 1); } } string[] array7 = MelanieCookedConfig.meatList.Value.Split(','); foreach (string text7 in array7) { if (items.itemName == text7) { AddIngredient(items, 2); } } string[] array8 = MelanieCookedConfig.veggieList.Value.Split(','); foreach (string text8 in array8) { if (items.itemName == text8) { AddIngredient(items, 3); } } string[] array9 = MelanieCookedConfig.grainList.Value.Split(','); foreach (string text9 in array9) { if (items.itemName == text9) { AddIngredient(items, 4); } } string[] array10 = MelanieCookedConfig.cheeseList.Value.Split(','); foreach (string text10 in array10) { if (items.itemName == text10) { AddIngredient(items, 5); } } foreach (string item in CollectionExtensions.AddItem((IEnumerable)MelanieCookedConfig.boomList.Value.Split(','), "Gazpacho")) { if (items.itemName == item) { AddIngredient(items, 6); } } string[] array11 = MelanieCookedConfig.fruitList.Value.Split(','); foreach (string text11 in array11) { if (items.itemName == text11) { AddIngredient(items, 7); } } string[] array12 = MelanieCookedConfig.breadList.Value.Split(','); foreach (string text12 in array12) { if (items.itemName == text12) { AddIngredient(items, 16); } } string[] array13 = MelanieCookedConfig.honeyList.Value.Split(','); foreach (string text13 in array13) { if (items.itemName == text13) { AddIngredient(items, 18); } } string[] array14 = MelanieCookedConfig.fertilizerList.Value.Split(','); foreach (string text14 in array14) { string[] array15 = text14.Split('-'); if (items.itemName == array15[0]) { try { Seed seed = items.spawnPrefab.AddComponent(); seed.type = -1; seed.useNitrogen = short.Parse(array15[1], CultureInfo.InvariantCulture); seed.usePhosphorous = short.Parse(array15[2], CultureInfo.InvariantCulture); seed.usePotassium = short.Parse(array15[3], CultureInfo.InvariantCulture); } catch { Plugin.mls.LogError((object)"Invalid fertilizer config input! Skipping."); } } } } GrabbableObject[] array16 = (GrabbableObject[])(object)Object.FindObjectsOfType(typeof(GrabbableObject)); GrabbableObject[] array17 = array16; Ingredient val2 = default(Ingredient); foreach (GrabbableObject val in array17) { if ((Object)(object)val.itemProperties != (Object)null && (Object)(object)val.itemProperties.spawnPrefab != (Object)null && val.itemProperties.spawnPrefab.TryGetComponent(ref val2)) { Ingredient val3 = ((Component)val).gameObject.AddComponent(); val3.ingredient = val2.ingredient; } } if (MelanieCookedConfig.enableBurstbush.Value) { SpawnableOutsideObject val4 = Plugin.bundle.LoadAsset("Assets/MelanieCooked/Asset/Hazard/Bush0.asset"); int value = MelanieCookedConfig.burstBushSpawn0.Value; List list = new List(); foreach (ExtendedLevel extendedLevel in PatchedContent.ExtendedLevels) { if (value != 0) { list.Clear(); list.AddRange(CollectionExtensions.AddItem((IEnumerable)extendedLevel.SelectableLevel.spawnableOutsideObjects, new SpawnableOutsideObjectWithRarity(val4, AnimationCurve.Constant(0f, 1f, (float)value)))); extendedLevel.SelectableLevel.spawnableOutsideObjects = list.ToArray(); } foreach (ContentTag contentTag in ((ExtendedContent)extendedLevel).ContentTags) { string[] array18 = MelanieCookedConfig.burstBushSpawn1.Value.Split(','); foreach (string text15 in array18) { if (text15 == string.Empty) { continue; } try { string[] array19 = text15.Split(':'); if (array19.Length == 3) { array19 = new string[2] { array19[1], array19[2] }; } if (contentTag.contentTagName.ToLower() == array19[0].ToLower()) { list.Clear(); list.AddRange(CollectionExtensions.AddItem((IEnumerable)extendedLevel.SelectableLevel.spawnableOutsideObjects, new SpawnableOutsideObjectWithRarity(val4, AnimationCurve.Constant(0f, 1f, (float)short.Parse(array19[1]))))); extendedLevel.SelectableLevel.spawnableOutsideObjects = list.ToArray(); break; } } catch { Plugin.mls.LogError((object)"Invalid config input for burstberry bush by tag. Skipping this iteration"); } } } string[] array20 = MelanieCookedConfig.burstBushSpawn2.Value.Split(','); foreach (string text16 in array20) { if (text16 == string.Empty) { continue; } try { string[] array21 = text16.Split(':'); if (array21.Length == 3) { array21 = new string[2] { array21[1], array21[2] }; } if (extendedLevel.NumberlessPlanetName.ToLower() == array21[0].ToLower()) { list.Clear(); list.AddRange(CollectionExtensions.AddItem((IEnumerable)extendedLevel.SelectableLevel.spawnableOutsideObjects, new SpawnableOutsideObjectWithRarity(val4, AnimationCurve.Constant(0f, 1f, (float)short.Parse(array21[1]))))); extendedLevel.SelectableLevel.spawnableOutsideObjects = list.ToArray(); break; } } catch { Plugin.mls.LogError((object)"Invalid config input for burstberry bush by tag. Skipping this iteration"); } } } } AddRecipe(Plugin.grinder, MelanieCookedConfig.grinderCraftList.Value); AddRecipe(Plugin.blender, MelanieCookedConfig.blenderCraftList.Value); AddRecipe(Plugin.crockpot, MelanieCookedConfig.crockpotCraftList.Value); AddRecipe(Plugin.oven, MelanieCookedConfig.ovenCraftList.Value); AddRecipe(Plugin.grill, MelanieCookedConfig.grillCraftList.Value); AddRecipe(Plugin.icecreamer, MelanieCookedConfig.icecreamerCraftList.Value); AddRecipe(Plugin.seeder, MelanieCookedConfig.seederCraftList.Value); loaded = true; } [HarmonyPrefix] [HarmonyPatch(typeof(StartOfRound), "Start")] private static void PreStart() { if (GameNetworkManager.Instance.isHostingGame) { growers.Clear(); } } [HarmonyPostfix] [HarmonyPatch(typeof(RagdollGrabbableObject), "Start")] private static void PostRagdoll(RagdollGrabbableObject __instance) { ((Component)__instance).gameObject.AddComponent().ingredient.Add(0); } [HarmonyPostfix] [HarmonyPatch(typeof(CaveDwellerPhysicsProp), "Start")] private static void PostBaby(CaveDwellerPhysicsProp __instance) { ((Component)__instance).gameObject.AddComponent().ingredient.Add(0); } [HarmonyPostfix] [HarmonyPatch(typeof(HUDManager), "Start")] private static void PostHUD(HUDManager __instance) { Object.Instantiate(Plugin.bundle.LoadAsset("Assets/MelanieCooked/Prefab/UI/AimGame.prefab"), __instance.HUDContainer.transform); } [HarmonyPostfix] [HarmonyPatch(typeof(RoundManager), "BreakTreeServerRpc")] private static void PostTreeDie(ref Vector3 pos) { //IL_0037: Unknown result type (might be due to invalid IL or missing references) //IL_003c: Unknown result type (might be due to invalid IL or missing references) if (GameNetworkManager.Instance.isHostingGame && Random.Range(0, 100) <= treeSeedDrop) { GameObject val = Object.Instantiate(Plugin.itemList[41].spawnPrefab, pos, Quaternion.identity, RoundManager.Instance.spawnedScrapContainer); val.GetComponent().Spawn(false); } } private static void AddRecipe(List crafter, string recipe) { try { if (recipe == string.Empty) { return; } string[] array = recipe.Split(", "); string[] array2 = array; foreach (string text in array2) { string[] array3 = text.Split(" : "); List list = new List(); string[] array4 = array3[0].Split('|'); foreach (string text2 in array4) { foreach (Item items in StartOfRound.Instance.allItemsList.itemsList) { if (items.itemName == text2) { list.Add(items); break; } } } List list2 = new List(); List list3 = new List(); short num = 0; string[] array5 = array3[2].Split('|'); foreach (string s in array5) { list3.Add(short.Parse(s, CultureInfo.InvariantCulture)); } string[] array6 = array3[3].Split('|'); foreach (string text3 in array6) { string[] array7 = text3.Split(';'); list2.Add(new short[2] { short.Parse(array7[0], CultureInfo.InvariantCulture), short.Parse(array7[1], CultureInfo.InvariantCulture) }); num += short.Parse(array7[1], CultureInfo.InvariantCulture); } Plugin.RegisterRecipe(crafter, list.ToArray(), list2.ToArray(), list3.ToArray(), num, num, short.Parse(array3[1], CultureInfo.InvariantCulture), short.Parse(array3[4], CultureInfo.InvariantCulture)); } } catch { Plugin.mls.LogError((object)"Invalid config for Custom Recipes for Melanie Farming and Cooking."); } } private static void AddIngredient(Item item, short ID, bool consume = true) { Ingredient val = default(Ingredient); if (item.spawnPrefab.TryGetComponent(ref val)) { val.ingredient.Add(ID); return; } val = item.spawnPrefab.AddComponent(); val.ingredient.Add(ID); val.consumable = consume; } } public class IceCreamer : Crafter { public override void OnNetworkSpawn() { ((NetworkBehaviour)this).OnNetworkSpawn(); base.recipeList = Plugin.icecreamer.ToArray(); base.craftMin = MelanieCookedConfig.cookRange0.Value; base.craftMax = MelanieCookedConfig.cookRange1.Value; } protected override void __initializeVariables() { ((Crafter)this).__initializeVariables(); } protected override void __initializeRpcs() { ((Crafter)this).__initializeRpcs(); } protected internal override string __getTypeName() { return "IceCreamer"; } } public class MasterPlot : MonoBehaviour { [SerializeField] internal Plot[] plots; [SerializeField] internal short capacity; [SerializeField] internal short nitrogen; [SerializeField] internal short phosphorous; [SerializeField] internal short potassium; } public class Oven : Crafter { public override void OnNetworkSpawn() { ((NetworkBehaviour)this).OnNetworkSpawn(); base.recipeList = Plugin.oven.ToArray(); base.craftMin = MelanieCookedConfig.cookRange0.Value; base.craftMax = MelanieCookedConfig.cookRange1.Value; } protected override void __initializeVariables() { ((Crafter)this).__initializeVariables(); } protected override void __initializeRpcs() { ((Crafter)this).__initializeRpcs(); } protected internal override string __getTypeName() { return "Oven"; } } public class Plot : Grower { [ES3Serializable] internal class Save { [CompilerGenerated] [DebuggerBrowsable(DebuggerBrowsableState.Never)] private Plot <__instance>P; public float[] posMin; public float[] posMax; public short cropID; public short[] cropStages; public short useNitrogen; public short usePhosphorous; public short usePotassium; public short produce; public short produceRare; public short life; public short growChance; public short rareChance; public short maxValue; public short type; public bool canAge; public Save(Plot __instance) { <__instance>P = __instance; produce = -1; produceRare = -1; life = 0; base..ctor(); } internal Save GetInfo() { posMin = new float[3] { <__instance>P.posMin.x, <__instance>P.posMin.y, <__instance>P.posMin.z }; posMax = new float[3] { <__instance>P.posMax.x, <__instance>P.posMax.y, <__instance>P.posMax.z }; cropID = <__instance>P.cropID; cropStages = <__instance>P.cropStages; produce = <__instance>P.produceIndex; produceRare = <__instance>P.produceRareIndex; useNitrogen = <__instance>P.useNitrogen; usePhosphorous = <__instance>P.usePhosphorous; usePotassium = <__instance>P.usePotassium; life = <__instance>P.life; growChance = <__instance>P.growChance; rareChance = <__instance>P.rareChance; maxValue = <__instance>P.maxValue; type = <__instance>P.type; canAge = <__instance>P.canAge; return this; } } internal Save save; internal short useNitrogen = 0; internal short usePhosphorous = 0; internal short usePotassium = 0; internal GameObject crop; internal short cropID = -1; internal short[] cropStages; internal Item produce; internal Item produceRare = null; internal short produceIndex = -1; internal short produceRareIndex = -1; internal short life = 0; internal short growChance; internal short maxValue; internal short rareChance; [SerializeField] internal Vector3 posMin; [SerializeField] internal Vector3 posMax; [SerializeField] internal short type; [SerializeField] internal bool canAge; [SerializeField] private MasterPlot masterPlot; [SerializeField] private InteractTrigger trigger; private short maxLife; private const string hover = "Plant Seed : [LMB]\n"; public override void OnNetworkSpawn() { ((NetworkBehaviour)this).OnNetworkSpawn(); if (!((NetworkBehaviour)this).IsHost) { SyncServerRpc(); SyncData(); } else { HarmonyPatches.growers.Add(this); save = new Save(this); maxLife = (short)MelanieCookedConfig.cropMaxLife.Value; } } internal void SyncData() { //IL_0028: Unknown result type (might be due to invalid IL or missing references) //IL_0033: Unknown result type (might be due to invalid IL or missing references) if (cropID != -1) { crop = Object.Instantiate(Plugin.cropList[cropID], ((Component)this).transform.position, ((Component)this).transform.rotation, ((Component)this).transform); } } [ServerRpc(RequireOwnership = false)] private void SyncServerRpc() { //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Invalid comparison between Unknown and I4 //IL_008c: Unknown result type (might be due to invalid IL or missing references) //IL_0096: 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_007c: 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) NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager; if (networkManager == null || !networkManager.IsListening) { return; } if ((int)((NetworkBehaviour)this).__rpc_exec_stage != 1 && (networkManager.IsClient || networkManager.IsHost)) { ServerRpcParams val = default(ServerRpcParams); FastBufferWriter val2 = ((NetworkBehaviour)this).__beginSendServerRpc(552681349u, val, (RpcDelivery)0); ((NetworkBehaviour)this).__endSendServerRpc(ref val2, 552681349u, val, (RpcDelivery)0); } if ((int)((NetworkBehaviour)this).__rpc_exec_stage == 1 && (networkManager.IsServer || networkManager.IsHost)) { ((NetworkBehaviour)this).__rpc_exec_stage = (__RpcExecStage)0; if (cropID != -1) { PlantSeedClientRpc(cropID); } FertilizeClientRpc(masterPlot.nitrogen, masterPlot.phosphorous, masterPlot.potassium); } } public virtual void PlantSeed(PlayerControllerB playerWhoTriggered) { //IL_00a6: Unknown result type (might be due to invalid IL or missing references) GrabbableObject currentlyHeldObjectServer = playerWhoTriggered.currentlyHeldObjectServer; Seed seed = default(Seed); NetworkObject val = default(NetworkObject); if (!((Object)(object)currentlyHeldObjectServer != (Object)null) || !((Component)currentlyHeldObjectServer).TryGetComponent(ref seed) || !((Component)currentlyHeldObjectServer).TryGetComponent(ref val)) { return; } if (seed.type == -1) { FertilizeServerRpc((short)(masterPlot.nitrogen + seed.useNitrogen), (short)(masterPlot.phosphorous + seed.usePhosphorous), (short)(masterPlot.potassium + seed.usePotassium)); } else { if (seed.type != type || (Object)(object)produce != (Object)null) { return; } PlantSeedServerRpc(NetworkObjectReference.op_Implicit(val)); } playerWhoTriggered.DespawnHeldObject(); } [ServerRpc(RequireOwnership = false)] private void FertilizeServerRpc(short n, short p, short k) { //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Invalid comparison between Unknown and I4 //IL_00b3: Unknown result type (might be due to invalid IL or missing references) //IL_00bd: 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_008b: Unknown result type (might be due to invalid IL or missing references) //IL_00a3: Unknown result type (might be due to invalid IL or missing references) //IL_00e8: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager; if (networkManager != null && networkManager.IsListening) { if ((int)((NetworkBehaviour)this).__rpc_exec_stage != 1 && (networkManager.IsClient || networkManager.IsHost)) { ServerRpcParams val = default(ServerRpcParams); FastBufferWriter val2 = ((NetworkBehaviour)this).__beginSendServerRpc(3310671304u, val, (RpcDelivery)0); BytePacker.WriteValueBitPacked(val2, n); BytePacker.WriteValueBitPacked(val2, p); BytePacker.WriteValueBitPacked(val2, k); ((NetworkBehaviour)this).__endSendServerRpc(ref val2, 3310671304u, val, (RpcDelivery)0); } if ((int)((NetworkBehaviour)this).__rpc_exec_stage == 1 && (networkManager.IsServer || networkManager.IsHost)) { ((NetworkBehaviour)this).__rpc_exec_stage = (__RpcExecStage)0; FertilizeClientRpc(n, p, k); } } } [ClientRpc] private void FertilizeClientRpc(short n, short p, short k) { //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Invalid comparison between Unknown and I4 //IL_00b3: Unknown result type (might be due to invalid IL or missing references) //IL_00bd: 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_008b: Unknown result type (might be due to invalid IL or missing references) //IL_00a3: Unknown result type (might be due to invalid IL or missing references) //IL_00e8: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager; if (networkManager == null || !networkManager.IsListening) { return; } if ((int)((NetworkBehaviour)this).__rpc_exec_stage != 1 && (networkManager.IsServer || networkManager.IsHost)) { ClientRpcParams val = default(ClientRpcParams); FastBufferWriter val2 = ((NetworkBehaviour)this).__beginSendClientRpc(3974306210u, val, (RpcDelivery)0); BytePacker.WriteValueBitPacked(val2, n); BytePacker.WriteValueBitPacked(val2, p); BytePacker.WriteValueBitPacked(val2, k); ((NetworkBehaviour)this).__endSendClientRpc(ref val2, 3974306210u, val, (RpcDelivery)0); } if ((int)((NetworkBehaviour)this).__rpc_exec_stage == 1 && (networkManager.IsClient || networkManager.IsHost)) { ((NetworkBehaviour)this).__rpc_exec_stage = (__RpcExecStage)0; masterPlot.nitrogen = (short)Mathf.Clamp((int)n, 0, (int)masterPlot.capacity); masterPlot.phosphorous = (short)Mathf.Clamp((int)p, 0, (int)masterPlot.capacity); masterPlot.potassium = (short)Mathf.Clamp((int)k, 0, (int)masterPlot.capacity); Plot[] plots = masterPlot.plots; foreach (Plot plot in plots) { plot.trigger.hoverTip = string.Format("{0}N: {1}, P: {2}, K: {3}", "Plant Seed : [LMB]\n", masterPlot.nitrogen, masterPlot.phosphorous, masterPlot.potassium); } } } [ServerRpc(RequireOwnership = false)] internal void PlantSeedServerRpc(NetworkObjectReference netObjRef) { //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Invalid comparison between Unknown and I4 //IL_00a7: Unknown result type (might be due to invalid IL or missing references) //IL_00b1: 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_0097: 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_00fd: Unknown result type (might be due to invalid IL or missing references) //IL_0102: Unknown result type (might be due to invalid IL or missing references) //IL_0109: Unknown result type (might be due to invalid IL or missing references) //IL_010e: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager; if (networkManager == null || !networkManager.IsListening) { return; } if ((int)((NetworkBehaviour)this).__rpc_exec_stage != 1 && (networkManager.IsClient || networkManager.IsHost)) { ServerRpcParams val = default(ServerRpcParams); FastBufferWriter val2 = ((NetworkBehaviour)this).__beginSendServerRpc(94063016u, val, (RpcDelivery)0); ((FastBufferWriter)(ref val2)).WriteValueSafe(ref netObjRef, default(ForNetworkSerializable)); ((NetworkBehaviour)this).__endSendServerRpc(ref val2, 94063016u, val, (RpcDelivery)0); } if ((int)((NetworkBehaviour)this).__rpc_exec_stage != 1 || (!networkManager.IsServer && !networkManager.IsHost)) { return; } ((NetworkBehaviour)this).__rpc_exec_stage = (__RpcExecStage)0; NetworkObject val3 = default(NetworkObject); if (((NetworkObjectReference)(ref netObjRef)).TryGet(ref val3, (NetworkManager)null)) { Seed component = ((Component)val3).GetComponent(); posMin = component.posMin; posMax = component.posMax; produce = component.produce; produceIndex = (short)Plugin.itemList.IndexOf(produce); growChance = component.growChance; rareChance = component.rareChance; useNitrogen = component.useNitrogen; usePhosphorous = component.usePhosphorous; usePotassium = component.usePotassium; maxValue = component.maxValue; canAge = component.canAge; List list = new List(); GameObject[] array = component.crop; foreach (GameObject item in array) { list.Add((short)Plugin.cropList.IndexOf(item)); } cropStages = list.ToArray(); cropID = cropStages[0]; life = 0; PlantSeedClientRpc(cropID); } } [ClientRpc] private void PlantSeedClientRpc(short cropID) { //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Invalid comparison between Unknown and I4 //IL_0099: Unknown result type (might be due to invalid IL or missing references) //IL_00a3: 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_0089: Unknown result type (might be due to invalid IL or missing references) //IL_00ce: Unknown result type (might be due to invalid IL or missing references) //IL_0102: Unknown result type (might be due to invalid IL or missing references) //IL_010d: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager; if (networkManager == null || !networkManager.IsListening) { return; } if ((int)((NetworkBehaviour)this).__rpc_exec_stage != 1 && (networkManager.IsServer || networkManager.IsHost)) { ClientRpcParams val = default(ClientRpcParams); FastBufferWriter val2 = ((NetworkBehaviour)this).__beginSendClientRpc(2434559237u, val, (RpcDelivery)0); BytePacker.WriteValueBitPacked(val2, cropID); ((NetworkBehaviour)this).__endSendClientRpc(ref val2, 2434559237u, val, (RpcDelivery)0); } if ((int)((NetworkBehaviour)this).__rpc_exec_stage == 1 && (networkManager.IsClient || networkManager.IsHost)) { ((NetworkBehaviour)this).__rpc_exec_stage = (__RpcExecStage)0; if ((Object)(object)crop != (Object)null) { Object.Destroy((Object)(object)crop); } crop = Object.Instantiate(Plugin.cropList[cropID], ((Component)this).transform.position, ((Component)this).transform.rotation, ((Component)this).transform); } } internal override void Produce() { //IL_0223: Unknown result type (might be due to invalid IL or missing references) //IL_0228: 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_024d: 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) //IL_0272: Unknown result type (might be due to invalid IL or missing references) //IL_0277: Unknown result type (might be due to invalid IL or missing references) //IL_027c: Unknown result type (might be due to invalid IL or missing references) //IL_029c: Unknown result type (might be due to invalid IL or missing references) //IL_02a1: Unknown result type (might be due to invalid IL or missing references) //IL_02a6: Unknown result type (might be due to invalid IL or missing references) //IL_0172: Unknown result type (might be due to invalid IL or missing references) //IL_0177: Unknown result type (might be due to invalid IL or missing references) //IL_0197: 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_01a1: Unknown result type (might be due to invalid IL or missing references) //IL_01c1: Unknown result type (might be due to invalid IL or missing references) //IL_01c6: 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_01eb: Unknown result type (might be due to invalid IL or missing references) //IL_01f0: Unknown result type (might be due to invalid IL or missing references) //IL_01f5: Unknown result type (might be due to invalid IL or missing references) //IL_02cc: Unknown result type (might be due to invalid IL or missing references) //IL_02f0: Unknown result type (might be due to invalid IL or missing references) if ((Object)(object)produce == (Object)null || life < cropStages.Length - 1) { return; } short num = (short)Mathf.Clamp((float)((masterPlot.nitrogen + masterPlot.phosphorous + masterPlot.potassium) / (masterPlot.capacity * 3)), 0.2f, 1f); if (Mathf.Abs((int)useNitrogen) <= masterPlot.nitrogen && Mathf.Abs((int)usePhosphorous) <= masterPlot.phosphorous && Mathf.Abs((int)usePotassium) <= masterPlot.potassium && Random.Range(0, 100) <= growChance) { FertilizeClientRpc((short)(masterPlot.nitrogen - useNitrogen), (short)(masterPlot.phosphorous - usePhosphorous), (short)(masterPlot.potassium - usePotassium)); short num2 = (short)Random.Range((float)maxValue * 0.9f * (float)num, (float)maxValue); GameObject val; if ((Object)(object)produceRare != (Object)null && rareChance > Random.Range(0, 100)) { val = Object.Instantiate(produceRare.spawnPrefab, ((Component)this).transform.position + Vector3.right * Random.Range(posMin.x, posMax.x) + Vector3.up * Random.Range(posMin.y, posMax.y) + Vector3.forward * Random.Range(posMin.z, posMax.z), Quaternion.identity, ((Component)this).transform); num2 *= 10; } else { val = Object.Instantiate(produce.spawnPrefab, ((Component)this).transform.position + Vector3.right * Random.Range(posMin.x, posMax.x) + Vector3.up * Random.Range(posMin.y, posMax.y) + Vector3.forward * Random.Range(posMin.z, posMax.z), Quaternion.identity, ((Component)this).transform); } val.transform.localEulerAngles = new Vector3(-90f, 0f, 0f); NetworkObject val2 = default(NetworkObject); if (val.TryGetComponent(ref val2)) { val2.Spawn(false); ProduceClientRpc(NetworkObjectReference.op_Implicit(val2), num2); } } } [ClientRpc] private void ProduceClientRpc(NetworkObjectReference netObjRef, short value) { //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Invalid comparison between Unknown and I4 //IL_00b4: Unknown result type (might be due to invalid IL or missing references) //IL_00be: 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_00a4: Unknown result type (might be due to invalid IL or missing references) //IL_00e9: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager; if (networkManager == null || !networkManager.IsListening) { return; } if ((int)((NetworkBehaviour)this).__rpc_exec_stage != 1 && (networkManager.IsServer || networkManager.IsHost)) { ClientRpcParams val = default(ClientRpcParams); FastBufferWriter val2 = ((NetworkBehaviour)this).__beginSendClientRpc(2035821907u, val, (RpcDelivery)0); ((FastBufferWriter)(ref val2)).WriteValueSafe(ref netObjRef, default(ForNetworkSerializable)); BytePacker.WriteValueBitPacked(val2, value); ((NetworkBehaviour)this).__endSendClientRpc(ref val2, 2035821907u, val, (RpcDelivery)0); } if ((int)((NetworkBehaviour)this).__rpc_exec_stage == 1 && (networkManager.IsClient || networkManager.IsHost)) { ((NetworkBehaviour)this).__rpc_exec_stage = (__RpcExecStage)0; NetworkObject val3 = default(NetworkObject); if (((NetworkObjectReference)(ref netObjRef)).TryGet(ref val3, (NetworkManager)null)) { ((Component)val3).GetComponent().SetScrapValue((int)value); } } } internal override void Age() { if (produceIndex != -1) { life++; if (life < cropStages.Length) { cropID = cropStages[life]; PlantSeedClientRpc(cropID); } if (canAge && life == maxLife) { produce = null; produceRare = null; useNitrogen = 0; usePhosphorous = 0; usePotassium = 0; cropID = -1; growChance = 0; rareChance = 0; maxValue = 0; produceIndex = -1; produceRareIndex = -1; DieClientRpc(); } } } [ClientRpc] private void DieClientRpc() { //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Invalid comparison between Unknown and I4 //IL_008c: Unknown result type (might be due to invalid IL or missing references) //IL_0096: 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_007c: 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) NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager; if (networkManager == null || !networkManager.IsListening) { return; } if ((int)((NetworkBehaviour)this).__rpc_exec_stage != 1 && (networkManager.IsServer || networkManager.IsHost)) { ClientRpcParams val = default(ClientRpcParams); FastBufferWriter val2 = ((NetworkBehaviour)this).__beginSendClientRpc(2865236341u, val, (RpcDelivery)0); ((NetworkBehaviour)this).__endSendClientRpc(ref val2, 2865236341u, val, (RpcDelivery)0); } if ((int)((NetworkBehaviour)this).__rpc_exec_stage == 1 && (networkManager.IsClient || networkManager.IsHost)) { ((NetworkBehaviour)this).__rpc_exec_stage = (__RpcExecStage)0; if ((Object)(object)crop != (Object)null) { Object.Destroy((Object)(object)crop); } } } public override void OnDestroy() { ((NetworkBehaviour)this).OnDestroy(); if (((NetworkBehaviour)this).IsHost && HarmonyPatches.growers.Contains(this)) { HarmonyPatches.growers.Remove(this); } } protected override void __initializeVariables() { base.__initializeVariables(); } protected override void __initializeRpcs() { //IL_000d: Unknown result type (might be due to invalid IL or missing references) //IL_001c: Expected O, but got Unknown //IL_0029: Unknown result type (might be due to invalid IL or missing references) //IL_0038: Expected O, but got Unknown //IL_0045: Unknown result type (might be due to invalid IL or missing references) //IL_0054: Expected O, but got Unknown //IL_0061: Unknown result type (might be due to invalid IL or missing references) //IL_0070: Expected O, but got Unknown //IL_007d: Unknown result type (might be due to invalid IL or missing references) //IL_008c: Expected O, but got Unknown //IL_0099: Unknown result type (might be due to invalid IL or missing references) //IL_00a8: Expected O, but got Unknown //IL_00b5: Unknown result type (might be due to invalid IL or missing references) //IL_00c4: Expected O, but got Unknown ((NetworkBehaviour)this).__registerRpc(552681349u, new RpcReceiveHandler(__rpc_handler_552681349), "SyncServerRpc"); ((NetworkBehaviour)this).__registerRpc(3310671304u, new RpcReceiveHandler(__rpc_handler_3310671304), "FertilizeServerRpc"); ((NetworkBehaviour)this).__registerRpc(3974306210u, new RpcReceiveHandler(__rpc_handler_3974306210), "FertilizeClientRpc"); ((NetworkBehaviour)this).__registerRpc(94063016u, new RpcReceiveHandler(__rpc_handler_94063016), "PlantSeedServerRpc"); ((NetworkBehaviour)this).__registerRpc(2434559237u, new RpcReceiveHandler(__rpc_handler_2434559237), "PlantSeedClientRpc"); ((NetworkBehaviour)this).__registerRpc(2035821907u, new RpcReceiveHandler(__rpc_handler_2035821907), "ProduceClientRpc"); ((NetworkBehaviour)this).__registerRpc(2865236341u, new RpcReceiveHandler(__rpc_handler_2865236341), "DieClientRpc"); base.__initializeRpcs(); } private static void __rpc_handler_552681349(NetworkBehaviour target, FastBufferReader reader, __RpcParams rpcParams) { //IL_0029: 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) NetworkManager networkManager = target.NetworkManager; if (networkManager != null && networkManager.IsListening) { target.__rpc_exec_stage = (__RpcExecStage)1; ((Plot)(object)target).SyncServerRpc(); target.__rpc_exec_stage = (__RpcExecStage)0; } } private static void __rpc_handler_3310671304(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_003d: 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_0072: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = target.NetworkManager; if (networkManager != null && networkManager.IsListening) { short n = default(short); ByteUnpacker.ReadValueBitPacked(reader, ref n); short p = default(short); ByteUnpacker.ReadValueBitPacked(reader, ref p); short k = default(short); ByteUnpacker.ReadValueBitPacked(reader, ref k); target.__rpc_exec_stage = (__RpcExecStage)1; ((Plot)(object)target).FertilizeServerRpc(n, p, k); target.__rpc_exec_stage = (__RpcExecStage)0; } } private static void __rpc_handler_3974306210(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_003d: 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_0072: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = target.NetworkManager; if (networkManager != null && networkManager.IsListening) { short n = default(short); ByteUnpacker.ReadValueBitPacked(reader, ref n); short p = default(short); ByteUnpacker.ReadValueBitPacked(reader, ref p); short k = default(short); ByteUnpacker.ReadValueBitPacked(reader, ref k); target.__rpc_exec_stage = (__RpcExecStage)1; ((Plot)(object)target).FertilizeClientRpc(n, p, k); target.__rpc_exec_stage = (__RpcExecStage)0; } } private static void __rpc_handler_94063016(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_0044: 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_005e: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = target.NetworkManager; if (networkManager != null && networkManager.IsListening) { NetworkObjectReference netObjRef = default(NetworkObjectReference); ((FastBufferReader)(ref reader)).ReadValueSafe(ref netObjRef, default(ForNetworkSerializable)); target.__rpc_exec_stage = (__RpcExecStage)1; ((Plot)(object)target).PlantSeedServerRpc(netObjRef); target.__rpc_exec_stage = (__RpcExecStage)0; } } private static void __rpc_handler_2434559237(NetworkBehaviour target, FastBufferReader reader, __RpcParams rpcParams) { //IL_0023: Unknown result type (might be due to invalid IL or missing references) //IL_0036: 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) NetworkManager networkManager = target.NetworkManager; if (networkManager != null && networkManager.IsListening) { short num = default(short); ByteUnpacker.ReadValueBitPacked(reader, ref num); target.__rpc_exec_stage = (__RpcExecStage)1; ((Plot)(object)target).PlantSeedClientRpc(num); target.__rpc_exec_stage = (__RpcExecStage)0; } } private static void __rpc_handler_2035821907(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_0051: 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_006f: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = target.NetworkManager; if (networkManager != null && networkManager.IsListening) { NetworkObjectReference netObjRef = default(NetworkObjectReference); ((FastBufferReader)(ref reader)).ReadValueSafe(ref netObjRef, default(ForNetworkSerializable)); short value = default(short); ByteUnpacker.ReadValueBitPacked(reader, ref value); target.__rpc_exec_stage = (__RpcExecStage)1; ((Plot)(object)target).ProduceClientRpc(netObjRef, value); target.__rpc_exec_stage = (__RpcExecStage)0; } } private static void __rpc_handler_2865236341(NetworkBehaviour target, FastBufferReader reader, __RpcParams rpcParams) { //IL_0029: 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) NetworkManager networkManager = target.NetworkManager; if (networkManager != null && networkManager.IsListening) { target.__rpc_exec_stage = (__RpcExecStage)1; ((Plot)(object)target).DieClientRpc(); target.__rpc_exec_stage = (__RpcExecStage)0; } } protected internal override string __getTypeName() { return "Plot"; } } [BepInDependency(/*Could not decode attribute arguments.*/)] [BepInPlugin("MelanieMelicious.FarmAndCook", "MelanieMelicious - Farming and Cooking Mod", "1.4.1")] public class Plugin : BaseUnityPlugin { private const string GUID = "MelanieMelicious.FarmAndCook"; private const string NAME = "MelanieMelicious - Farming and Cooking Mod"; private const string VERSION = "1.4.1"; public const string NAMESPACE = "MelanieMeliciousCooked"; private readonly Harmony harmony = new Harmony("MelanieMelicious.FarmAndCook"); internal static ManualLogSource mls; public static AssetBundle bundle; public UnlockableItem[] unlockList; public static List itemList; public static HashSet bodyHash = new HashSet(); public static List cropList = new List(); public static Plugin instance; public static List grinder = new List(); public static List blender = new List(); public static List seeder = new List(); public static List crockpot = new List(); public static List oven = new List(); public static List grill = new List(); public static List icecreamer = new List(); internal static ExtendedMod extMod; private bool alt = false; private void Awake() { instance = this; MelanieCookedConfig.SetupConfig(((BaseUnityPlugin)this).Config); mls = Logger.CreateLogSource("MelanieMelicious - Farming and Cooking Mod"); mls = ((BaseUnityPlugin)this).Logger; string text = Path.Combine(Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location), "melaniecooked"); bundle = AssetBundle.LoadFromFile(text); unlockList = bundle.LoadAsset("Assets/MelanieCooked/Asset/Furniture.asset").unlockables.ToArray(); itemList = bundle.LoadAsset("Assets/MelanieCooked/Asset/Item.asset").itemsList; cropList.AddRange(new <>z__ReadOnlyArray((GameObject[])(object)new GameObject[8] { bundle.LoadAsset("Assets/MelanieCooked/Prefab/Crop/CropCarrot.prefab"), bundle.LoadAsset("Assets/MelanieCooked/Prefab/Crop/CropPotato.prefab"), bundle.LoadAsset("Assets/MelanieCooked/Prefab/Crop/CropWheat.prefab"), bundle.LoadAsset("Assets/MelanieCooked/Prefab/Crop/CropGrape.prefab"), bundle.LoadAsset("Assets/MelanieCooked/Prefab/Crop/CropSprout.prefab"), bundle.LoadAsset("Assets/MelanieCooked/Prefab/Crop/CropTomato0.prefab"), bundle.LoadAsset("Assets/MelanieCooked/Prefab/Crop/CropTomato1.prefab"), bundle.LoadAsset("Assets/MelanieCooked/Prefab/Crop/CropTomato2.prefab") })); extMod = bundle.LoadAsset("Assets/MelanieCooked/MelanieCooked.asset"); Item[] array = bundle.LoadAsset("Assets/MelanieCooked/Asset/Seed.asset").itemsList.ToArray(); if (Chainloader.PluginInfos.ContainsKey("com.github.teamxiaolan.dawnlib")) { alt = true; } short rare = (short)MelanieCookedConfig.rareGrow.Value; Seed(array[0].spawnPrefab.GetComponent(), (short)MelanieCookedConfig.carrotGrow.Value, rare, (short)MelanieCookedConfig.carrotMax.Value); Seed(array[1].spawnPrefab.GetComponent(), (short)MelanieCookedConfig.potatoGrow.Value, rare, (short)MelanieCookedConfig.potatoMax.Value); Seed(array[2].spawnPrefab.GetComponent(), (short)MelanieCookedConfig.wheatGrow.Value, rare, (short)MelanieCookedConfig.wheatMax.Value); Seed(array[3].spawnPrefab.GetComponent(), (short)MelanieCookedConfig.grape0Grow.Value, rare, (short)MelanieCookedConfig.grape0Max.Value); Seed(array[4].spawnPrefab.GetComponent(), (short)MelanieCookedConfig.grape1Grow.Value, rare, (short)MelanieCookedConfig.grape1Max.Value); Seed(itemList[41].spawnPrefab.GetComponent(), (short)MelanieCookedConfig.tomatoGrow.Value, rare, (short)MelanieCookedConfig.tomatoMax.Value); Seed(itemList[57].spawnPrefab.GetComponent(), (short)MelanieCookedConfig.tomatoGrow.Value, (short)MelanieCookedConfig.tomatoMax.Value); harmony.PatchAll(typeof(HarmonyPatches)); if (MelanieCookedConfig.save.Value) { harmony.PatchAll(typeof(SavePatches)); } Unlockable(unlockList[0], MelanieCookedConfig.grinder0Cost.Value); Unlockable(unlockList[15], MelanieCookedConfig.blender0Cost.Value); Unlockable(unlockList[1], MelanieCookedConfig.crockpot0Cost.Value); Unlockable(unlockList[3], MelanieCookedConfig.oven0Cost.Value); Unlockable(unlockList[6], MelanieCookedConfig.grill0Cost.Value); Unlockable(unlockList[8], MelanieCookedConfig.oven1Cost.Value); Unlockable(unlockList[7], MelanieCookedConfig.fridge0Cost.Value); Unlockable(unlockList[2], MelanieCookedConfig.plot0Cost.Value); Unlockable(unlockList[4], MelanieCookedConfig.plot0Cost.Value); Unlockable(unlockList[5], MelanieCookedConfig.plot0Cost.Value); Unlockable(unlockList[9], MelanieCookedConfig.plot1Cost.Value); Unlockable(unlockList[10], MelanieCookedConfig.plot1Cost.Value); Unlockable(unlockList[14], MelanieCookedConfig.plot2Cost.Value); Unlockable(unlockList[11], MelanieCookedConfig.barrel0Cost.Value); Unlockable(unlockList[12], MelanieCookedConfig.barrel0Cost.Value); Unlockable(unlockList[13], MelanieCookedConfig.rack0Cost.Value); Unlockable(unlockList[16], MelanieCookedConfig.apiary0Cost.Value); Unlockable(unlockList[17], MelanieCookedConfig.plot0Cost.Value); Unlockable(unlockList[18], MelanieCookedConfig.icecreamer0Cost.Value); Unlockable(unlockList[19], MelanieCookedConfig.seedMaker0Cost.Value); ((Component)unlockList[16].prefabObject.transform.Find("Queen")).GetComponent().volume = MelanieCookedConfig.beeVolume.Value; if (MelanieCookedConfig.noBug.Value) { Mesh mesh = bundle.LoadAsset("Assets/MelanieCooked/Mesh/fumo0.mesh"); Material[] array2 = (Material[])(object)new Material[3] { bundle.LoadAsset("Assets/MelanieCooked/Material/fumo0.mat"), bundle.LoadAsset("Assets/MelanieCooked/Material/Beige0.mat"), bundle.LoadAsset("Assets/MelanieCooked/Material/Fridge0.mat") }; AudioClip clip = bundle.LoadAsset("Assets/MelanieCooked/Audio/PlushieSqueeze.ogg"); NoBug(itemList[28], mesh, (Material[])(object)new Material[5] { array2[0], bundle.LoadAsset("Assets/MelanieCooked/Material/Bee1.mat"), bundle.LoadAsset("Assets/MelanieCooked/Material/Wax0.mat"), array2[1], array2[2] }, clip); NoBug(itemList[48], mesh, (Material[])(object)new Material[5] { array2[0], bundle.LoadAsset("Assets/MelanieCooked/Material/Bee2.mat"), bundle.LoadAsset("Assets/MelanieCooked/Material/Veggie0.mat"), array2[1], array2[2] }, clip); NoBug(itemList[50], mesh, (Material[])(object)new Material[5] { array2[0], bundle.LoadAsset("Assets/MelanieCooked/Material/Bee3.mat"), bundle.LoadAsset("Assets/MelanieCooked/Material/Tomato0.mat"), array2[1], array2[2] }, clip); } foreach (Item item2 in itemList) { Item(item2); } Item[] array3 = array; foreach (Item item in array3) { Item(item, MelanieCookedConfig.seed0Cost.Value); } Item val = bundle.LoadAsset("Assets/MelanieCooked/Asset/Item/Fertilizer0.asset"); if (MelanieCookedConfig.immersion.Value) { MeshRenderer component = val.spawnPrefab.GetComponent(); ((Renderer)component).SetSharedMaterials(new List(2) { ((Renderer)component).sharedMaterials[0], bundle.LoadAsset("Assets/MelanieCooked/Material/Soil0.mat") }); } Item(val, MelanieCookedConfig.fertilizer0Cost.Value); Plugin.RegisterRecipe(grinder, itemList[0], new short[1][] { new short[1] }, Array.Empty(), (short)3, (short)3, (short)1, (short)0); Plugin.RegisterRecipe(grinder, itemList[7], new short[1][] { new short[1] { 4 } }, Array.Empty(), (short)3, (short)3, (short)1, (short)0); Plugin.RegisterRecipe(grinder, itemList[49], new short[1][] { new short[1] { 43 } }, Array.Empty(), (short)3, (short)3, (short)1, (short)0); Plugin.RegisterRecipe(blender, itemList[15], new short[1][] { new short[1] { 8 } }, Array.Empty(), (short)3, (short)3, (short)1, (short)0); Plugin.RegisterRecipe(blender, itemList[17], new short[1][] { new short[1] { 9 } }, Array.Empty(), (short)3, (short)3, (short)1, (short)0); Plugin.RegisterRecipe(blender, itemList[23], new short[1][] { new short[1] { 10 } }, Array.Empty(), (short)3, (short)3, (short)1, (short)0); Plugin.RegisterRecipe(blender, itemList[24], new short[1][] { new short[1] { 7 } }, Array.Empty(), (short)3, (short)3, (short)1, (short)0); Plugin.RegisterRecipe(seeder, itemList[57], new short[1][] { new short[1] { 45 } }, Array.Empty(), (short)3, (short)3, (short)1, (short)0); Plugin.RegisterRecipe(seeder, array[0], new short[1][] { new short[1] { 46 } }, Array.Empty(), (short)3, (short)3, (short)1, (short)0); Plugin.RegisterRecipe(seeder, array[1], new short[1][] { new short[1] { 12 } }, Array.Empty(), (short)3, (short)3, (short)1, (short)0); Plugin.RegisterRecipe(seeder, array[2], new short[1][] { new short[1] { 47 } }, Array.Empty(), (short)3, (short)3, (short)1, (short)0); Plugin.RegisterRecipe(seeder, array[3], new short[1][] { new short[1] { 8 } }, Array.Empty(), (short)3, (short)3, (short)1, (short)0); Plugin.RegisterRecipe(seeder, array[4], new short[1][] { new short[1] { 9 } }, Array.Empty(), (short)3, (short)3, (short)1, (short)0); Plugin.RegisterRecipe(crockpot, itemList[12], new short[1][] { new short[2] { 1, 1 } }, Array.Empty(), (short)1, (short)10, (short)1, (short)1); Plugin.RegisterRecipe(crockpot, itemList[58], new short[3][] { new short[2] { 23, 1 }, new short[2] { 16, 1 }, new short[2] { 42, 1 } }, Array.Empty(), (short)3, (short)4, (short)1, (short)5); Plugin.RegisterRecipe(crockpot, itemList[3], new short[1][] { new short[2] { 2, 2 } }, Array.Empty(), (short)4, (short)4, (short)1, (short)5); Plugin.RegisterRecipe(crockpot, itemList[2], new short[1][] { new short[2] { 3, 3 } }, Array.Empty(), (short)3, (short)4, (short)1, (short)6); Plugin.RegisterRecipe(oven, itemList[12], new short[1][] { new short[2] { 1, 1 } }, Array.Empty(), (short)1, (short)10, (short)1, (short)1); Plugin.RegisterRecipe(oven, itemList[27], new short[2][] { new short[2] { 17, 2 }, new short[2] { 16, 1 } }, Array.Empty(), (short)4, (short)4, (short)1, (short)1); Plugin.RegisterRecipe(oven, itemList[9], new short[3][] { new short[2] { 3, 1 }, new short[2] { 2, 1 }, new short[2] { 16, 1 } }, Array.Empty(), (short)3, (short)4, (short)1, (short)2); Plugin.RegisterRecipe(oven, itemList[4], new short[1][] { new short[2] { 2, 3 } }, Array.Empty(), (short)3, (short)4, (short)1, (short)2); Plugin.RegisterRecipe(oven, itemList[4], new short[2][] { new short[2] { 2, 1 }, new short[2] { 3, 2 } }, Array.Empty(), (short)3, (short)4, (short)1, (short)2); Plugin.RegisterRecipe(oven, itemList[8], new short[1][] { new short[2] { 16, 3 } }, Array.Empty(), (short)3, (short)4, (short)1, (short)2); Plugin.RegisterRecipe(oven, itemList[43], new short[2][] { new short[2] { 16, 1 }, new short[2] { 7, 2 } }, Array.Empty(), (short)3, (short)3, (short)2, (short)2); Plugin.RegisterRecipe(oven, itemList[44], new short[3][] { new short[2] { 16, 1 }, new short[2] { 18, 1 }, new short[2] { 28, 1 } }, Array.Empty(), (short)3, (short)4, (short)2, (short)2); Plugin.RegisterRecipe(grill, itemList[12], new short[1][] { new short[2] { 1, 1 } }, Array.Empty(), (short)1, (short)10, (short)1, (short)1); Plugin.RegisterRecipe(grill, itemList[11], new short[3][] { new short[2] { 3, 1 }, new short[2] { 2, 1 }, new short[2] { 16, 1 } }, Array.Empty(), (short)4, (short)4, (short)1, (short)1); Plugin.RegisterRecipe(grill, itemList[10], new short[3][] { new short[2] { 3, 1 }, new short[2] { 2, 1 }, new short[2] { 16, 1 } }, Array.Empty(), (short)3, (short)3, (short)2, (short)2); Plugin.RegisterRecipe(grill, itemList[13], new short[2][] { new short[2] { 16, 1 }, new short[2] { 5, 1 } }, Array.Empty(), (short)3, (short)4, (short)1, (short)2); Plugin.RegisterRecipe(grill, itemList[45], new short[2][] { new short[2] { 16, 1 }, new short[2] { 29, 2 } }, Array.Empty(), (short)3, (short)4, (short)3, (short)2); Plugin.RegisterRecipe(grill, itemList[46], new short[2][] { new short[2] { 2, 2 }, new short[2] { 25, 1 } }, Array.Empty(), (short)3, (short)4, (short)2, (short)2); Plugin.RegisterRecipe(icecreamer, itemList[52], new short[1][] { new short[2] { 13, 1 } }, Array.Empty(), (short)1, (short)2, (short)1, (short)2); Plugin.RegisterRecipe(icecreamer, itemList[53], new short[1][] { new short[2] { 14, 1 } }, Array.Empty(), (short)1, (short)2, (short)1, (short)2); Plugin.RegisterRecipe(icecreamer, itemList[54], new short[1][] { new short[2] { 44, 1 } }, Array.Empty(), (short)1, (short)2, (short)1, (short)2); Plugin.RegisterRecipe(Plugin.workbench, itemList[33], new short[3][] { new short[2] { 21, 1 }, new short[2] { 20, 4 }, new short[2] { 22, 2 } }, new short[1], (short)7, (short)7, (short)1, (short)0); Plugin.RegisterRecipe(Plugin.workbench, itemList[34], new short[2][] { new short[2] { 25, 1 }, new short[2] { 24, 3 } }, Array.Empty(), (short)4, (short)4, (short)1, (short)0); Plugin.RegisterRecipe(Plugin.workbench, itemList[47], new short[2][] { new short[2] { 22, 1 }, new short[2] { 24, 1 } }, Array.Empty(), (short)2, (short)2, (short)1, (short)0); Plugin.RegisterRecipe(Plugin.workbench, itemList[37], new short[2][] { new short[2] { 16, 1 }, new short[2] { 17, 1 } }, Array.Empty(), (short)2, (short)2, (short)1, (short)0); Plugin.RegisterRecipe(Plugin.workbench, itemList[38], new short[2][] { new short[2] { 16, 1 }, new short[2] { 18, 1 } }, Array.Empty(), (short)2, (short)2, (short)1, (short)0); Plugin.RegisterRecipe(Plugin.workbench, itemList[42], new short[2][] { new short[2] { 20, 4 }, new short[2] { 22, 3 } }, new short[1], (short)7, (short)7, (short)1, (short)0); Plugin.RegisterRecipe(Plugin.workbench, itemList[51], new short[4][] { new short[2] { 48, 1 }, new short[2] { 49, 2 }, new short[2] { 50, 1 }, new short[2] { 27, 4 } }, new short[1], (short)8, (short)8, (short)1, (short)0); if (MelanieCookedConfig.enableBurstbush.Value) { LethalLevelLoaderNetworkManager.RegisterNetworkPrefab(bundle.LoadAsset("Assets/MelanieCooked/Prefab/Forage/Bush0.prefab")); } if (!alt) { PatchedContent.RegisterExtendedMod(extMod); } } private void NoBug(Item item, Mesh mesh, Material[] mats, AudioClip clip) { item.spawnPrefab.GetComponent().sharedMesh = mesh; ((Renderer)item.spawnPrefab.GetComponent()).sharedMaterials = mats; item.spawnPrefab.GetComponent().clip = clip; item.grabSFX = clip; item.dropSFX = clip; item.twoHandedAnimation = true; } private void Seed(Seed seed, short grow, short rare, short max) { seed.growChance = grow; seed.rareChance = rare; seed.maxValue = max; } private void Seed(Seed seed, short grow, short max) { seed.growChance = grow; seed.maxValue = max; } private void Unlockable(UnlockableItem unlock, int cost) { //IL_0018: Unknown result type (might be due to invalid IL or missing references) //IL_001d: Unknown result type (might be due to invalid IL or missing references) //IL_0025: Unknown result type (might be due to invalid IL or missing references) //IL_0032: Expected O, but got Unknown if (!alt) { extMod.ExtendedUnlockableItems.Add(new ExtendedUnlockableItem { UnlockableItem = unlock, ItemCost = cost }); } else { UnlockableAlt(unlock, cost); } } private void UnlockableAlt(UnlockableItem unlock, int cost) { DawnLib.RegisterNetworkPrefab(unlock.prefabObject); DawnLib.DefineUnlockable(NamespacedKey.From("MelanieMeliciousCooked", unlock.unlockableName), unlock, (Action)delegate(UnlockableInfoBuilder info) { info.SetCost(cost); }); } private void Item(Item item) { //IL_0018: Unknown result type (might be due to invalid IL or missing references) //IL_001d: Unknown result type (might be due to invalid IL or missing references) //IL_002a: Expected O, but got Unknown if (!alt) { extMod.ExtendedItems.Add(new ExtendedItem { Item = item }); } else { ItemAlt(item); } } private void Item(Item item, int cost = -1) { //IL_0020: Unknown result type (might be due to invalid IL or missing references) //IL_0025: Unknown result type (might be due to invalid IL or missing references) //IL_002d: Unknown result type (might be due to invalid IL or missing references) //IL_003a: Expected O, but got Unknown if (!alt) { item.creditsWorth = cost; extMod.ExtendedItems.Add(new ExtendedItem { Item = item, IsBuyableItem = true }); } else { ItemAlt(item, cost); } } private void ItemAlt(Item item, int cost = -1) { NamespacedKey val = NamespacedKey.From("MelanieMeliciousCooked", ((Object)item).name); DawnLib.RegisterNetworkPrefab(item.spawnPrefab); DawnLib.DefineItem(val, item, (Action)delegate(ItemInfoBuilder itemInfo) { if (cost == -1) { itemInfo.DefineScrap((Action)delegate(ScrapBuilder scrap) { scrap.SetWeights((Action>)delegate { }); }); } else { itemInfo.DefineShop((Action)delegate(ShopBuilder shop) { shop.OverrideCost(cost); }); } }); } } public class Rack : Grower { public NetworkVariable index = new NetworkVariable((short)(-1), (NetworkVariableReadPermission)0, (NetworkVariableWritePermission)0); public Vector3[] place; private short storage; private short grow; private short maxValue; public override void OnNetworkSpawn() { ((NetworkBehaviour)this).OnNetworkSpawn(); HarmonyPatches.growers.Add(this); storage = (short)place.Length; grow = (short)MelanieCookedConfig.alcoholGrow.Value; maxValue = (short)MelanieCookedConfig.alcoholMax.Value; } internal override void Produce() { //IL_0016: Unknown result type (might be due to invalid IL or missing references) //IL_001c: Expected O, but got Unknown //IL_0053: Unknown result type (might be due to invalid IL or missing references) Ingredient val2 = default(Ingredient); foreach (Transform item in ((Component)this).transform) { Transform val = item; if (((Component)val).TryGetComponent(ref val2) && val2.ingredient.Contains(11) && Random.Range(0, 99) < grow) { ProduceClientRpc(NetworkObjectReference.op_Implicit(((Component)val).GetComponent()), (short)Random.Range(1, (int)maxValue)); } } } [ClientRpc] private void ProduceClientRpc(NetworkObjectReference netObjRef, short value) { //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Invalid comparison between Unknown and I4 //IL_00b4: Unknown result type (might be due to invalid IL or missing references) //IL_00be: 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_00a4: Unknown result type (might be due to invalid IL or missing references) //IL_00e9: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager; if (networkManager == null || !networkManager.IsListening) { return; } if ((int)((NetworkBehaviour)this).__rpc_exec_stage != 1 && (networkManager.IsServer || networkManager.IsHost)) { ClientRpcParams val = default(ClientRpcParams); FastBufferWriter val2 = ((NetworkBehaviour)this).__beginSendClientRpc(49798777u, val, (RpcDelivery)0); ((FastBufferWriter)(ref val2)).WriteValueSafe(ref netObjRef, default(ForNetworkSerializable)); BytePacker.WriteValueBitPacked(val2, value); ((NetworkBehaviour)this).__endSendClientRpc(ref val2, 49798777u, val, (RpcDelivery)0); } if ((int)((NetworkBehaviour)this).__rpc_exec_stage == 1 && (networkManager.IsClient || networkManager.IsHost)) { ((NetworkBehaviour)this).__rpc_exec_stage = (__RpcExecStage)0; NetworkObject val3 = default(NetworkObject); if (((NetworkObjectReference)(ref netObjRef)).TryGet(ref val3, (NetworkManager)null)) { GrabbableObject component = ((Component)val3).GetComponent(); component.SetScrapValue(component.scrapValue + value); } } } public async void Place(PlayerControllerB playerWhoTriggered) { PlaceServerRpc(); if (!playerWhoTriggered.isHoldingObject) { return; } GrabbableObject heldItem = playerWhoTriggered.currentlyHeldObjectServer; Ingredient ingredient = default(Ingredient); if (((Component)heldItem).TryGetComponent(ref ingredient) && ingredient.ingredient.Contains(11)) { NetworkObject netObj = ((Component)heldItem).GetComponent(); if (index.Value != storage) { playerWhoTriggered.DiscardHeldObject(false, (NetworkObject)null, default(Vector3), true); await Task.Delay(350); PlaceSyncServerRpc(NetworkObjectReference.op_Implicit(netObj), index.Value); } } } [ServerRpc(RequireOwnership = false)] private void PlaceServerRpc() { //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Invalid comparison between Unknown and I4 //IL_008c: Unknown result type (might be due to invalid IL or missing references) //IL_0096: 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_007c: 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_00de: Unknown result type (might be due to invalid IL or missing references) //IL_00e4: Expected O, but got Unknown //IL_00ec: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager; if (networkManager == null || !networkManager.IsListening) { return; } if ((int)((NetworkBehaviour)this).__rpc_exec_stage != 1 && (networkManager.IsClient || networkManager.IsHost)) { ServerRpcParams val = default(ServerRpcParams); FastBufferWriter val2 = ((NetworkBehaviour)this).__beginSendServerRpc(2660727742u, val, (RpcDelivery)0); ((NetworkBehaviour)this).__endSendServerRpc(ref val2, 2660727742u, val, (RpcDelivery)0); } if ((int)((NetworkBehaviour)this).__rpc_exec_stage != 1 || (!networkManager.IsServer && !networkManager.IsHost)) { return; } ((NetworkBehaviour)this).__rpc_exec_stage = (__RpcExecStage)0; short num = 0; foreach (Transform item in ((Component)this).transform) { Transform val3 = item; PlaceClientRpc(NetworkObjectReference.op_Implicit(((Component)val3).GetComponent()), num); num++; } index.Value = num; } [ServerRpc(RequireOwnership = false)] private void PlaceSyncServerRpc(NetworkObjectReference netObjRef, short index) { //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Invalid comparison between Unknown and I4 //IL_00b4: Unknown result type (might be due to invalid IL or missing references) //IL_00be: 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_00a4: Unknown result type (might be due to invalid IL or missing references) //IL_00e9: Unknown result type (might be due to invalid IL or missing references) //IL_00ef: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager; if (networkManager != null && networkManager.IsListening) { if ((int)((NetworkBehaviour)this).__rpc_exec_stage != 1 && (networkManager.IsClient || networkManager.IsHost)) { ServerRpcParams val = default(ServerRpcParams); FastBufferWriter val2 = ((NetworkBehaviour)this).__beginSendServerRpc(689667366u, val, (RpcDelivery)0); ((FastBufferWriter)(ref val2)).WriteValueSafe(ref netObjRef, default(ForNetworkSerializable)); BytePacker.WriteValueBitPacked(val2, index); ((NetworkBehaviour)this).__endSendServerRpc(ref val2, 689667366u, val, (RpcDelivery)0); } if ((int)((NetworkBehaviour)this).__rpc_exec_stage == 1 && (networkManager.IsServer || networkManager.IsHost)) { ((NetworkBehaviour)this).__rpc_exec_stage = (__RpcExecStage)0; PlaceClientRpc(netObjRef, index); } } } [ClientRpc] private void PlaceClientRpc(NetworkObjectReference netObjRef, short index) { //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Invalid comparison between Unknown and I4 //IL_00b4: Unknown result type (might be due to invalid IL or missing references) //IL_00be: 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_00a4: Unknown result type (might be due to invalid IL or missing references) //IL_00e9: Unknown result type (might be due to invalid IL or missing references) //IL_0134: Unknown result type (might be due to invalid IL or missing references) //IL_0169: Unknown result type (might be due to invalid IL or missing references) //IL_016e: Unknown result type (might be due to invalid IL or missing references) //IL_017b: Unknown result type (might be due to invalid IL or missing references) //IL_0180: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager; if (networkManager == null || !networkManager.IsListening) { return; } if ((int)((NetworkBehaviour)this).__rpc_exec_stage != 1 && (networkManager.IsServer || networkManager.IsHost)) { ClientRpcParams val = default(ClientRpcParams); FastBufferWriter val2 = ((NetworkBehaviour)this).__beginSendClientRpc(635362193u, val, (RpcDelivery)0); ((FastBufferWriter)(ref val2)).WriteValueSafe(ref netObjRef, default(ForNetworkSerializable)); BytePacker.WriteValueBitPacked(val2, index); ((NetworkBehaviour)this).__endSendClientRpc(ref val2, 635362193u, val, (RpcDelivery)0); } if ((int)((NetworkBehaviour)this).__rpc_exec_stage != 1 || (!networkManager.IsClient && !networkManager.IsHost)) { return; } ((NetworkBehaviour)this).__rpc_exec_stage = (__RpcExecStage)0; NetworkObject val3 = default(NetworkObject); if (((NetworkObjectReference)(ref netObjRef)).TryGet(ref val3, (NetworkManager)null)) { if ((Object)(object)((Component)val3).transform.parent != (Object)(object)((Component)this).transform) { ((Component)val3).transform.SetParent(((Component)this).transform, true); } ((Component)val3).transform.localRotation = Quaternion.identity; GrabbableObject component = ((Component)val3).GetComponent(); component.isHeld = false; component.isPocketed = false; component.heldByPlayerOnServer = false; component.parentObject = null; component.startFallingPosition = ((Component)component).transform.localPosition; component.targetFloorPosition = place[index]; } } public override void OnNetworkDespawn() { ((NetworkVariableBase)index).Dispose(); } protected override void __initializeVariables() { if (index == null) { throw new Exception("Rack.index cannot be null. All NetworkVariableBase instances must be initialized."); } ((NetworkVariableBase)index).Initialize((NetworkBehaviour)(object)this); ((NetworkBehaviour)this).__nameNetworkVariable((NetworkVariableBase)(object)index, "index"); ((NetworkBehaviour)this).NetworkVariableFields.Add((NetworkVariableBase)(object)index); base.__initializeVariables(); } protected override void __initializeRpcs() { //IL_000d: Unknown result type (might be due to invalid IL or missing references) //IL_001c: Expected O, but got Unknown //IL_0029: Unknown result type (might be due to invalid IL or missing references) //IL_0038: Expected O, but got Unknown //IL_0045: Unknown result type (might be due to invalid IL or missing references) //IL_0054: Expected O, but got Unknown //IL_0061: Unknown result type (might be due to invalid IL or missing references) //IL_0070: Expected O, but got Unknown ((NetworkBehaviour)this).__registerRpc(49798777u, new RpcReceiveHandler(__rpc_handler_49798777), "ProduceClientRpc"); ((NetworkBehaviour)this).__registerRpc(2660727742u, new RpcReceiveHandler(__rpc_handler_2660727742), "PlaceServerRpc"); ((NetworkBehaviour)this).__registerRpc(689667366u, new RpcReceiveHandler(__rpc_handler_689667366), "PlaceSyncServerRpc"); ((NetworkBehaviour)this).__registerRpc(635362193u, new RpcReceiveHandler(__rpc_handler_635362193), "PlaceClientRpc"); base.__initializeRpcs(); } private static void __rpc_handler_49798777(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_0051: 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_006f: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = target.NetworkManager; if (networkManager != null && networkManager.IsListening) { NetworkObjectReference netObjRef = default(NetworkObjectReference); ((FastBufferReader)(ref reader)).ReadValueSafe(ref netObjRef, default(ForNetworkSerializable)); short value = default(short); ByteUnpacker.ReadValueBitPacked(reader, ref value); target.__rpc_exec_stage = (__RpcExecStage)1; ((Rack)(object)target).ProduceClientRpc(netObjRef, value); target.__rpc_exec_stage = (__RpcExecStage)0; } } private static void __rpc_handler_2660727742(NetworkBehaviour target, FastBufferReader reader, __RpcParams rpcParams) { //IL_0029: 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) NetworkManager networkManager = target.NetworkManager; if (networkManager != null && networkManager.IsListening) { target.__rpc_exec_stage = (__RpcExecStage)1; ((Rack)(object)target).PlaceServerRpc(); target.__rpc_exec_stage = (__RpcExecStage)0; } } private static void __rpc_handler_689667366(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_0051: 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_006f: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = target.NetworkManager; if (networkManager != null && networkManager.IsListening) { NetworkObjectReference netObjRef = default(NetworkObjectReference); ((FastBufferReader)(ref reader)).ReadValueSafe(ref netObjRef, default(ForNetworkSerializable)); short num = default(short); ByteUnpacker.ReadValueBitPacked(reader, ref num); target.__rpc_exec_stage = (__RpcExecStage)1; ((Rack)(object)target).PlaceSyncServerRpc(netObjRef, num); target.__rpc_exec_stage = (__RpcExecStage)0; } } private static void __rpc_handler_635362193(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_0051: 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_006f: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = target.NetworkManager; if (networkManager != null && networkManager.IsListening) { NetworkObjectReference netObjRef = default(NetworkObjectReference); ((FastBufferReader)(ref reader)).ReadValueSafe(ref netObjRef, default(ForNetworkSerializable)); short num = default(short); ByteUnpacker.ReadValueBitPacked(reader, ref num); target.__rpc_exec_stage = (__RpcExecStage)1; ((Rack)(object)target).PlaceClientRpc(netObjRef, num); target.__rpc_exec_stage = (__RpcExecStage)0; } } protected internal override string __getTypeName() { return "Rack"; } } public class SavePatches { private const string versionSaveKey = "MelanieMeliciousFarmingVersion"; private const string plotSaveKey = "MelanieMeliciousFarmingPlot"; private const string barrelSaveKey = "MelanieMeliciousFarmingBarrel"; private const string apiarySaveKey = "MelanieMeliciousFarmingApiary"; private const short currentVersion = 2; [HarmonyPrefix] [HarmonyPatch(typeof(GameNetworkManager), "SaveGameValues")] private static void SaveGrowers() { //IL_0181: Unknown result type (might be due to invalid IL or missing references) //IL_018b: Expected O, but got Unknown //IL_01c9: Unknown result type (might be due to invalid IL or missing references) //IL_01d3: Expected O, but got Unknown //IL_0213: Unknown result type (might be due to invalid IL or missing references) //IL_021d: Expected O, but got Unknown if (!((NetworkBehaviour)StartOfRound.Instance).IsServer) { return; } try { string currentSaveFileName = GameNetworkManager.Instance.currentSaveFileName; List list = new List(); List list2 = new List(); List list3 = new List(); foreach (Grower grower in HarmonyPatches.growers) { if (!((Object)(object)grower == (Object)null)) { if (((object)grower).GetType() == typeof(Plot)) { Plot plot = (Plot)grower; list.Add(plot.save.GetInfo()); } else if (((object)grower).GetType() == typeof(Barrel)) { Barrel barrel = (Barrel)grower; list2.Add(barrel.save.GetInfo()); } else if (((object)grower).GetType() == typeof(Apiary)) { Apiary apiary = (Apiary)grower; list3.Add(apiary.save.GetInfo()); } } } ES3.Save("MelanieMeliciousFarmingVersion", (short)2, currentSaveFileName); if (list.Count == 0) { ES3.DeleteKey("MelanieMeliciousFarmingPlot", currentSaveFileName); } else { ES3.Save("MelanieMeliciousFarmingPlot", JsonConvert.SerializeObject((object)list.ToArray()), currentSaveFileName, new ES3Settings(new Enum[1] { (Enum)(object)(ReferenceMode)0 })); } if (list2.Count == 0) { ES3.DeleteKey("MelanieMeliciousFarmingBarrel", currentSaveFileName); } else { ES3.Save("MelanieMeliciousFarmingBarrel", JsonConvert.SerializeObject((object)list2.ToArray()), currentSaveFileName, new ES3Settings(new Enum[1] { (Enum)(object)(ReferenceMode)0 })); } if (list3.Count == 0) { ES3.DeleteKey("MelanieMeliciousFarmingApiary", currentSaveFileName); return; } ES3.Save("MelanieMeliciousFarmingApiary", JsonConvert.SerializeObject((object)list3.ToArray()), currentSaveFileName, new ES3Settings(new Enum[1] { (Enum)(object)(ReferenceMode)0 })); } catch { Plugin.mls.LogError((object)"Issue while saving Farming and Cooking custom info. Aborting to prevent save break."); } } [HarmonyPostfix] [HarmonyPatch(typeof(StartOfRound), "LoadAttachedVehicle")] private static void LoadGrowers(StartOfRound __instance) { //IL_0345: Unknown result type (might be due to invalid IL or missing references) //IL_034a: Unknown result type (might be due to invalid IL or missing references) //IL_0351: Unknown result type (might be due to invalid IL or missing references) //IL_0356: Unknown result type (might be due to invalid IL or missing references) //IL_01d3: Unknown result type (might be due to invalid IL or missing references) //IL_01d8: Unknown result type (might be due to invalid IL or missing references) //IL_01fa: Unknown result type (might be due to invalid IL or missing references) //IL_01ff: Unknown result type (might be due to invalid IL or missing references) if (!((NetworkBehaviour)__instance).IsServer) { return; } try { string currentSaveFileName = GameNetworkManager.Instance.currentSaveFileName; if (!ES3.KeyExists("MelanieMeliciousFarmingVersion", currentSaveFileName)) { return; } short num = ES3.Load("MelanieMeliciousFarmingVersion", currentSaveFileName); List list = new List(); List list2 = new List(); List list3 = new List(); foreach (Grower grower in HarmonyPatches.growers) { if (((object)grower).GetType() == typeof(Plot)) { list.Add((Plot)grower); } else if (((object)grower).GetType() == typeof(Barrel)) { list2.Add((Barrel)grower); } else if (((object)grower).GetType() == typeof(Apiary)) { list3.Add((Apiary)grower); } } if (num != 0 && ES3.KeyExists("MelanieMeliciousFarmingPlot", currentSaveFileName) && list.Count != 0) { Plot.Save[] array = JsonConvert.DeserializeObject(ES3.Load("MelanieMeliciousFarmingPlot", currentSaveFileName)).ToArray(); Plot.Save[] array2 = array; foreach (Plot.Save save in array2) { foreach (Plot item in list) { if (item.produceIndex != -1 || item.type != save.type || save.produce == -1) { continue; } try { item.posMin = new Vector3(save.posMin[0], save.posMin[1], save.posMin[2]); item.posMax = new Vector3(save.posMax[0], save.posMax[1], save.posMax[2]); item.cropID = save.cropID; item.cropStages = save.cropStages; item.produce = Plugin.itemList[save.produce]; if (save.produceRare != -1) { item.produceRare = Plugin.itemList[save.produceRare]; } item.produceIndex = save.produce; item.produceRareIndex = save.produceRare; item.useNitrogen = save.useNitrogen; item.usePhosphorous = save.usePhosphorous; item.usePotassium = save.usePotassium; item.life = save.life; item.growChance = save.growChance; if (ES3.Load("MelanieMeliciousFarmingVersion", currentSaveFileName) >= 2) { item.rareChance = save.rareChance; } else { item.rareChance = (short)MelanieCookedConfig.rareGrow.Value; } item.maxValue = save.maxValue; item.canAge = save.canAge; item.SyncData(); list.Remove(item); } catch { Plugin.mls.LogError((object)"Issue while loading current plot data. Loading defaults and progressing to next plot."); item.posMin = Vector3.zero; item.posMax = Vector3.zero; item.cropID = -1; item.cropStages = Array.Empty(); item.produce = null; item.produceRare = null; item.produceIndex = -1; item.produceRareIndex = -1; item.useNitrogen = 0; item.usePhosphorous = 0; item.usePotassium = 0; item.life = 0; item.growChance = 0; item.maxValue = 0; item.canAge = save.canAge; item.SyncData(); } break; } } } if (ES3.KeyExists("MelanieMeliciousFarmingBarrel", currentSaveFileName) && list2.Count != 0) { Barrel.Save[] array3 = JsonConvert.DeserializeObject(ES3.Load("MelanieMeliciousFarmingBarrel", currentSaveFileName)).ToArray(); short num2 = 0; Barrel.Save[] array4 = array3; foreach (Barrel.Save save2 in array4) { Barrel barrel = list2[num2]; barrel.ogValue = save2.ogValue; barrel.LoadSaveServerRpc(save2.index, save2.inputSync); num2++; } } if (ES3.KeyExists("MelanieMeliciousFarmingApiary", currentSaveFileName) && list3.Count != 0) { Apiary.Save[] array5 = JsonConvert.DeserializeObject(ES3.Load("MelanieMeliciousFarmingApiary", currentSaveFileName)).ToArray(); short num3 = 0; Apiary.Save[] array6 = array5; foreach (Apiary.Save save3 in array6) { Apiary apiary = list3[num3]; apiary.queenIndex = save3.queenIndex; apiary.queen = save3.queen; apiary.hiveIndex = save3.hiveIndex; apiary.hives = save3.hives; apiary.queenValue = save3.queenValue; apiary.queenMulti = save3.queenMulti; apiary.hiveMulti = save3.hiveMulti; apiary.LoadSaveServerRpc(save3.queen, save3.hives); num3++; } } } catch { Plugin.mls.LogError((object)"Issue while loading Farming and Cooking custom info. Aborting to prevent save break."); } } } public class Seed : MonoBehaviour { public GameObject[] crop; public Item produce; public Item produceRare; public Vector3 posMin; public Vector3 posMax; public short type; public short useNitrogen; public short usePhosphorous; public short usePotassium; public short maxValue; public short growChance; public short rareChance; public bool canAge; } public class SeedMaker : Refine { public override void OnNetworkSpawn() { ((Refine)this).OnNetworkSpawn(); base.recipeList = Plugin.seeder.ToArray(); } protected override void __initializeVariables() { ((Refine)this).__initializeVariables(); } protected override void __initializeRpcs() { ((Refine)this).__initializeRpcs(); } protected internal override string __getTypeName() { return "SeedMaker"; } } } namespace __GEN { internal class NetworkVariableSerializationHelper { [RuntimeInitializeOnLoadMethod] internal static void InitializeSerialization() { NetworkVariableSerializationTypes.InitializeSerializer_UnmanagedByMemcpy(); NetworkVariableSerializationTypes.InitializeEqualityChecker_UnmanagedIEquatable(); } } } namespace MelanieMeliciousCooked.NetcodePatcher { [AttributeUsage(AttributeTargets.Module)] internal class NetcodePatchedAssemblyAttribute : Attribute { } }