Table of Contents

Class RecipeBase<T>

Namespace
Vintagestory.API.Common
Assembly
VintagestoryAPI.dll

Creates a new base recipe type. Almost all recipe types extend from this.

public abstract class RecipeBase<T> : IRecipeBase<T>

Type Parameters

T

The resulting recipe type.

Inheritance
RecipeBase<T>
Implements
Derived
Inherited Members
Extension Methods

Fields

Ingredients

An array of ingredients for this recipe. If only using a single ingredient, see Ingredient.
Required if not using Ingredient.

public CraftingRecipeIngredient[] Ingredients

Field Value

CraftingRecipeIngredient[]

Output

The output when the recipe is successful.

public JsonItemStack Output

Field Value

JsonItemStack

RecipeId

The ID of the recipe. Automatically generated when the recipe is loaded.

public int RecipeId

Field Value

int

Properties

Enabled

Should this recipe be loaded by the game?

public bool Enabled { get; set; }

Property Value

bool

Ingredient

A single ingredient for this recipe. If you need to use more than one ingredient, see Ingredients.
Required if not using Ingredients.

public CraftingRecipeIngredient Ingredient { get; set; }

Property Value

CraftingRecipeIngredient

Name

Adds a name to this recipe. Used for logging, and determining helve hammer workability for smithing recipes.

public AssetLocation Name { get; set; }

Property Value

AssetLocation

Methods

Clone()

public abstract T Clone()

Returns

T

GetNameToCodeMapping(IWorldAccessor)

public abstract Dictionary<string, string[]> GetNameToCodeMapping(IWorldAccessor world)

Parameters

world IWorldAccessor

Returns

Dictionary<string, string[]>

Resolve(IWorldAccessor, string)

public abstract bool Resolve(IWorldAccessor world, string sourceForErrorLogging)

Parameters

world IWorldAccessor
sourceForErrorLogging string

Returns

bool