tModLoader v2023.01
A mod to make and play Terraria mods
|
Classes | |
class | Condition |
class | ConsumptionRules |
interface | ICondition |
Public Member Functions | |
bool | AcceptedByItemGroups (int invType, int reqType) |
Recipe | AddCondition (Condition condition) |
Recipe | AddCondition (IEnumerable< Condition > conditions) |
Adds a collectiom of conditions that will determine whether or not the recipe will be to be available for the player to use. The conditions can be unrelated to items or tiles (for example, biome or time). More... | |
Recipe | AddCondition (NetworkText description, Predicate< Recipe > condition) |
Sets a condition delegate that will determine whether or not the recipe will be to be available for the player to use. The condition can be unrelated to items or tiles (for example, biome or time). More... | |
Recipe | AddCondition (params Condition[] conditions) |
Adds an array of conditions that will determine whether or not the recipe will be to be available for the player to use. The conditions can be unrelated to items or tiles (for example, biome or time). More... | |
Recipe | AddConsumeItemCallback (ConsumeItemCallback callback) |
Sets a callback that 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. | |
Recipe | AddIngredient (int itemID, int stack=1) |
Adds an ingredient to this recipe with the given item type and stack size. Ex: recipe.AddIngredient(ItemID.IronAxe) More... | |
Recipe | AddIngredient (Mod mod, string itemName, int stack=1) |
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. More... | |
Recipe | AddIngredient (ModItem item, int stack=1) |
Adds an ingredient to this recipe of the given type of item and stack size. More... | |
Recipe | AddIngredient< T > (int stack=1) |
Adds an ingredient to this recipe of the given type of item and stack size. More... | |
Recipe | AddOnCraftCallback (OnCraftCallback callback) |
Sets a callback that will allow you to make anything happen when the recipe is used to create an item. | |
Recipe | AddRecipeGroup (int recipeGroupId, int stack=1) |
Adds a recipe group ingredient to this recipe with the given RecipeGroupID and stack size. Vanilla recipe group IDs can be found in Terraria.ID.RecipeGroupID and modded recipe group IDs will be returned from RecipeGroup.RegisterGroup. More... | |
Recipe | AddRecipeGroup (RecipeGroup recipeGroup, int stack=1) |
Adds a recipe group ingredient to this recipe with the given RecipeGroup. More... | |
Recipe | AddRecipeGroup (string name, int stack=1) |
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". More... | |
Recipe | AddTile (int tileID) |
Adds a required crafting station with the given tile type to this recipe. Ex: recipe.AddTile(TileID.WorkBenches) More... | |
Recipe | AddTile (Mod mod, string tileName) |
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. More... | |
Recipe | AddTile (ModTile tile) |
Adds a required crafting station to this recipe of the given type of tile. More... | |
Recipe | AddTile< T > () |
Adds a required crafting station to this recipe of the given type of tile. More... | |
Recipe | Clone () |
Returns a clone of this recipe except the source mod of the Recipe will the currently loading mod. The clone will have to be registered after being tweaked. | |
delegate void | ConsumeItemCallback (Recipe recipe, int type, ref int amount) |
void | Create () |
void | DisableRecipe () |
bool | HasCondition (Condition condition) |
bool | HasIngredient (int itemID) |
bool | HasIngredient (Mod mod, string itemName) |
bool | HasIngredient (ModItem item) |
bool | HasIngredient< T > () |
bool | HasRecipeGroup (int id) |
bool | HasRecipeGroup (RecipeGroup group) |
bool | HasRecipeGroup (string name) |
bool | HasResult (int itemID) |
bool | HasResult (Mod mod, string itemName) |
bool | HasResult (ModItem item) |
bool | HasResult< T > () |
bool | HasTile (int tileID) |
bool | HasTile (Mod mod, string tileName) |
bool | HasTile (ModTile tile) |
bool | HasTile< T > () |
delegate void | OnCraftCallback (Recipe recipe, Item item, List< Item > consumedItems, Item destinationStack) |
bool | ProcessGroupsForText (int type, out string theText) |
Recipe | Register () |
Adds this recipe to the game. Call this after you have finished setting the result, ingredients, etc. More... | |
bool | RemoveCondition (Condition condition) |
bool | RemoveIngredient (int itemID) |
bool | RemoveIngredient (Item item) |
bool | RemoveRecipeGroup (int groupID) |
bool | RemoveTile (int tileID) |
void | ReplaceResult (int itemID, int stack=1) |
void | ReplaceResult (Mod mod, string itemName, int stack=1) |
void | ReplaceResult (ModItem item, int stack=1) |
void | ReplaceResult< T > (int stack=1) |
Recipe | SortAfter (Recipe recipe) |
Sorts the recipe after the one given as parameter. Both recipes must already be registered. | |
Recipe | SortAfterFirstRecipesOf (int itemId) |
Sorts the recipe after the first one creating the item of the ID given as parameter. | |
Recipe | SortBefore (Recipe recipe) |
Sorts the recipe before the one given as parameter. Both recipes must already be registered. | |
Recipe | SortBeforeFirstRecipesOf (int itemId) |
Sorts the recipe before the first one creating the item of the ID given as parameter. | |
bool | TryGetIngredient (int itemID, out Item ingredient) |
bool | TryGetIngredient (Mod mod, string itemName, out Item ingredient) |
bool | TryGetIngredient (ModItem item, out Item ingredient) |
bool | TryGetIngredient< T > (out Item ingredient) |
bool | TryGetResult (int itemID, out Item result) |
bool | TryGetResult (Mod mod, string itemName, out Item result) |
bool | TryGetResult (ModItem item, out Item result) |
bool | TryGetResult< T > (out Item result) |
Static Public Member Functions | |
static Recipe | Create (int result, int amount=1) |
static void | FindRecipes (bool canDelayCheck=false) |
static int | GetRequiredTileStyle (int tileID) |
static void | GetThroughDelayedFindRecipes () |
static void | SetupRecipeGroups () |
static void | SetupRecipes () |
static void | UpdateWhichItemsAreMaterials () |
Public Attributes | |
List< int > | acceptedGroups = new List<int>() |
readonly List< Condition > | Conditions = new List<Condition>() |
Item | createItem = new Item() |
readonly Mod | Mod |
List< Item > | requiredItem = new List<Item>() |
List< int > | requiredTile = new List<int>() |
Recipe | target |
Static Public Attributes | |
static int | maxRecipes = 3000 |
static int | numRecipes |
Properties | |
bool | Disabled [get] |
Any recipe with this flag won't be shown in game. | |
Recipe bool after | Ordering [get, set] |
int | RecipeIndex [get, set] |
The index of the recipe in the Main.recipe array. | |
Recipe Terraria.Recipe.AddCondition | ( | IEnumerable< Condition > | conditions | ) |
Adds a collectiom of conditions that will determine whether or not the recipe will be to be available for the player to use. The conditions can be unrelated to items or tiles (for example, biome or time).
conditions | A collection of conditions. |
Recipe Terraria.Recipe.AddCondition | ( | NetworkText | description, |
Predicate< Recipe > | condition | ||
) |
Sets a condition delegate that will determine whether or not the recipe will be to be available for the player to use. The condition can be unrelated to items or tiles (for example, biome or time).
condition | The predicate delegate condition. |
description | A description of this condition. Use NetworkText.FromKey, or NetworkText.FromLiteral for this. |
Adds an array of conditions that will determine whether or not the recipe will be to be available for the player to use. The conditions can be unrelated to items or tiles (for example, biome or time).
conditions | An array of conditions. |
Recipe Terraria.Recipe.AddIngredient | ( | int | itemID, |
int | stack = 1 |
||
) |
Adds an ingredient to this recipe with the given item type and stack size. Ex: recipe.AddIngredient(ItemID.IronAxe)
itemID | The item identifier. |
stack | The stack. |
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.
mod | The mod. |
itemName | Name of the item. |
stack | The stack. |
RecipeException | The item " + itemName + " does not exist in mod " + mod.Name + ". If you are trying to use a vanilla item, try removing the first argument. |
Adds an ingredient to this recipe of the given type of item and stack size.
item | The item. |
stack | The stack. |
Recipe Terraria.Recipe.AddIngredient< T > | ( | int | stack = 1 | ) |
Adds an ingredient to this recipe of the given type of item and stack size.
stack | The stack. |
T | : | ModItem | |
T | : | AddIngredient | |
T | : | ModContent.ItemType<T>() | |
T | : | stack |
Recipe Terraria.Recipe.AddRecipeGroup | ( | int | recipeGroupId, |
int | stack = 1 |
||
) |
Adds a recipe group ingredient to this recipe with the given RecipeGroupID and stack size. Vanilla recipe group IDs can be found in Terraria.ID.RecipeGroupID and modded recipe group IDs will be returned from RecipeGroup.RegisterGroup.
recipeGroupId | The RecipeGroupID. |
stack | The stack. |
RecipeException | A recipe group with the ID " + recipeGroupID + " does not exist. |
Recipe Terraria.Recipe.AddRecipeGroup | ( | RecipeGroup | recipeGroup, |
int | stack = 1 |
||
) |
Adds a recipe group ingredient to this recipe with the given RecipeGroup.
recipeGroup | The RecipeGroup. |
stack |
Recipe Terraria.Recipe.AddRecipeGroup | ( | string | name, |
int | stack = 1 |
||
) |
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".
name | The name. |
stack | The stack. |
RecipeException | A recipe group with the name " + name + " does not exist. |
Recipe Terraria.Recipe.AddTile | ( | int | tileID | ) |
Adds a required crafting station with the given tile type to this recipe. Ex: recipe.AddTile(TileID.WorkBenches)
tileID | The tile identifier. |
RecipeException | No tile has ID " + tileID |
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.
mod | The mod. |
tileName | Name of the tile. |
RecipeException | The tile " + tileName + " does not exist in mod " + mod.Name + ". If you are trying to use a vanilla tile, try using Recipe.AddTile(tileID). |
Adds a required crafting station to this recipe of the given type of tile.
tile | The tile. |
Recipe Terraria.Recipe.AddTile< T > | ( | ) |
Adds a required crafting station to this recipe of the given type of tile.
T | : | ModTile | |
T | : | AddTile | |
T | : | ModContent.TileType<T>() |
bool Terraria.Recipe.HasIngredient< T > | ( | ) |
T | : | ModItem | |
T | : | HasIngredient | |
T | : | ModContent.ItemType<T>() |
bool Terraria.Recipe.HasResult< T > | ( | ) |
T | : | ModItem | |
T | : | HasResult | |
T | : | ModContent.ItemType<T>() |
bool Terraria.Recipe.HasTile< T > | ( | ) |
T | : | ModTile | |
T | : | HasTile | |
T | : | ModContent.TileType<T>() |
Recipe Terraria.Recipe.Register | ( | ) |
Adds this recipe to the game. Call this after you have finished setting the result, ingredients, etc.
RecipeException | A recipe without any result has been added. |
void Terraria.Recipe.ReplaceResult< T > | ( | int | stack = 1 | ) |
T | : | ModItem | |
T | : | ReplaceResult | |
T | : | ModContent.ItemType<T>() | |
T | : | stack |
bool Terraria.Recipe.TryGetIngredient< T > | ( | out Item | ingredient | ) |
T | : | ModItem | |
T | : | TryGetIngredient | |
T | : | ModContent.ItemType<T>() | |
T | : | out | |
T | : | ingredient |
bool Terraria.Recipe.TryGetResult< T > | ( | out Item | result | ) |
T | : | ModItem | |
T | : | TryGetResult | |
T | : | ModContent.ItemType<T>() | |
T | : | out | |
T | : | result |