namespace WeaveLoader.API.Recipe;
///
/// Recipe registration via the WeaveLoader registry.
/// Accessed through .
///
public static class RecipeRegistry
{
///
/// Add a shaped crafting recipe.
///
/// The output item identifier.
/// Number of items produced.
/// Crafting grid pattern rows (e.g. "XXX", " | ", " | " for a pickaxe).
/// Character-to-ingredient mappings.
public static void AddShaped(Identifier result, int resultCount, string[] pattern,
params (char key, Identifier ingredient)[] keys)
{
string patternStr = string.Join(";", pattern);
string ingredientStr = string.Join(";",
keys.Select(k => $"{k.key}={k.ingredient}"));
NativeInterop.native_add_shaped_recipe(
result.ToString(), resultCount, patternStr, ingredientStr);
Logger.Debug($"Added shaped recipe -> {resultCount}x {result}");
}
///
/// Add a furnace/smelting recipe.
///
/// The input item/block identifier.
/// The output item identifier.
/// Experience granted per smelt.
public static void AddFurnace(Identifier input, Identifier output, float xp)
{
NativeInterop.native_add_furnace_recipe(input.ToString(), output.ToString(), xp);
Logger.Debug($"Added furnace recipe: {input} -> {output} ({xp} xp)");
}
}