ModRecipe
This class extends Terraria.Recipe, meaning you can use it in a similar manner to vanilla recipes. However, it provides methods that simplify recipe creation. Recipes are added by creating new instances of ModRecipe, then calling the AddRecipe method.
Methods
- #ctor(Terraria.ModLoader.Mod)()
- Constructor
- SetResult(System.Int32,System.Int32)()
- Sets the result of this recipe with the given item type and stack size.
- SetResult(Terraria.ModLoader.Mod,System.String,System.Int32)()
- Sets the result of this recipe with the given item name from the given mod, and with the given stack stack. If the mod parameter is null, then it will automatically use an item from the mod creating this recipe.
- SetResult(Terraria.ModLoader.ModItem,System.Int32)()
- Sets the result of this recipe to the given type of item and stack size. Useful in ModItem.AddRecipes.
- AddIngredient(System.Int32,System.Int32)()
- Adds an ingredient to this recipe with the given item type and stack size. Ex:
- AddIngredient(Terraria.ModLoader.Mod,System.String,System.Int32)()
- Adds an ingredient to this recipe with the given item name from the given mod, and with the given stack stack. If the mod parameter is null, then it will automatically use an item from the mod creating this recipe.
- AddIngredient(Terraria.ModLoader.ModItem,System.Int32)()
- Adds an ingredient to this recipe of the given type of item and stack size.
- AddRecipeGroup(System.String,System.Int32)()
- Adds a recipe group ingredient to this recipe with the given RecipeGroup name and stack size. Vanilla recipe groups consist of "Wood", "IronBar", "PresurePlate", "Sand", and "Fragment".
- AddTile(System.Int32)()
- Adds a required crafting station with the given tile type to this recipe. Ex:
- AddTile(Terraria.ModLoader.Mod,System.String)()
- Adds a required crafting station to this recipe with the given tile name from the given mod. If the mod parameter is null, then it will automatically use a tile from the mod creating this recipe.
- AddTile(Terraria.ModLoader.ModTile)()
- Adds a required crafting station to this recipe of the given type of tile.
- RecipeAvailable()
- Whether or not the conditions are met for this recipe to be available for the player to use. This hook can be used for conditions unrelated to items or tiles (for example, biome or time).
- OnCraft(Terraria.Item)()
- Allows you to make anything happen when the player uses this recipe. The
- ConsumeItem(System.Int32,System.Int32)()
- Allows you to determine how many of a certain ingredient is consumed when this recipe is used. Return the number of ingredients that will actually be consumed. By default returns numRequired.
- AddRecipe()
- Adds this recipe to the game. Call this after you have finished setting the result, ingredients, etc.