using System.Collections.Generic; using System.Diagnostics; using System.Reflection; using System.Runtime.CompilerServices; using System.Runtime.InteropServices; using System.Runtime.Versioning; using BepInEx; using HarmonyLib; using UnityEngine; using UnityEngine.SceneManagement; [assembly: CompilationRelaxations(8)] [assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)] [assembly: Debuggable(DebuggableAttribute.DebuggingModes.Default | DebuggableAttribute.DebuggingModes.DisableOptimizations | DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints | DebuggableAttribute.DebuggingModes.EnableEditAndContinue)] [assembly: AssemblyTitle("HoneyToSugar")] [assembly: AssemblyDescription("")] [assembly: AssemblyConfiguration("")] [assembly: AssemblyCompany("")] [assembly: AssemblyProduct("HoneyToSugar")] [assembly: AssemblyCopyright("Copyright © 2025")] [assembly: AssemblyTrademark("")] [assembly: ComVisible(false)] [assembly: Guid("655eda53-8a9a-4c81-a12e-6697f688cf71")] [assembly: AssemblyFileVersion("1.0.0.0")] [assembly: TargetFramework(".NETFramework,Version=v4.7.2", FrameworkDisplayName = ".NET Framework 4.7.2")] [assembly: AssemblyVersion("1.0.0.0")] [HarmonyPatch(typeof(RecipePaper))] public static class RecipePaperPatch { [HarmonyPrefix] [HarmonyPatch("__initializeVariables")] private static bool Prefix(RecipePaper __instance) { //IL_0006: Unknown result type (might be due to invalid IL or missing references) //IL_000b: Unknown result type (might be due to invalid IL or missing references) //IL_008d: Unknown result type (might be due to invalid IL or missing references) //IL_0092: Unknown result type (might be due to invalid IL or missing references) Scene activeScene = SceneManager.GetActiveScene(); Debug.LogWarning((object)("当前场景:" + ((Scene)(ref activeScene)).name)); RecipeSO val = null; for (int i = 0; i < __instance.recipes.Count; i++) { if (__instance.recipes[i].output.itemName.Contains("bread")) { val = __instance.recipes[i]; break; } } if ((Object)(object)val == (Object)null) { return true; } activeScene = SceneManager.GetActiveScene(); string name = ((Scene)(ref activeScene)).name; RecipeSO item = ((!(name == "BazaarRome")) ? InputItem.createRecipeSO(1730656174037L, 2, 0, new List { new InputItem(1710878044001L, 1) }) : InputItem.createRecipeSO(1761424547347L, 2, 0, new List { new InputItem(1761424325364L, 1) })); __instance.recipes.Add(item); return true; } } [HarmonyPatch(typeof(BlockOven))] public class BlockOvenPatch { [HarmonyPostfix] [HarmonyPatch("__initializeVariables")] private static void Postfix(BlockOven __instance) { //IL_0001: Unknown result type (might be due to invalid IL or missing references) //IL_0006: Unknown result type (might be due to invalid IL or missing references) Scene activeScene = SceneManager.GetActiveScene(); string name = ((Scene)(ref activeScene)).name; RecipeSO item = ((!(name == "BazaarRome")) ? InputItem.createRecipeSO(1730656174037L, 2, 0, new List { new InputItem(1710878044001L, 1) }) : InputItem.createRecipeSO(1761424547347L, 2, 0, new List { new InputItem(1761424325364L, 1) })); __instance.recipes.Add(item); } } [BepInPlugin("com.lan.HoneyToSuger", "蜂蜜制作白糖", "1.3.0")] public class CustomFishStack : BaseUnityPlugin { private void Awake() { //IL_0006: Unknown result type (might be due to invalid IL or missing references) //IL_000c: Expected O, but got Unknown Harmony val = new Harmony("com.lan.HoneyToSuger"); val.PatchAll(); Debug.LogWarning((object)"蜂蜜制作白糖 --作者:她说缝上都不给我"); } } public class InputItem { public int inputAmount; public long inputItemid; public InputItem(long inputItemId, int inputAmount) { inputItemid = inputItemId; this.inputAmount = inputAmount; } public static RecipeSO createRecipeSO(long outputItemId, int outputAmount, int requiredDays, List inputItems) { //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_0062: Unknown result type (might be due to invalid IL or missing references) //IL_0071: Expected O, but got Unknown RecipeSO val = ScriptableObject.CreateInstance(); ItemSO itemById = GameManager.Instance.GetItemById(outputItemId); val.output = itemById; val.amount = outputAmount; val.requiredDays = requiredDays; List list = new List(); foreach (InputItem inputItem in inputItems) { ItemSO itemById2 = GameManager.Instance.GetItemById(inputItem.inputItemid); Ingredient item = new Ingredient { itemSO = itemById2, amount = inputItem.inputAmount }; list.Add(item); } val.ingredients = list; return val; } }