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] [Embedded] internal sealed class EmbeddedAttribute : Attribute { } } namespace System.Runtime.CompilerServices { [CompilerGenerated] [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] [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] [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 val2 = default(ClientRpcParams); FastBufferWriter val = ((NetworkBehaviour)this).__beginSendClientRpc(1314207286u, val2, (RpcDelivery)0); ((FastBufferWriter)(ref val)).WriteValueSafe(ref netObjRef, default(ForNetworkSerializable)); BytePacker.WriteValueBitPacked(val, value); ((NetworkBehaviour)this).__endSendClientRpc(ref val, 1314207286u, val2, (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 enableAnglowbush; internal static ConfigEntry enableMandrake; 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 anglowBerryGrow0; internal static ConfigEntry anglowBerryGrow1; internal static ConfigEntry mandrakeGrow0; 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 anglowSpawn0; internal static ConfigEntry anglowSpawn1; internal static ConfigEntry anglowSpawn2; internal static ConfigEntry mandrakeSpawn0; internal static ConfigEntry mandrakeSpawn1; internal static ConfigEntry mandrakeSpawn2; 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 anglowBerry0Max; internal static ConfigEntry mandrake1Max; 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 alcoholList; internal static ConfigEntry milkList; internal static ConfigEntry eggList; internal static ConfigEntry fishList; internal static ConfigEntry oilList; 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."); enableAnglowbush = config.Bind("Features", "Enable Anglowberry Lures", true, "Toggle anglowberry lures."); enableMandrake = config.Bind("Features", "Enable Mandrakes", true, "Toggle mandrakes."); 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."); anglowBerryGrow0 = config.Bind("Growth Chance", "Anglowberry", 18, "Modify the chance for anglowberries to progress growing phase per hour."); anglowBerryGrow1 = config.Bind("Growth Chance", "Anglowberry Success", 40, "Modify the chance for anglowberry lures to be successfully harvested."); mandrakeGrow0 = config.Bind("Growth Chance", "Mandrake", 18, "Modify the chance for mandrakes to progress growing phase per hour."); 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."); anglowSpawn0 = config.Bind("Spawn Chance", "Anglowberry Lure Global", 7, "Modify the weights for anglowberry lures spawning on any moon."); anglowSpawn1 = config.Bind("Spawn Chance", "Anglowberry Lure By Tag", "", "Modify the weights for anglowberry lures spawning on moons with certain tags."); anglowSpawn2 = config.Bind("Spawn Chance", "Anglowberry Lure By Key", "", "Modify the weights for anglowberry lures spawning on moons by certain keys."); mandrakeSpawn0 = config.Bind("Spawn Chance", "Mandrake Global", 1, "Modify the weights for mandrakes spawning on any moon."); mandrakeSpawn1 = config.Bind("Spawn Chance", "Mandrake By Tag", "lethal_company:forest:4,lethal_company:valley:4", "Modify the weights for mandrakes spawning on moons with certain tags."); mandrakeSpawn2 = config.Bind("Spawn Chance", "Mandrake By Key", "", "Modify the weights for mandrakes 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, "No longer used."); cookRange1 = config.Bind("Item Value", "Cooking Value Maximum MULTIPLIER", 0.25f, "No longer used."); 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."); anglowBerry0Max = config.Bind("Item Value", "Anglowberry Value Maximum", 35, "Change the maximum value of foraged anglowberries."); mandrake1Max = config.Bind("Item Value", "Mandrake Value Maximum", 25, "Change the maximum value of foraged mandrakes."); 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."); alcoholList = config.Bind("Custom Ingredients", "Cook as Alcohol", "", "This is alcomohol."); milkList = config.Bind("Custom Ingredients", "Cook as Milk", "", "This is milk."); eggList = config.Bind("Custom Ingredients", "Cook as Egg", "", "This is egg."); fishList = config.Bind("Custom Ingredients", "Cook as Fish", "", "This is fish."); oilList = config.Bind("Custom Ingredients", "Cook as Oil", "", "This is (cooking) oil."); 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] internal Animator animator; [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 AnglowBerry : Forage, IHittable { [SerializeField] private Transform harvest; private short hp = 4; bool IHittable.Hit(int force, Vector3 hitDirection, PlayerControllerB playerWhoHit, bool playHitSFX, int hitID = -1) { if (hp == 0) { return false; } hp--; if (hp == 0) { AnimateServerRpc(1293411866); HarvestServerRpc(set: false); GrownServerRpc(set: false); } else { AnimateServerRpc(1654612129); } return true; } public override void Boom() { //IL_0007: 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_0045: Unknown result type (might be due to invalid IL or missing references) //IL_008f: Unknown result type (might be due to invalid IL or missing references) //IL_0095: Unknown result type (might be due to invalid IL or missing references) //IL_00ea: Unknown result type (might be due to invalid IL or missing references) //IL_00f0: Unknown result type (might be due to invalid IL or missing references) Collider[] array = Physics.OverlapSphere(((Component)this).transform.position, 3f, Forage.layerMask, (QueryTriggerInteraction)2); PlayerControllerB val = null; bool flag = false; Collider[] array2 = array; foreach (Collider val2 in array2) { float num = Vector3.Distance(((Component)this).transform.position, ((Component)val2).transform.position); if (((Component)val2).gameObject.layer == 3 && !flag && ((Component)val2).gameObject.TryGetComponent(ref val) && ((NetworkBehaviour)val).IsOwner) { flag = true; val.DamagePlayer(30, true, true, (CauseOfDeath)6, 0, false, default(Vector3)); } else if (((Component)val2).gameObject.layer == 19) { EnemyAICollisionDetect componentInChildren = ((Component)val2).GetComponentInChildren(); if ((Object)(object)componentInChildren != (Object)null && ((NetworkBehaviour)componentInChildren.mainScript).IsOwner) { componentInChildren.mainScript.HitEnemyOnLocalClient(3, default(Vector3), (PlayerControllerB)null, false, -1); componentInChildren.mainScript.HitFromExplosion(num * 2.5f); } } } } internal override void Produce() { if (!grown && Random.Range(0, 99) <= Forage.grow0) { AnimateClientRpc(362874043); HarvestClientRpc(set: true); RegenClientRpc(); grown = true; } } public void Harvest() { if (Random.Range(0, 99) < Forage.grow1) { SpawnItemServerRpc(); AnimateServerRpc(1654612129); } else { AnimateServerRpc(567580192); } HarvestServerRpc(set: false); } [ServerRpc(RequireOwnership = false)] private void HarvestServerRpc(bool set) { //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) { if ((int)((NetworkBehaviour)this).__rpc_exec_stage != 1 && (networkManager.IsClient || networkManager.IsHost)) { ServerRpcParams val2 = default(ServerRpcParams); FastBufferWriter val = ((NetworkBehaviour)this).__beginSendServerRpc(1231791944u, val2, (RpcDelivery)0); ((FastBufferWriter)(ref val)).WriteValueSafe(ref set, default(ForPrimitives)); ((NetworkBehaviour)this).__endSendServerRpc(ref val, 1231791944u, val2, (RpcDelivery)0); } if ((int)((NetworkBehaviour)this).__rpc_exec_stage == 1 && (networkManager.IsServer || networkManager.IsHost)) { ((NetworkBehaviour)this).__rpc_exec_stage = (__RpcExecStage)0; HarvestClientRpc(set); } } } [ClientRpc] private void HarvestClientRpc(bool set) { //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) { if ((int)((NetworkBehaviour)this).__rpc_exec_stage != 1 && (networkManager.IsServer || networkManager.IsHost)) { ClientRpcParams val2 = default(ClientRpcParams); FastBufferWriter val = ((NetworkBehaviour)this).__beginSendClientRpc(1940142840u, val2, (RpcDelivery)0); ((FastBufferWriter)(ref val)).WriteValueSafe(ref set, default(ForPrimitives)); ((NetworkBehaviour)this).__endSendClientRpc(ref val, 1940142840u, val2, (RpcDelivery)0); } if ((int)((NetworkBehaviour)this).__rpc_exec_stage == 1 && (networkManager.IsClient || networkManager.IsHost)) { ((NetworkBehaviour)this).__rpc_exec_stage = (__RpcExecStage)0; ((Component)harvest).gameObject.SetActive(set); } } } public override void OnNetworkSpawn() { if (((NetworkBehaviour)this).IsHost) { HarmonyPatches.forage.Add(this); HarvestServerRpc(set: false); } } [ClientRpc] private void RegenClientRpc() { //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.IsServer || networkManager.IsHost)) { ClientRpcParams val2 = default(ClientRpcParams); FastBufferWriter val = ((NetworkBehaviour)this).__beginSendClientRpc(2633452534u, val2, (RpcDelivery)0); ((NetworkBehaviour)this).__endSendClientRpc(ref val, 2633452534u, val2, (RpcDelivery)0); } if ((int)((NetworkBehaviour)this).__rpc_exec_stage == 1 && (networkManager.IsClient || networkManager.IsHost)) { ((NetworkBehaviour)this).__rpc_exec_stage = (__RpcExecStage)0; hp = 4; } } } private void Start() { //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_0023: Unknown result type (might be due to invalid IL or missing references) //IL_0028: 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_0058: Unknown result type (might be due to invalid IL or missing references) //IL_0070: Unknown result type (might be due to invalid IL or missing references) //IL_0086: Unknown result type (might be due to invalid IL or missing references) //IL_009b: Unknown result type (might be due to invalid IL or missing references) RaycastHit val = default(RaycastHit); if (((NetworkBehaviour)this).IsHost && 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); } } 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 ((NetworkBehaviour)this).__registerRpc(1231791944u, new RpcReceiveHandler(__rpc_handler_1231791944), "HarvestServerRpc"); ((NetworkBehaviour)this).__registerRpc(1940142840u, new RpcReceiveHandler(__rpc_handler_1940142840), "HarvestClientRpc"); ((NetworkBehaviour)this).__registerRpc(2633452534u, new RpcReceiveHandler(__rpc_handler_2633452534), "RegenClientRpc"); base.__initializeRpcs(); } private static void __rpc_handler_1231791944(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 set = default(bool); ((FastBufferReader)(ref reader)).ReadValueSafe(ref set, default(ForPrimitives)); target.__rpc_exec_stage = (__RpcExecStage)1; ((AnglowBerry)(object)target).HarvestServerRpc(set); target.__rpc_exec_stage = (__RpcExecStage)0; } } private static void __rpc_handler_1940142840(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 set = default(bool); ((FastBufferReader)(ref reader)).ReadValueSafe(ref set, default(ForPrimitives)); target.__rpc_exec_stage = (__RpcExecStage)1; ((AnglowBerry)(object)target).HarvestClientRpc(set); target.__rpc_exec_stage = (__RpcExecStage)0; } } private static void __rpc_handler_2633452534(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; ((AnglowBerry)(object)target).RegenClientRpc(); target.__rpc_exec_stage = (__RpcExecStage)0; } } protected internal override string __getTypeName() { return "AnglowBerry"; } } public class Apiary : Grower { [ES3Serializable] internal class Save(Apiary __instance) { public short queenIndex = -1; public bool queen = false; public short[] hiveIndex = new short[3] { -1, -1, -1 }; public short hives = 0; public int queenValue = 0; public float queenMulti = 1f; public float hiveMulti = 1f; internal Save GetInfo() { queenIndex = __instance.queenIndex; queen = __instance.queen; hiveIndex = __instance.hiveIndex; hives = __instance.hives; queenValue = __instance.queenValue; queenMulti = __instance.queenMulti; hiveMulti = __instance.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 float synergyMulti = 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[3] { Plugin.itemList[31], Plugin.itemList[33], Plugin.itemList[63] })); 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 val2 = default(ServerRpcParams); FastBufferWriter val = ((NetworkBehaviour)this).__beginSendServerRpc(2208851517u, val2, (RpcDelivery)0); ((FastBufferWriter)(ref val)).WriteValueSafe(ref queenLoad, default(ForPrimitives)); BytePacker.WriteValueBitPacked(val, hiveLoad); ((NetworkBehaviour)this).__endSendServerRpc(ref val, 2208851517u, val2, (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_0139: Unknown result type (might be due to invalid IL or missing references) //IL_0144: Unknown result type (might be due to invalid IL or missing references) //IL_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_016e: 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) 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 (hiveIndex[i] == queenIndex) { synergyMulti = 1.05f; } else { synergyMulti = 1f; } if (val.TryGetComponent(ref bee)) { NetworkObject component = val.GetComponent(); component.Spawn(false); AgeClientRpc(NetworkObjectReference.op_Implicit(component), (short)((float)queenValue * queenMulti + (float)Random.Range(5, (int)maxValue) * hiveMulti * synergyMulti), harvest: true); } } } GameObject val2 = Object.Instantiate(queenList[queenIndex].spawnPrefab, ((Component)this).transform.position, ((Component)this).transform.rotation, ((Component)this).transform); NetworkObject val3 = default(NetworkObject); if (val2.TryGetComponent(ref val3)) { val3.Spawn(false); AgeClientRpc(NetworkObjectReference.op_Implicit(val3), 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 val2 = default(ClientRpcParams); FastBufferWriter val = ((NetworkBehaviour)this).__beginSendClientRpc(1714685434u, val2, (RpcDelivery)0); ((FastBufferWriter)(ref val)).WriteValueSafe(ref netObjRef, default(ForNetworkSerializable)); BytePacker.WriteValueBitPacked(val, value); ((FastBufferWriter)(ref val)).WriteValueSafe(ref harvest, default(ForPrimitives)); ((NetworkBehaviour)this).__endSendClientRpc(ref val, 1714685434u, val2, (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)) { ((Component)val3).GetComponent().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 val2 = default(ServerRpcParams); FastBufferWriter val = ((NetworkBehaviour)this).__beginSendServerRpc(1201096395u, val2, (RpcDelivery)0); ((FastBufferWriter)(ref val)).WriteValueSafe(ref isQueen, default(ForPrimitives)); BytePacker.WriteValueBitPacked(val, type); ((FastBufferWriter)(ref val)).WriteValueSafe(ref multiplier, default(ForPrimitives)); BytePacker.WriteValueBitPacked(val, value); ((NetworkBehaviour)this).__endSendServerRpc(ref val, 1201096395u, val2, (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 val2 = default(ClientRpcParams); FastBufferWriter val = ((NetworkBehaviour)this).__beginSendClientRpc(950914400u, val2, (RpcDelivery)0); ((FastBufferWriter)(ref val)).WriteValueSafe(ref isQueen, default(ForPrimitives)); ((NetworkBehaviour)this).__endSendClientRpc(ref val, 950914400u, val2, (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 val2 = default(ClientRpcParams); FastBufferWriter val = ((NetworkBehaviour)this).__beginSendClientRpc(1825899610u, val2, (RpcDelivery)0); ((NetworkBehaviour)this).__endSendClientRpc(ref val, 1825899610u, val2, (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(Barrel __instance) { public short index; public short inputSync; public short ogValue; internal Save GetInfo() { index = __instance.index.Value; inputSync = __instance.inputSync.Value; ogValue = __instance.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 val2 = default(ServerRpcParams); FastBufferWriter val = ((NetworkBehaviour)this).__beginSendServerRpc(872338705u, val2, (RpcDelivery)0); BytePacker.WriteValueBitPacked(val, indexLoad); BytePacker.WriteValueBitPacked(val, inputLoad); ((NetworkBehaviour)this).__endSendServerRpc(ref val, 872338705u, val2, (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 val2 = default(ClientRpcParams); FastBufferWriter val = ((NetworkBehaviour)this).__beginSendClientRpc(4080424806u, val2, (RpcDelivery)0); ((FastBufferWriter)(ref val)).WriteValueSafe(ref netObjRef, default(ForNetworkSerializable)); BytePacker.WriteValueBitPacked(val, value); ((NetworkBehaviour)this).__endSendClientRpc(ref val, 4080424806u, val2, (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 val2 = default(ServerRpcParams); FastBufferWriter val = ((NetworkBehaviour)this).__beginSendServerRpc(3891749198u, val2, (RpcDelivery)0); ((FastBufferWriter)(ref val)).WriteValueSafe(ref netObjRef, default(ForNetworkSerializable)); BytePacker.WriteValueBitPacked(val, value); ((NetworkBehaviour)this).__endSendServerRpc(ref val, 3891749198u, val2, (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 val2 = default(ClientRpcParams); FastBufferWriter val = ((NetworkBehaviour)this).__beginSendClientRpc(1516274574u, val2, (RpcDelivery)0); ((FastBufferWriter)(ref val)).WriteValueSafe(ref netObjRef, default(ForNetworkSerializable)); ((NetworkBehaviour)this).__endSendClientRpc(ref val, 1516274574u, val2, (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 val2 = default(ServerRpcParams); FastBufferWriter val = ((NetworkBehaviour)this).__beginSendServerRpc(3241937993u, val2, (RpcDelivery)0); ((NetworkBehaviour)this).__endSendServerRpc(ref val, 3241937993u, val2, (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 val2 = default(ClientRpcParams); FastBufferWriter val = ((NetworkBehaviour)this).__beginSendClientRpc(2912601765u, val2, (RpcDelivery)0); ((NetworkBehaviour)this).__endSendClientRpc(ref val, 2912601765u, val2, (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; [SerializeField] internal GameObject harvest; 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_00de: 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_0115: Unknown result type (might be due to invalid IL or missing references) //IL_0120: Unknown result type (might be due to invalid IL or missing references) //IL_0163: 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) { return; } if ((int)base.__rpc_exec_stage != 1 && (networkManager.IsClient || networkManager.IsHost)) { ServerRpcParams val2 = default(ServerRpcParams); FastBufferWriter val = ((NetworkBehaviour)this).__beginSendServerRpc(83991266u, val2, (RpcDelivery)0); ((NetworkBehaviour)this).__endSendServerRpc(ref val, 83991266u, val2, (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[29].spawnPrefab, ((Component)this).transform.position, ((Component)this).transform.rotation, StartOfRound.Instance.elevatorTransform); GameObject val4 = Object.Instantiate(Plugin.itemList[30].spawnPrefab, ((Component)this).transform.position, ((Component)this).transform.rotation, StartOfRound.Instance.elevatorTransform); NetworkObject val5 = default(NetworkObject); NetworkObject val6 = default(NetworkObject); if (val3.TryGetComponent(ref val5) && val4.TryGetComponent(ref val6)) { val5.Spawn(false); val6.Spawn(false); SpawnItemClientRpc(NetworkObjectReference.op_Implicit(val5), NetworkObjectReference.op_Implicit(val6)); } } } [ClientRpc] private void SpawnItemClientRpc(NetworkObjectReference netObjRef0, NetworkObjectReference netObjRef1) { //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Invalid comparison between Unknown and I4 //IL_00c2: Unknown result type (might be due to invalid IL or missing references) //IL_00cc: 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_00b2: 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) NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager; if (networkManager == null || !networkManager.IsListening) { return; } if ((int)base.__rpc_exec_stage != 1 && (networkManager.IsServer || networkManager.IsHost)) { ClientRpcParams val2 = default(ClientRpcParams); FastBufferWriter val = ((NetworkBehaviour)this).__beginSendClientRpc(1255996219u, val2, (RpcDelivery)0); ((FastBufferWriter)(ref val)).WriteValueSafe(ref netObjRef0, default(ForNetworkSerializable)); ((FastBufferWriter)(ref val)).WriteValueSafe(ref netObjRef1, default(ForNetworkSerializable)); ((NetworkBehaviour)this).__endSendClientRpc(ref val, 1255996219u, val2, (RpcDelivery)0); } if ((int)base.__rpc_exec_stage == 1 && (networkManager.IsClient || networkManager.IsHost)) { base.__rpc_exec_stage = (__RpcExecStage)0; NetworkObject val3 = default(NetworkObject); NetworkObject val4 = default(NetworkObject); if (((NetworkObjectReference)(ref netObjRef0)).TryGet(ref val3, (NetworkManager)null) && ((NetworkObjectReference)(ref netObjRef1)).TryGet(ref val4, (NetworkManager)null)) { ((Component)val3).GetComponent().SetScrapValue(((Component)this).GetComponent().scrapValue / 2); ((Component)val3).transform.SetParent(((Component)this).transform.parent); ((Component)val4).GetComponent().SetScrapValue(((Component)this).GetComponent().scrapValue / 2); ((Component)val4).transform.SetParent(((Component)this).transform.parent); } ((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(83991266u, new RpcReceiveHandler(__rpc_handler_83991266), "SpawnItemServerRpc"); ((NetworkBehaviour)this).__registerRpc(1255996219u, new RpcReceiveHandler(__rpc_handler_1255996219), "SpawnItemClientRpc"); ((NetworkBehaviour)this).__initializeRpcs(); } private static void __rpc_handler_83991266(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; ((Bee)(object)target).SpawnItemServerRpc(); target.__rpc_exec_stage = (__RpcExecStage)0; } } private static void __rpc_handler_1255996219(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_005f: Unknown result type (might be due to invalid IL or missing references) //IL_006a: Unknown result type (might be due to invalid IL or missing references) //IL_006e: 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) NetworkManager networkManager = target.NetworkManager; if (networkManager != null && networkManager.IsListening) { NetworkObjectReference netObjRef = default(NetworkObjectReference); ((FastBufferReader)(ref reader)).ReadValueSafe(ref netObjRef, default(ForNetworkSerializable)); NetworkObjectReference netObjRef2 = default(NetworkObjectReference); ((FastBufferReader)(ref reader)).ReadValueSafe(ref netObjRef2, default(ForNetworkSerializable)); target.__rpc_exec_stage = (__RpcExecStage)1; ((Bee)(object)target).SpawnItemClientRpc(netObjRef, netObjRef2); target.__rpc_exec_stage = (__RpcExecStage)0; } } protected internal override string __getTypeName() { return "Bee"; } } public class Blender : Refine { public override void OnNetworkSpawn() { base.recipeList = Plugin.blender; } 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 { 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()); } } internal IEnumerator StartFish() { while (!isBiting) { yield return (object)new WaitForSeconds((float)Random.Range(5, 16)); isBiting = true; AimGame.Instance.game.SetActive(true); anim.SetInteger("play", 1); fisher.anim.Play(567580192); HUDManager.Instance.ShakeCamera((ScreenShakeType)0); yield return (object)new WaitForSeconds(1.5f); isBiting = false; AimGame.Instance.game.SetActive(false); anim.SetInteger("play", 0); fisher.anim.Play(-1966666906); yield return (object)new WaitForSeconds(0.4f); if ((Object)(object)((GrabbableObject)fisher).playerHeldBy != (Object)null) { HUDManager.Instance.ShakeCamera((ScreenShakeType)1); ((GrabbableObject)fisher).playerHeldBy.playerBodyAnimator.SetTrigger("Damage"); ((GrabbableObject)fisher).playerHeldBy.PlayQuickSpecialAnimation(0.7f); } } } 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 : Forage { public override void Boom() { //IL_0007: 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_0045: 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_0096: Unknown result type (might be due to invalid IL or missing references) //IL_00eb: Unknown result type (might be due to invalid IL or missing references) //IL_00f1: Unknown result type (might be due to invalid IL or missing references) Collider[] array = Physics.OverlapSphere(((Component)this).transform.position, 3f, Forage.layerMask, (QueryTriggerInteraction)2); PlayerControllerB val = null; bool flag = false; Collider[] array2 = array; foreach (Collider val2 in array2) { float num = Vector3.Distance(((Component)this).transform.position, ((Component)val2).transform.position); if (((Component)val2).gameObject.layer == 3 && !flag && ((Component)val2).gameObject.TryGetComponent(ref val) && ((NetworkBehaviour)val).IsOwner) { flag = true; val.DamagePlayer(30, true, true, (CauseOfDeath)16, 0, false, default(Vector3)); } else if (((Component)val2).gameObject.layer == 19) { EnemyAICollisionDetect componentInChildren = ((Component)val2).GetComponentInChildren(); if ((Object)(object)componentInChildren != (Object)null && ((NetworkBehaviour)componentInChildren.mainScript).IsOwner) { componentInChildren.mainScript.HitEnemyOnLocalClient(3, default(Vector3), (PlayerControllerB)null, false, -1); componentInChildren.mainScript.HitFromExplosion((float)((double)num * 1.5)); } } } } internal override void Produce() { //IL_005e: 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_008e: Unknown result type (might be due to invalid IL or missing references) if (!grown && Random.Range(0, 99) <= Forage.grow0) { if (Random.Range(0, 99) > Forage.grow1) { AnimateClientRpc(362874043); } else { AnimateClientRpc(1293411866); 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(Forage.maxValue1 / 2, (int)Forage.maxValue1)); } grown = true; } } public override void OnNetworkSpawn() { if (((NetworkBehaviour)this).IsHost) { HarmonyPatches.forage.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() { base.__initializeVariables(); } protected override void __initializeRpcs() { base.__initializeRpcs(); } protected internal override string __getTypeName() { return "BurstBerry"; } } public class Crockpot : Crafter { public override void OnNetworkSpawn() { base.recipeList = Plugin.crockpot; } 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 { public GameObject bobberPrefab; private Bobber bobber; [SerializeField] internal Transform line; [SerializeField] internal Animator anim; private const int lose = -1966666906; private const int bite = 567580192; private const int cast = -1299573048; [SerializeField] private InteractTrigger trigger; [SerializeField] private float speed = 1f; [SerializeField] private short baitTotal; private short baitAmount = 0; private float baitMulti = 1f; [SerializeField] private float rodMulti = 1f; private const string tip0 = "Add Seed or Bait : [LMB]\n"; private const string tip1 = " Uses Left\nCurrent Bait Effectiveness: "; public override void ItemActivate(bool used, bool buttonDown = true) { //IL_00ea: Unknown result type (might be due to invalid IL or missing references) //IL_00ff: Unknown result type (might be due to invalid IL or missing references) //IL_0114: 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_00b6: 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 ((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) { if (GameNetworkManager.Instance.localPlayerController.isInsideFactory) { SpawnItemServerRpc(((Component)bobber).transform.position.x, ((Component)bobber).transform.position.y, ((Component)bobber).transform.position.z, inside: true); } else { SpawnItemServerRpc(((Component)bobber).transform.position.x, ((Component)bobber).transform.position.y, ((Component)bobber).transform.position.z); } } SetBaitServerRpc((short)(baitAmount - 1), baitMulti); AimGame.Instance.animator.speed = speed; AimGame.Instance.game.SetActive(false); } bobber.isBiting = false; Object.Destroy((Object)(object)((Component)bobber).gameObject); anim.Play(-1966666906); HUDManager.Instance.ShakeCamera((ScreenShakeType)0); } else { anim.Play(-1299573048); } } 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(baitTotal, 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 val2 = default(ServerRpcParams); FastBufferWriter val = ((NetworkBehaviour)this).__beginSendServerRpc(1128447683u, val2, (RpcDelivery)0); BytePacker.WriteValueBitPacked(val, uses); ((FastBufferWriter)(ref val)).WriteValueSafe(ref multi, default(ForPrimitives)); ((NetworkBehaviour)this).__endSendServerRpc(ref val, 1128447683u, val2, (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 val2 = default(ClientRpcParams); FastBufferWriter val = ((NetworkBehaviour)this).__beginSendClientRpc(1612129145u, val2, (RpcDelivery)0); BytePacker.WriteValueBitPacked(val, uses); ((FastBufferWriter)(ref val)).WriteValueSafe(ref multi, default(ForPrimitives)); ((NetworkBehaviour)this).__endSendClientRpc(ref val, 1612129145u, val2, (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 + "/" + baitTotal + " 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 val2 = default(ServerRpcParams); FastBufferWriter val = ((NetworkBehaviour)this).__beginSendServerRpc(166827970u, val2, (RpcDelivery)0); ((NetworkBehaviour)this).__endSendServerRpc(ref val, 166827970u, val2, (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, bool inside = false) { //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Invalid comparison between Unknown and I4 //IL_00f8: Unknown result type (might be due to invalid IL or missing references) //IL_0102: 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_00ce: Unknown result type (might be due to invalid IL or missing references) //IL_00d4: 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) //IL_012d: Unknown result type (might be due to invalid IL or missing references) //IL_017a: Unknown result type (might be due to invalid IL or missing references) //IL_017f: Unknown result type (might be due to invalid IL or missing references) //IL_01a5: 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 val2 = default(ServerRpcParams); FastBufferWriter val = ((NetworkBehaviour)this).__beginSendServerRpc(3182818277u, val2, (RpcDelivery)0); ((FastBufferWriter)(ref val)).WriteValueSafe(ref posX, default(ForPrimitives)); ((FastBufferWriter)(ref val)).WriteValueSafe(ref posY, default(ForPrimitives)); ((FastBufferWriter)(ref val)).WriteValueSafe(ref posZ, default(ForPrimitives)); ((FastBufferWriter)(ref val)).WriteValueSafe(ref inside, default(ForPrimitives)); ((NetworkBehaviour)this).__endSendServerRpc(ref val, 3182818277u, val2, (RpcDelivery)0); } if ((int)((NetworkBehaviour)this).__rpc_exec_stage == 1 && (networkManager.IsServer || networkManager.IsHost)) { ((NetworkBehaviour)this).__rpc_exec_stage = (__RpcExecStage)0; Item val3 = ((!inside) ? Plugin.fishExt[Random.Range(0, Plugin.fishExt.Count)] : Plugin.fishInt[Random.Range(0, Plugin.fishInt.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) * rodMulti * 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 val2 = default(ClientRpcParams); FastBufferWriter val = ((NetworkBehaviour)this).__beginSendClientRpc(3438050179u, val2, (RpcDelivery)0); ((FastBufferWriter)(ref val)).WriteValueSafe(ref netObjRef, default(ForNetworkSerializable)); BytePacker.WriteValueBitPacked(val, value); ((NetworkBehaviour)this).__endSendClientRpc(ref val, 3438050179u, val2, (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)); } } } private IEnumerator SpawnItem(NetworkObject netObj, int value) { yield return (object)new WaitUntil((Func)(() => netObj.IsSpawned)); yield return (object)new WaitForEndOfFrame(); yield return (object)new WaitForEndOfFrame(); if ((Object)(object)base.playerHeldBy != (Object)null) { ((Component)netObj).GetComponent().targetFloorPosition = ((Component)base.playerHeldBy).transform.position; } } public override void PocketItem() { if ((Object)(object)bobber != (Object)null) { Object.Destroy((Object)(object)((Component)bobber).gameObject); } anim.Play(-1966666906); ((GrabbableObject)this).PocketItem(); } public override void DiscardItem() { if ((Object)(object)bobber != (Object)null) { Object.Destroy((Object)(object)((Component)bobber).gameObject); } anim.Play(-1966666906); ((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(3182818277u, new RpcReceiveHandler(__rpc_handler_3182818277), "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_3182818277(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_0080: Unknown result type (might be due to invalid IL or missing references) //IL_0086: Unknown result type (might be due to invalid IL or missing references) //IL_0095: Unknown result type (might be due to invalid IL or missing references) //IL_00bb: 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)); bool inside = default(bool); ((FastBufferReader)(ref reader)).ReadValueSafe(ref inside, default(ForPrimitives)); target.__rpc_exec_stage = (__RpcExecStage)1; ((Fisher)(object)target).SpawnItemServerRpc(posX, posY, posZ, inside); 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 Forage : NetworkBehaviour { [SerializeField] internal Animator animator; [SerializeField] internal GameObject spawn0; [SerializeField] internal GameObject spawn1; internal static int layerMask; internal static short grow0; internal static short grow1; internal static short maxValue0; internal static short maxValue1; internal bool grown = false; public virtual void Boom() { } internal virtual void Produce() { } public void SpawnItem() { SpawnItemServerRpc(); } [ServerRpc(RequireOwnership = false)] internal 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_0103: 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 val2 = default(ServerRpcParams); FastBufferWriter val = ((NetworkBehaviour)this).__beginSendServerRpc(2444564730u, val2, (RpcDelivery)0); ((NetworkBehaviour)this).__endSendServerRpc(ref val, 2444564730u, val2, (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); SpawnItemClientRpc(NetworkObjectReference.op_Implicit(val3.GetComponent()), Random.Range(maxValue0 / 2, (int)maxValue0)); } } } [ClientRpc] internal 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 val2 = default(ClientRpcParams); FastBufferWriter val = ((NetworkBehaviour)this).__beginSendClientRpc(12317245u, val2, (RpcDelivery)0); ((FastBufferWriter)(ref val)).WriteValueSafe(ref netObjRef, default(ForNetworkSerializable)); BytePacker.WriteValueBitPacked(val, value); ((NetworkBehaviour)this).__endSendClientRpc(ref val, 12317245u, val2, (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 Animate(int set) { AnimateServerRpc(set); } [ServerRpc(RequireOwnership = false)] internal void AnimateServerRpc(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.IsClient || networkManager.IsHost)) { ServerRpcParams val2 = default(ServerRpcParams); FastBufferWriter val = ((NetworkBehaviour)this).__beginSendServerRpc(1609594334u, val2, (RpcDelivery)0); BytePacker.WriteValueBitPacked(val, set); ((NetworkBehaviour)this).__endSendServerRpc(ref val, 1609594334u, val2, (RpcDelivery)0); } if ((int)base.__rpc_exec_stage == 1 && (networkManager.IsServer || networkManager.IsHost)) { base.__rpc_exec_stage = (__RpcExecStage)0; AnimateClientRpc(set); } } } [ClientRpc] internal 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 val2 = default(ClientRpcParams); FastBufferWriter val = ((NetworkBehaviour)this).__beginSendClientRpc(2167290190u, val2, (RpcDelivery)0); BytePacker.WriteValueBitPacked(val, set); ((NetworkBehaviour)this).__endSendClientRpc(ref val, 2167290190u, val2, (RpcDelivery)0); } if ((int)base.__rpc_exec_stage == 1 && (networkManager.IsClient || networkManager.IsHost)) { base.__rpc_exec_stage = (__RpcExecStage)0; animator.Play(set, 0, 0f); } } } [ServerRpc(RequireOwnership = false)] internal void GrownServerRpc(bool set) { //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) { if ((int)base.__rpc_exec_stage != 1 && (networkManager.IsClient || networkManager.IsHost)) { ServerRpcParams val2 = default(ServerRpcParams); FastBufferWriter val = ((NetworkBehaviour)this).__beginSendServerRpc(1740587097u, val2, (RpcDelivery)0); ((FastBufferWriter)(ref val)).WriteValueSafe(ref set, default(ForPrimitives)); ((NetworkBehaviour)this).__endSendServerRpc(ref val, 1740587097u, val2, (RpcDelivery)0); } if ((int)base.__rpc_exec_stage == 1 && (networkManager.IsServer || networkManager.IsHost)) { base.__rpc_exec_stage = (__RpcExecStage)0; grown = set; } } } 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 //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(2444564730u, new RpcReceiveHandler(__rpc_handler_2444564730), "SpawnItemServerRpc"); ((NetworkBehaviour)this).__registerRpc(12317245u, new RpcReceiveHandler(__rpc_handler_12317245), "SpawnItemClientRpc"); ((NetworkBehaviour)this).__registerRpc(1609594334u, new RpcReceiveHandler(__rpc_handler_1609594334), "AnimateServerRpc"); ((NetworkBehaviour)this).__registerRpc(2167290190u, new RpcReceiveHandler(__rpc_handler_2167290190), "AnimateClientRpc"); ((NetworkBehaviour)this).__registerRpc(1740587097u, new RpcReceiveHandler(__rpc_handler_1740587097), "GrownServerRpc"); ((NetworkBehaviour)this).__initializeRpcs(); } private static void __rpc_handler_2444564730(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; ((Forage)(object)target).SpawnItemServerRpc(); target.__rpc_exec_stage = (__RpcExecStage)0; } } private static void __rpc_handler_12317245(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; ((Forage)(object)target).SpawnItemClientRpc(netObjRef, value); target.__rpc_exec_stage = (__RpcExecStage)0; } } private static void __rpc_handler_1609594334(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; ((Forage)(object)target).AnimateServerRpc(set); target.__rpc_exec_stage = (__RpcExecStage)0; } } private static void __rpc_handler_2167290190(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; ((Forage)(object)target).AnimateClientRpc(set); target.__rpc_exec_stage = (__RpcExecStage)0; } } private static void __rpc_handler_1740587097(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 set = default(bool); ((FastBufferReader)(ref reader)).ReadValueSafe(ref set, default(ForPrimitives)); target.__rpc_exec_stage = (__RpcExecStage)1; ((Forage)(object)target).GrownServerRpc(set); target.__rpc_exec_stage = (__RpcExecStage)0; } } protected internal override string __getTypeName() { return "Forage"; } } public class GenericForage : Forage { internal override void Produce() { //IL_002d: Unknown result type (might be due to invalid IL or missing references) //IL_0038: 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) if (!grown && Random.Range(0, 99) <= Forage.grow0) { 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(Forage.maxValue1 / 2, (int)Forage.maxValue1)); grown = true; } } public override void OnNetworkSpawn() { if (((NetworkBehaviour)this).IsHost) { HarmonyPatches.forage.Add(this); } } private void Start() { //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) //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_0050: Unknown result type (might be due to invalid IL or missing references) //IL_0073: Unknown result type (might be due to invalid IL or missing references) //IL_0086: 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_00ac: 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)this).gameObject); } return; } RaycastHit val = default(RaycastHit); if (Physics.Raycast(((Component)this).transform.position + Vector3.up * 2f, Vector3.down, ref val, 5f, 1107298561)) { ((Component)this).transform.position = ((RaycastHit)(ref val)).point; ((Component)this).transform.up = ((RaycastHit)(ref val)).normal; ((Component)this).transform.Rotate(Vector3.up * (float)Random.Range(-180, 180), (Space)1); } ((Component)this).GetComponent().Spawn(true); } protected override void __initializeVariables() { base.__initializeVariables(); } protected override void __initializeRpcs() { base.__initializeRpcs(); } protected internal override string __getTypeName() { return "GenericForage"; } } public class Grill : Crafter { public override void OnNetworkSpawn() { base.recipeList = Plugin.grill; } 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() { base.recipeList = Plugin.grinder; } 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 forage = 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 (Forage item in forage) { if ((Object)(object)item != (Object)null) { item.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(); } } forage.Clear(); } [HarmonyPostfix] [HarmonyPatch(typeof(StartOfRound), "Start")] [HarmonyPriority(600)] private static void PostStart(StartOfRound __instance) { if (loaded) { return; } loaded = true; string[] source = MelanieCookedConfig.meatGrind.Value.Split(','); string[] source2 = MelanieCookedConfig.meatGoop.Value.Split(','); string[] source3 = MelanieCookedConfig.meatList.Value.Split(','); string[] source4 = MelanieCookedConfig.veggieList.Value.Split(','); string[] source5 = MelanieCookedConfig.grainList.Value.Split(','); string[] source6 = MelanieCookedConfig.cheeseList.Value.Split(','); string[] source7 = CollectionExtensions.AddItem((IEnumerable)MelanieCookedConfig.boomList.Value.Split(','), "Gazpacho").ToArray(); string[] source8 = MelanieCookedConfig.fruitList.Value.Split(','); string[] source9 = MelanieCookedConfig.breadList.Value.Split(','); string[] source10 = MelanieCookedConfig.honeyList.Value.Split(','); string[] source11 = MelanieCookedConfig.alcoholList.Value.Split(','); string[] source12 = MelanieCookedConfig.milkList.Value.Split(','); string[] source13 = MelanieCookedConfig.eggList.Value.Split(','); string[] source14 = MelanieCookedConfig.fishList.Value.Split(','); string[] source15 = MelanieCookedConfig.oilList.Value.Split(','); string[] source16 = MelanieCookedConfig.appleList.Value.Split(','); string[] source17 = MelanieCookedConfig.grape0List.Value.Split(','); string[] source18 = MelanieCookedConfig.grape1List.Value.Split(','); string[] source19 = MelanieCookedConfig.potatoList.Value.Split(','); string[] array = MelanieCookedConfig.fertilizerList.Value.Split(','); foreach (Item items in __instance.allItemsList.itemsList) { if ((Object)(object)items == (Object)null) { continue; } if (Plugin.bodyHash.Contains(items)) { AddIngredient(items, 0); } if (source.Contains(items.itemName)) { AddIngredient(items, 0); } if (source2.Contains(items.itemName)) { AddIngredient(items, 1); } if (source3.Contains(items.itemName)) { AddIngredient(items, 2); } if (source4.Contains(items.itemName)) { AddIngredient(items, 3); } if (source5.Contains(items.itemName)) { AddIngredient(items, 4); } if (source6.Contains(items.itemName)) { AddIngredient(items, 5); } if (source7.Contains(items.itemName)) { AddIngredient(items, 6); } if (source8.Contains(items.itemName)) { AddIngredient(items, 7); } if (source9.Contains(items.itemName)) { AddIngredient(items, 16); } if (source10.Contains(items.itemName)) { AddIngredient(items, 18); } if (source11.Contains(items.itemName)) { AddIngredient(items, 11); } if (source12.Contains(items.itemName)) { AddIngredient(items, 70); } if (source13.Contains(items.itemName)) { AddIngredient(items, 71); } if (source14.Contains(items.itemName)) { AddIngredient(items, 23); } if (source15.Contains(items.itemName)) { AddIngredient(items, 42); } if (source16.Contains(items.itemName)) { AddIngredient(items, 10); } if (source17.Contains(items.itemName)) { AddIngredient(items, 8); } if (source18.Contains(items.itemName)) { AddIngredient(items, 9); } if (source19.Contains(items.itemName)) { AddIngredient(items, 12); } string[] array2 = array; foreach (string text in array2) { string[] array3 = text.Split('-'); if (items.itemName == array3[0]) { try { Seed seed = items.spawnPrefab.AddComponent(); seed.type = -1; seed.useNitrogen = short.Parse(array3[1], CultureInfo.InvariantCulture); seed.usePhosphorous = short.Parse(array3[2], CultureInfo.InvariantCulture); seed.usePotassium = short.Parse(array3[3], CultureInfo.InvariantCulture); } catch { Plugin.mls.LogError((object)"Invalid fertilizer config input! Skipping."); } } } } if (MelanieCookedConfig.enableBurstbush.Value) { HazardWeight(Plugin.bundle.LoadAsset("Assets/MelanieCooked/Asset/Hazard/Bush0.asset"), MelanieCookedConfig.burstBushSpawn0.Value, MelanieCookedConfig.burstBushSpawn1.Value, MelanieCookedConfig.burstBushSpawn2.Value); } if (MelanieCookedConfig.enableMandrake.Value) { HazardWeight(Plugin.bundle.LoadAsset("Assets/MelanieCooked/Asset/Hazard/Bush2.asset"), MelanieCookedConfig.mandrakeSpawn0.Value, MelanieCookedConfig.mandrakeSpawn1.Value, MelanieCookedConfig.mandrakeSpawn2.Value); } if (MelanieCookedConfig.enableAnglowbush.Value) { HazardWeight(Plugin.bundle.LoadAsset("Assets/MelanieCooked/Asset/Hazard/Bush1.asset"), MelanieCookedConfig.anglowSpawn0.Value, MelanieCookedConfig.anglowSpawn1.Value, MelanieCookedConfig.anglowSpawn2.Value); } 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); Rack.propsMask = LayerMask.GetMask(new string[1] { "Props" }); Forage.layerMask = LayerMask.GetMask(new string[2] { "Player", "Enemies" }); Forage.maxValue0 = (short)MelanieCookedConfig.burstBerry0Max.Value; Forage.maxValue1 = (short)MelanieCookedConfig.burstBerry1Max.Value; Forage.grow0 = (short)MelanieCookedConfig.burstBerryGrow0.Value; Forage.grow1 = (short)MelanieCookedConfig.burstBerryGrow1.Value; Forage.maxValue1 = (short)MelanieCookedConfig.anglowBerry0Max.Value; Forage.grow0 = (short)MelanieCookedConfig.anglowBerryGrow0.Value; Forage.grow1 = (short)MelanieCookedConfig.anglowBerryGrow1.Value; Forage.maxValue1 = (short)MelanieCookedConfig.mandrake1Max.Value; Forage.grow0 = (short)MelanieCookedConfig.mandrakeGrow0.Value; } [HarmonyPostfix] [HarmonyPatch(typeof(StartOfRound), "Awake")] private static void PostAwake(StartOfRound __instance) { //IL_00b9: Unknown result type (might be due to invalid IL or missing references) //IL_00c5: Unknown result type (might be due to invalid IL or missing references) //IL_00f9: Unknown result type (might be due to invalid IL or missing references) //IL_0105: Unknown result type (might be due to invalid IL or missing references) if (!loaded) { UnlockableItem val = __instance.unlockablesList.unlockables[30]; if (val.unlockableName != "Fridge") { foreach (UnlockableItem unlockable in __instance.unlockablesList.unlockables) { if (unlockable.unlockableName == "Fridge") { val = unlockable; } } } Transform transform = Object.Instantiate(Plugin.bundle.LoadAsset("Assets/MelanieCooked/Prefab/FridgeStack.prefab")).transform; transform.SetParent(val.prefabObject.transform); transform.localPosition = Vector3.zero; transform.localRotation = Quaternion.identity; Transform val2 = transform.Find("FridgeStack0"); val2.SetParent(val.prefabObject.transform.Find("FridgeBody/FridgeDoorBottom")); val2.localPosition = Vector3.zero; val2.localRotation = Quaternion.identity; foreach (Item items in __instance.allItemsList.itemsList) { if (items.itemName == "Cookie pan") { AddIngredient(items, 28); } } foreach (Item items2 in __instance.allItemsList.itemsList) { if (items2.itemName == "Hive") { AddIngredient(items2, 21); } } foreach (Item items3 in __instance.allItemsList.itemsList) { if (items3.itemName == "Egg") { AddIngredient(items3, 71); } } foreach (Item items4 in __instance.allItemsList.itemsList) { if (items4.itemName == "Ear") { Plugin.fishInt.Add(items4); } } foreach (Item items5 in __instance.allItemsList.itemsList) { if (items5.itemName == "Hand") { Plugin.fishInt.Add(items5); } } foreach (Item items6 in __instance.allItemsList.itemsList) { if (items6.itemName == "Red soda") { AddIngredient(items6, 72); try { ((Component)Plugin.bundle.LoadAsset("Assets/MelanieCooked/Asset/Furniture.asset").unlockables[7].prefabObject.transform.Find("ObjectPlacements/Anim0/Door0/Soda0")).GetComponent().item = items6; Plugin.bundle.LoadAsset("Assets/MelanieCooked/Material/Soda0.mat").mainTexture = ((Renderer)items6.spawnPrefab.GetComponent()).sharedMaterials[0].mainTexture; } catch { Plugin.mls.LogError((object)"Issue fetching vanilla red soda info!"); } } } } 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), 0, 0f); } } 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; } private static void HazardWeight(SpawnableOutsideObject bush, int weight0, string weight1, string weight2) { //IL_0041: Unknown result type (might be due to invalid IL or missing references) //IL_004b: Expected O, but got Unknown //IL_0129: Unknown result type (might be due to invalid IL or missing references) //IL_0133: Expected O, but got Unknown //IL_023d: Unknown result type (might be due to invalid IL or missing references) //IL_0247: Expected O, but got Unknown foreach (ExtendedLevel extendedLevel in PatchedContent.ExtendedLevels) { if (weight0 != 0) { SpawnableOutsideObjectWithRarity[] spawnableOutsideObjects = CollectionExtensions.AddItem((IEnumerable)extendedLevel.SelectableLevel.spawnableOutsideObjects, new SpawnableOutsideObjectWithRarity(bush, AnimationCurve.Constant(0f, 1f, (float)weight0))).ToArray(); extendedLevel.SelectableLevel.spawnableOutsideObjects = spawnableOutsideObjects; } string[] array = weight1.Split(','); foreach (string text in array) { if (text == string.Empty) { continue; } foreach (ContentTag contentTag in ((ExtendedContent)extendedLevel).ContentTags) { try { string[] array2 = text.Split(':'); if (array2.Length == 3) { array2 = new string[2] { array2[1], array2[2] }; } if (contentTag.contentTagName.ToLower() == array2[0].ToLower()) { SpawnableOutsideObjectWithRarity[] spawnableOutsideObjects = CollectionExtensions.AddItem((IEnumerable)extendedLevel.SelectableLevel.spawnableOutsideObjects, new SpawnableOutsideObjectWithRarity(bush, AnimationCurve.Constant(0f, 1f, (float)short.Parse(array2[1], CultureInfo.InvariantCulture)))).ToArray(); extendedLevel.SelectableLevel.spawnableOutsideObjects = spawnableOutsideObjects; break; } } catch { Plugin.mls.LogError((object)"Invalid config input for hazard by tag. Skipping this iteration"); } } } string[] array3 = weight2.Split(','); foreach (string text2 in array3) { if (text2 == string.Empty) { continue; } try { string[] array4 = text2.Split(':'); if (array4.Length == 3) { array4 = new string[2] { array4[1], array4[2] }; } if (extendedLevel.NumberlessPlanetName.ToLower() == array4[0].ToLower()) { SpawnableOutsideObjectWithRarity[] spawnableOutsideObjects = CollectionExtensions.AddItem((IEnumerable)extendedLevel.SelectableLevel.spawnableOutsideObjects, new SpawnableOutsideObjectWithRarity(bush, AnimationCurve.Constant(0f, 1f, (float)short.Parse(array4[1], CultureInfo.InvariantCulture)))).ToArray(); extendedLevel.SelectableLevel.spawnableOutsideObjects = spawnableOutsideObjects; } } catch { Plugin.mls.LogError((object)"Invalid config input for hazard by moon. Skipping this iteration"); } } } } private static void HazardWeight(IndoorMapHazardType bush, int weight0, string weight1, string weight2) { //IL_0040: Unknown result type (might be due to invalid IL or missing references) //IL_0045: Unknown result type (might be due to invalid IL or missing references) //IL_004c: Unknown result type (might be due to invalid IL or missing references) //IL_0068: Expected O, but got Unknown //IL_0127: Unknown result type (might be due to invalid IL or missing references) //IL_012c: Unknown result type (might be due to invalid IL or missing references) //IL_0133: Unknown result type (might be due to invalid IL or missing references) //IL_015c: Expected O, but got Unknown //IL_0247: Unknown result type (might be due to invalid IL or missing references) //IL_024c: Unknown result type (might be due to invalid IL or missing references) //IL_0253: Unknown result type (might be due to invalid IL or missing references) //IL_027c: Expected O, but got Unknown Plugin.hazardInside.Add(bush.prefabToSpawn); foreach (ExtendedLevel extendedLevel in PatchedContent.ExtendedLevels) { if (weight0 != 0) { IndoorMapHazard[] indoorMapHazards = CollectionExtensions.AddItem((IEnumerable)extendedLevel.SelectableLevel.indoorMapHazards, new IndoorMapHazard { hazardType = bush, numberToSpawn = AnimationCurve.Constant(0f, 1f, (float)weight0) }).ToArray(); extendedLevel.SelectableLevel.indoorMapHazards = indoorMapHazards; } string[] array = weight1.Split(','); foreach (string text in array) { if (text == string.Empty) { continue; } foreach (ContentTag contentTag in ((ExtendedContent)extendedLevel).ContentTags) { try { string[] array2 = text.Split(':'); if (array2.Length == 3) { array2 = new string[2] { array2[1], array2[2] }; } if (contentTag.contentTagName.ToLower() == array2[0].ToLower()) { IndoorMapHazard[] indoorMapHazards = CollectionExtensions.AddItem((IEnumerable)extendedLevel.SelectableLevel.indoorMapHazards, new IndoorMapHazard { hazardType = bush, numberToSpawn = AnimationCurve.Constant(0f, 1f, (float)short.Parse(array2[1], CultureInfo.InvariantCulture)) }).ToArray(); extendedLevel.SelectableLevel.indoorMapHazards = indoorMapHazards; break; } } catch { Plugin.mls.LogError((object)"Invalid config input for hazard by tag. Skipping this iteration"); } } } string[] array3 = weight2.Split(','); foreach (string text2 in array3) { if (text2 == string.Empty) { continue; } try { string[] array4 = text2.Split(':'); if (array4.Length == 3) { array4 = new string[2] { array4[1], array4[2] }; } if (extendedLevel.NumberlessPlanetName.ToLower() == array4[0].ToLower()) { IndoorMapHazard[] indoorMapHazards = CollectionExtensions.AddItem((IEnumerable)extendedLevel.SelectableLevel.indoorMapHazards, new IndoorMapHazard { hazardType = bush, numberToSpawn = AnimationCurve.Constant(0f, 1f, (float)short.Parse(array4[1], CultureInfo.InvariantCulture)) }).ToArray(); extendedLevel.SelectableLevel.indoorMapHazards = indoorMapHazards; } } catch { Plugin.mls.LogError((object)"Invalid config input for hazard by moon. Skipping this iteration"); } } } } } public class IceCreamer : Crafter { public override void OnNetworkSpawn() { base.recipeList = Plugin.icecreamer; } 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() { base.recipeList = Plugin.oven; } 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(Plot __instance) { public float[] posMin; public float[] posMax; public short cropID; public short[] cropStages; public short useNitrogen; public short usePhosphorous; public short usePotassium; public short produce = -1; public short produceRare = -1; public short life = 0; public short growChance; public short rareChance; public short maxValue; public short type; public bool canAge; internal Save GetInfo() { posMin = new float[3] { __instance.posMin.x, __instance.posMin.y, __instance.posMin.z }; posMax = new float[3] { __instance.posMax.x, __instance.posMax.y, __instance.posMax.z }; cropID = __instance.cropID; cropStages = __instance.cropStages; produce = __instance.produceIndex; produceRare = __instance.produceRareIndex; useNitrogen = __instance.useNitrogen; usePhosphorous = __instance.usePhosphorous; usePotassium = __instance.usePotassium; life = __instance.life; growChance = __instance.growChance; rareChance = __instance.rareChance; maxValue = __instance.maxValue; type = __instance.type; canAge = __instance.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 = null; 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 val2 = default(ServerRpcParams); FastBufferWriter val = ((NetworkBehaviour)this).__beginSendServerRpc(552681349u, val2, (RpcDelivery)0); ((NetworkBehaviour)this).__endSendServerRpc(ref val, 552681349u, val2, (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_009a: 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) { 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 val2 = default(ServerRpcParams); FastBufferWriter val = ((NetworkBehaviour)this).__beginSendServerRpc(3310671304u, val2, (RpcDelivery)0); BytePacker.WriteValueBitPacked(val, n); BytePacker.WriteValueBitPacked(val, p); BytePacker.WriteValueBitPacked(val, k); ((NetworkBehaviour)this).__endSendServerRpc(ref val, 3310671304u, val2, (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 val2 = default(ClientRpcParams); FastBufferWriter val = ((NetworkBehaviour)this).__beginSendClientRpc(3974306210u, val2, (RpcDelivery)0); BytePacker.WriteValueBitPacked(val, n); BytePacker.WriteValueBitPacked(val, p); BytePacker.WriteValueBitPacked(val, k); ((NetworkBehaviour)this).__endSendClientRpc(ref val, 3974306210u, val2, (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 val2 = default(ServerRpcParams); FastBufferWriter val = ((NetworkBehaviour)this).__beginSendServerRpc(94063016u, val2, (RpcDelivery)0); ((FastBufferWriter)(ref val)).WriteValueSafe(ref netObjRef, default(ForNetworkSerializable)); ((NetworkBehaviour)this).__endSendServerRpc(ref val, 94063016u, val2, (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); produceRare = component.produceRare; if (!((Object)(object)produceRare == (Object)null)) { produceRareIndex = (short)Plugin.itemList.IndexOf(produceRare); } 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 val2 = default(ClientRpcParams); FastBufferWriter val = ((NetworkBehaviour)this).__beginSendClientRpc(2434559237u, val2, (RpcDelivery)0); BytePacker.WriteValueBitPacked(val, cropID); ((NetworkBehaviour)this).__endSendClientRpc(ref val, 2434559237u, val2, (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 val2 = default(ClientRpcParams); FastBufferWriter val = ((NetworkBehaviour)this).__beginSendClientRpc(2035821907u, val2, (RpcDelivery)0); ((FastBufferWriter)(ref val)).WriteValueSafe(ref netObjRef, default(ForNetworkSerializable)); BytePacker.WriteValueBitPacked(val, value); ((NetworkBehaviour)this).__endSendClientRpc(ref val, 2035821907u, val2, (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 val2 = default(ClientRpcParams); FastBufferWriter val = ((NetworkBehaviour)this).__beginSendClientRpc(2865236341u, val2, (RpcDelivery)0); ((NetworkBehaviour)this).__endSendClientRpc(ref val, 2865236341u, val2, (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.5.5")] public class Plugin : BaseUnityPlugin { private const string GUID = "MelanieMelicious.FarmAndCook"; private const string NAME = "MelanieMelicious - Farming and Cooking Mod"; private const string VERSION = "1.5.5"; 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 List fishExt; public static List fishInt; 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(); fishExt = new List(6) { Plugin.itemList[4], Plugin.itemList[8], itemList[35], itemList[36], itemList[55], itemList[56] }; fishInt = new List(4) { Plugin.itemList[0], Plugin.itemList[5], itemList[64], itemList[65] }; 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)1, (short)1, (short)1, (short)5, 10, 0.25f); Plugin.RegisterRecipe(grinder, itemList[7], new short[1][] { new short[1] { 4 } }, Array.Empty(), (short)1, (short)1, (short)1, (short)5, 10, 0.25f); Plugin.RegisterRecipe(grinder, itemList[49], new short[1][] { new short[1] { 43 } }, Array.Empty(), (short)1, (short)1, (short)1, (short)5, 10, 0.25f); Plugin.RegisterRecipe(grinder, (Item[])(object)new Item[2] { itemList[29], itemList[30] }, new short[1][] { new short[1] { 21 } }, Array.Empty(), (short)1, (short)1, (short)1, (short)5, 10, 0.25f); Plugin.RegisterRecipe(blender, itemList[15], new short[1][] { new short[1] { 8 } }, Array.Empty(), (short)1, (short)1, (short)1, (short)5, 10, 0.25f); Plugin.RegisterRecipe(blender, itemList[17], new short[1][] { new short[1] { 9 } }, Array.Empty(), (short)1, (short)1, (short)1, (short)5, 10, 0.25f); Plugin.RegisterRecipe(blender, itemList[23], new short[1][] { new short[1] { 10 } }, Array.Empty(), (short)1, (short)1, (short)1, (short)5, 10, 0.25f); Plugin.RegisterRecipe(blender, itemList[24], new short[1][] { new short[1] { 7 } }, Array.Empty(), (short)1, (short)1, (short)1, (short)5, 10, 0.25f); Plugin.RegisterRecipe(seeder, itemList[57], new short[1][] { new short[1] { 45 } }, Array.Empty(), (short)3, (short)3, (short)1, (short)0, 0, 0f); Plugin.RegisterRecipe(seeder, array[0], new short[1][] { new short[1] { 46 } }, Array.Empty(), (short)3, (short)3, (short)1, (short)0, 0, 0f); Plugin.RegisterRecipe(seeder, array[1], new short[1][] { new short[1] { 12 } }, Array.Empty(), (short)3, (short)3, (short)1, (short)0, 0, 0f); Plugin.RegisterRecipe(seeder, array[2], new short[1][] { new short[1] { 47 } }, Array.Empty(), (short)3, (short)3, (short)1, (short)0, 0, 0f); Plugin.RegisterRecipe(seeder, array[3], new short[1][] { new short[1] { 8 } }, Array.Empty(), (short)3, (short)3, (short)1, (short)0, 0, 0f); Plugin.RegisterRecipe(seeder, array[4], new short[1][] { new short[1] { 9 } }, Array.Empty(), (short)3, (short)3, (short)1, (short)0, 0, 0f); Plugin.RegisterRecipe(crockpot, itemList[12], new short[1][] { new short[2] { 1, 1 } }, Array.Empty(), (short)1, (short)10, (short)1, (short)1, 10, 0.25f); 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, 10, 0.25f); Plugin.RegisterRecipe(crockpot, itemList[3], new short[1][] { new short[2] { 2, 2 } }, Array.Empty(), (short)4, (short)4, (short)1, (short)5, 10, 0.25f); Plugin.RegisterRecipe(crockpot, itemList[2], new short[1][] { new short[2] { 3, 3 } }, Array.Empty(), (short)3, (short)4, (short)1, (short)6, 10, 0.25f); Plugin.RegisterRecipe(oven, itemList[12], new short[1][] { new short[2] { 1, 1 } }, Array.Empty(), (short)1, (short)10, (short)1, (short)1, 10, 0.25f); 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, 10, 0.25f); 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, 10, 0.25f); Plugin.RegisterRecipe(oven, itemList[4], new short[1][] { new short[2] { 2, 3 } }, Array.Empty(), (short)3, (short)4, (short)1, (short)2, 10, 0.25f); 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, 10, 0.25f); Plugin.RegisterRecipe(oven, itemList[8], new short[1][] { new short[2] { 16, 3 } }, Array.Empty(), (short)3, (short)4, (short)1, (short)2, 10, 0.25f); 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, 10, 0.25f); 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, 10, 0.5f); Plugin.RegisterRecipe(grill, itemList[12], new short[1][] { new short[2] { 1, 1 } }, Array.Empty(), (short)1, (short)10, (short)1, (short)1, 10, 0.25f); 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, 10, 0.25f); 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, 10, 0.25f); 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, 10, 0.25f); 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, 10, 0.25f); 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, 10, 0.25f); Plugin.RegisterRecipe(icecreamer, itemList[52], new short[1][] { new short[2] { 13, 1 } }, Array.Empty(), (short)1, (short)2, (short)1, (short)2, 10, 0.25f); Plugin.RegisterRecipe(icecreamer, itemList[53], new short[1][] { new short[2] { 14, 1 } }, Array.Empty(), (short)1, (short)2, (short)1, (short)2, 10, 0.25f); Plugin.RegisterRecipe(icecreamer, itemList[54], new short[1][] { new short[2] { 44, 1 } }, Array.Empty(), (short)1, (short)2, (short)1, (short)2, 10, 0.25f); 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)5, 10, 0.5f); Plugin.RegisterRecipe(Plugin.workbench, itemList[63], new short[3][] { new short[2] { 64, 1 }, new short[2] { 65, 1 }, new short[2] { 66, 1 } }, new short[1], (short)3, (short)3, (short)1, (short)5, 10, 0.75f); 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)5, 10, 0.5f); Plugin.RegisterRecipe(Plugin.workbench, itemList[59], new short[2][] { new short[2] { 51, 1 }, new short[2] { 32, 3 } }, new short[3] { 0, 2, 3 }, (short)4, (short)4, (short)1, (short)5, 10, 0.75f); Plugin.RegisterRecipe(Plugin.workbench, itemList[60], new short[3][] { new short[2] { 52, 1 }, new short[2] { 34, 5 }, new short[2] { 57, 1 } }, new short[3] { 0, 2, 3 }, (short)7, (short)7, (short)1, (short)5, 10, 1f); Plugin.RegisterRecipe(Plugin.workbench, itemList[61], new short[3][] { new short[2] { 51, 1 }, new short[2] { 36, 3 }, new short[2] { 22, 2 } }, new short[3] { 0, 2, 3 }, (short)6, (short)6, (short)1, (short)5, 15, 0.75f); Plugin.RegisterRecipe(Plugin.workbench, itemList[62], new short[2][] { new short[2] { 54, 1 }, new short[2] { 67, 4 } }, new short[3] { 0, 2, 3 }, (short)5, (short)5, (short)1, (short)5, 15, 1.5f); 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)5, 10, 0.5f); 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)5, 10, 0.25f); 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)5, 10, 0.25f); 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)5, 10, 0.5f); 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[2] { 0, 3 }, (short)8, (short)8, (short)1, (short)5, 10, 0.75f); Plugin.RegisterRecipe(Plugin.crusher, (Item[])(object)new Item[2] { itemList[29], itemList[30] }, new short[1][] { new short[1] { 21 } }, Array.Empty(), (short)1, (short)1, (short)1, (short)5, 10, 0.25f); if (MelanieCookedConfig.enableBurstbush.Value) { LethalLevelLoaderNetworkManager.RegisterNetworkPrefab(bundle.LoadAsset("Assets/MelanieCooked/Prefab/Forage/Bush0.prefab")); } if (MelanieCookedConfig.enableAnglowbush.Value) { GameObject val2 = bundle.LoadAsset("Assets/MelanieCooked/Prefab/Forage/Bush1.prefab"); LethalLevelLoaderNetworkManager.RegisterNetworkPrefab(val2); } if (MelanieCookedConfig.enableMandrake.Value) { LethalLevelLoaderNetworkManager.RegisterNetworkPrefab(bundle.LoadAsset("Assets/MelanieCooked/Prefab/Forage/Bush2.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) { itemInfo.DefineScrap((Action)delegate(ScrapBuilder scrap) { scrap.SetWeights((Action>)delegate { }); }); if (cost != -1) { 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; internal static int propsMask; public override async void OnNetworkSpawn() { HarmonyPatches.growers.Add(this); storage = (short)place.Length; grow = (short)MelanieCookedConfig.alcoholGrow.Value; maxValue = (short)MelanieCookedConfig.alcoholMax.Value; await Task.Delay(5000); BoxCollider[] components = ((Component)this).GetComponents(); Ingredient ingredient = default(Ingredient); foreach (BoxCollider trigger in components) { Collider[] hits = Physics.OverlapBox(((Component)this).transform.TransformPoint(trigger.center) + trigger.center, trigger.size / 2f, ((Component)this).transform.rotation, propsMask); for (int j = 0; j < hits.Length; j++) { if (((Component)hits[j]).gameObject.layer == 6 && index.Value != storage && ((Component)hits[j]).TryGetComponent(ref ingredient) && ingredient.ingredient.Contains(11)) { ((Component)hits[j]).transform.SetParent(((Component)this).transform); } ingredient = null; } } await Task.Delay(1000); short i2 = 0; foreach (Transform item2 in ((Component)this).transform) { Transform child = item2; ((Component)child).transform.localRotation = Quaternion.identity; GrabbableObject item = ((Component)child).GetComponent(); item.startFallingPosition = ((Component)item).transform.localPosition; item.targetFloorPosition = place[i2]; i2++; } index.Value = i2; } 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 val2 = default(ClientRpcParams); FastBufferWriter val = ((NetworkBehaviour)this).__beginSendClientRpc(49798777u, val2, (RpcDelivery)0); ((FastBufferWriter)(ref val)).WriteValueSafe(ref netObjRef, default(ForNetworkSerializable)); BytePacker.WriteValueBitPacked(val, value); ((NetworkBehaviour)this).__endSendClientRpc(ref val, 49798777u, val2, (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); } } } private void OnTriggerEnter(Collider other) { Ingredient val = default(Ingredient); if (((Component)other).gameObject.layer == 6 && index.Value != storage && (Object)(object)((Component)other).transform.parent == (Object)(object)StartOfRound.Instance.elevatorTransform && ((Component)other).TryGetComponent(ref val) && val.ingredient.Contains(11)) { ((Component)other).transform.SetParent(((Component)this).transform); } } 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(500); 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 val2 = default(ServerRpcParams); FastBufferWriter val = ((NetworkBehaviour)this).__beginSendServerRpc(2660727742u, val2, (RpcDelivery)0); ((NetworkBehaviour)this).__endSendServerRpc(ref val, 2660727742u, val2, (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 val2 = default(ServerRpcParams); FastBufferWriter val = ((NetworkBehaviour)this).__beginSendServerRpc(689667366u, val2, (RpcDelivery)0); ((FastBufferWriter)(ref val)).WriteValueSafe(ref netObjRef, default(ForNetworkSerializable)); BytePacker.WriteValueBitPacked(val, index); ((NetworkBehaviour)this).__endSendServerRpc(ref val, 689667366u, val2, (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 val2 = default(ClientRpcParams); FastBufferWriter val = ((NetworkBehaviour)this).__beginSendClientRpc(635362193u, val2, (RpcDelivery)0); ((FastBufferWriter)(ref val)).WriteValueSafe(ref netObjRef, default(ForNetworkSerializable)); BytePacker.WriteValueBitPacked(val, index); ((NetworkBehaviour)this).__endSendClientRpc(ref val, 635362193u, val2, (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), "SaveGame")] 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_036b: Unknown result type (might be due to invalid IL or missing references) //IL_0370: Unknown result type (might be due to invalid IL or missing references) //IL_0377: Unknown result type (might be due to invalid IL or missing references) //IL_037c: 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.produce == 39) { item.produceRare = Plugin.itemList[40]; } else 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() { base.recipeList = Plugin.seeder; } 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 { } }