RecipeEditor
This class allows you to make any changes you want to a recipe, whether it be adding/removing ingredients, changing the result, or removing the recipe entirely.
Methods
- #ctor(Terraria.Recipe)()
- Creates a recipe editor that acts on the given recipe.
- AddIngredient(System.Int32,System.Int32)()
- Adds an ingredient with the given item ID and stack size to the recipe. If the recipe already contains the ingredient, it will increase the stack requirement instead. Can also throw a RecipeException.
- SetIngredientStack(System.Int32,System.Int32)()
- Sets the stack requirement of the ingredient with the given item ID in the recipe. Returns true if the operation was successful. Returns false if the recipe does not contain the ingredient. Can also throw a RecipeException.
- DeleteIngredient(System.Int32)()
- Deletes the ingredient requirement with the given ID from the recipe. Returns true if the operation was successful. Returns false if the recipe did not contain the ingredient in the first place. Can also throw a RecipeException.
- AcceptRecipeGroup(System.String)()
- Adds the recipe group with the given name to the recipe. Note that, unlike ModRecipe and RecipeFinder, this won't actually add an ingredient; it will only allow existing ingredients to be interchangeable with other items. Returns true if the operation was successful. Returns false if the recipe already accepts the given recipe group. Can also throw a RecipeException.
- RejectRecipeGroup(System.String)()
- Removes the recipe group with the given name from the recipe. This is the opposite of AcceptRecipeGroup; while it won't remove ingredients, it will make existing ingredients no longer be interchangeable with other items. Returns true if the operation was successful. Returns false if the recipe did not contain the recipe group in the first place. Can also throw a RecipeException.
- SetResult(System.Int32,System.Int32)()
- A convenience method for setting the result of the recipe. Similar to calling recipe.createItem.SetDefaults(itemID), followed by recipe.createItem.stack = stack. Can also throw a RecipeException.
- AddTile(System.Int32)()
- Adds the crafting station with the given tile ID to the recipe. Returns true if the operation was successful. Returns false if the recipe already requires the given tile. Can also throw a RecipeException.
- DeleteTile(System.Int32)()
- Removes the crafting station with the given tile ID as a requirement from the recipe. Returns true if the operation was successful. Returns false if the recipe did not require the tile in the first place. Can also throw a RecipeException.
- SetNeedWater(System.Boolean)()
- A convenience method for setting recipe.needWater.
- SetNeedLava(System.Boolean)()
- A convenience method for setting recipe.needLava.
- SetNeedHoney(System.Boolean)()
- A convenience method for setting recipe.needHoney.
- DeleteRecipe()
- Completely removes the recipe from the game, making it unusable. Returns true if the operation was successful. Returns false if the recipe was already not in the game.