Decompiled source of OvenRecipesHoneyToSugar v1.1.0

BepInEx/plugins/OvenRecipes-HoneyToSugar.dll

Decompiled 4 days ago
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;

[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)
	{
		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;
		}
		RecipeSO item = InputItem.createRecipeSO(1730656174037L, 2, 0, new List<InputItem>
		{
			new InputItem(1710878044001L, 1)
		});
		__instance.recipes.Add(item);
		return true;
	}
}
[HarmonyPatch(typeof(BlockOven))]
public class BlockOvenPatch
{
	[HarmonyPostfix]
	[HarmonyPatch("__initializeVariables")]
	private static void Postfix(BlockOven __instance)
	{
		RecipeSO item = InputItem.createRecipeSO(1730656174037L, 2, 0, new List<InputItem>
		{
			new InputItem(1710878044001L, 1)
		});
		__instance.recipes.Add(item);
	}
}
[BepInPlugin("com.lan.HoneyToSuger", "蜂蜜制作白糖", "1.1.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 long inputItemid;

	public int inputAmount;

	public InputItem(long inputItemId, int inputAmount)
	{
		inputItemid = inputItemId;
		this.inputAmount = inputAmount;
	}

	public static RecipeSO createRecipeSO(long outputItemId, int outputAmount, int requiredDays, List<InputItem> 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<RecipeSO>();
		ItemSO itemById = GameManager.Instance.GetItemById(outputItemId);
		val.output = itemById;
		val.amount = outputAmount;
		val.requiredDays = requiredDays;
		List<Ingredient> list = new List<Ingredient>();
		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;
	}
}