tModLoader v0.11.8.9
A mod to make and play Terraria mods
|
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. More...
Public Member Functions | |
RecipeEditor (Recipe recipe) | |
Creates a recipe editor that acts on the given recipe. More... | |
bool | AcceptRecipeGroup (string groupName) |
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. More... | |
void | AddIngredient (int itemID, int stack=1) |
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. More... | |
bool | AddTile (int tileID) |
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. More... | |
bool | DeleteIngredient (int itemID) |
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. More... | |
bool | 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. More... | |
bool | DeleteTile (int tileID) |
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. More... | |
bool | RejectRecipeGroup (string groupName) |
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. More... | |
bool | SetIngredientStack (int itemID, int stack) |
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. More... | |
void | SetNeedHoney (bool needHoney) |
A convenience method for setting recipe.needHoney. More... | |
void | SetNeedLava (bool needLava) |
A convenience method for setting recipe.needLava. More... | |
void | SetNeedWater (bool needWater) |
A convenience method for setting recipe.needWater. More... | |
void | SetResult (int itemID, int stack=1) |
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. More... | |
Private Attributes | |
Recipe | recipe |
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.
Definition at line 8 of file RecipeEditor.cs.
Terraria.ModLoader.RecipeEditor.RecipeEditor | ( | Recipe | recipe | ) |
Creates a recipe editor that acts on the given recipe.
recipe | The recipe this RecipeEditor should focus on. |
Definition at line 16 of file RecipeEditor.cs.
References Terraria.ModLoader.RecipeEditor.recipe.
bool Terraria.ModLoader.RecipeEditor.AcceptRecipeGroup | ( | string | groupName | ) |
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.
groupName | The recipegroup name to accept. |
Definition at line 88 of file RecipeEditor.cs.
References Terraria.ModLoader.RecipeEditor.recipe.
void Terraria.ModLoader.RecipeEditor.AddIngredient | ( | int | itemID, |
int | stack = 1 |
||
) |
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.
itemID | The required item (ingredient) ID |
stack | The required item (ingredient) stack |
Definition at line 25 of file RecipeEditor.cs.
References Terraria.ModLoader.ItemLoader.ItemCount, and Terraria.ModLoader.RecipeEditor.recipe.
bool Terraria.ModLoader.RecipeEditor.AddTile | ( | int | tileID | ) |
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.
tileID | The tile ID to add. |
Definition at line 131 of file RecipeEditor.cs.
References Terraria.ModLoader.RecipeEditor.recipe, and Terraria.ModLoader.TileLoader.TileCount.
bool Terraria.ModLoader.RecipeEditor.DeleteIngredient | ( | int | itemID | ) |
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.
itemID | The item ID of the ingredient to delete. |
Definition at line 67 of file RecipeEditor.cs.
References Terraria.ModLoader.Item, Terraria.ModLoader.ItemLoader.ItemCount, and Terraria.ModLoader.RecipeEditor.recipe.
bool Terraria.ModLoader.RecipeEditor.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.
Definition at line 196 of file RecipeEditor.cs.
References Terraria.ModLoader.RecipeEditor.recipe.
bool Terraria.ModLoader.RecipeEditor.DeleteTile | ( | int | tileID | ) |
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.
tileID | The tile ID to remove. |
Definition at line 152 of file RecipeEditor.cs.
References Terraria.ModLoader.RecipeEditor.recipe, and Terraria.ModLoader.TileLoader.TileCount.
bool Terraria.ModLoader.RecipeEditor.RejectRecipeGroup | ( | string | groupName | ) |
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.
groupName | The recipegroup name to reject. |
Definition at line 105 of file RecipeEditor.cs.
References Terraria.ModLoader.RecipeEditor.recipe.
bool Terraria.ModLoader.RecipeEditor.SetIngredientStack | ( | int | itemID, |
int | stack | ||
) |
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.
itemID | The item ID of the ingredient to set the stack on. |
stack | The new stack amount. |
Definition at line 49 of file RecipeEditor.cs.
References Terraria.ModLoader.ItemLoader.ItemCount, and Terraria.ModLoader.RecipeEditor.recipe.
void Terraria.ModLoader.RecipeEditor.SetNeedHoney | ( | bool | needHoney | ) |
A convenience method for setting recipe.needHoney.
needHoney | Whether the recipe needs honey. |
Definition at line 188 of file RecipeEditor.cs.
void Terraria.ModLoader.RecipeEditor.SetNeedLava | ( | bool | needLava | ) |
A convenience method for setting recipe.needLava.
needLava | Whether the recipe needs lava. |
Definition at line 180 of file RecipeEditor.cs.
void Terraria.ModLoader.RecipeEditor.SetNeedWater | ( | bool | needWater | ) |
A convenience method for setting recipe.needWater.
needWater | Whether the recipe needs water. |
Definition at line 172 of file RecipeEditor.cs.
void Terraria.ModLoader.RecipeEditor.SetResult | ( | int | itemID, |
int | stack = 1 |
||
) |
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.
itemID | The ID of the item to set as result. |
stack | The stack of the item to set as result. |
Definition at line 118 of file RecipeEditor.cs.
References Terraria.ModLoader.ItemLoader.ItemCount, and Terraria.ModLoader.RecipeEditor.recipe.
|
private |
Definition at line 10 of file RecipeEditor.cs.
Referenced by Terraria.ModLoader.RecipeEditor.RecipeEditor(), Terraria.ModLoader.RecipeEditor.AcceptRecipeGroup(), Terraria.ModLoader.RecipeEditor.AddIngredient(), Terraria.ModLoader.RecipeEditor.AddTile(), Terraria.ModLoader.RecipeEditor.DeleteIngredient(), Terraria.ModLoader.RecipeEditor.DeleteRecipe(), Terraria.ModLoader.RecipeEditor.DeleteTile(), Terraria.ModLoader.RecipeEditor.RejectRecipeGroup(), Terraria.ModLoader.RecipeEditor.SetIngredientStack(), and Terraria.ModLoader.RecipeEditor.SetResult().