29 for (
int k = 0; k < Recipe.maxRequirements; k++) {
30 if (
recipe.requiredItem[k].type == 0) {
31 recipe.requiredItem[k].SetDefaults(itemID,
false);
32 recipe.requiredItem[k].stack = stack;
35 if (
recipe.requiredItem[k].type == itemID) {
36 recipe.requiredItem[k].stack += stack;
40 throw new RecipeException(
"Recipe already has maximum number of ingredients");
53 for (
int k = 0; k < Recipe.maxRequirements; k++) {
54 if (
recipe.requiredItem[k].type == itemID) {
55 recipe.requiredItem[k].stack = stack;
71 for (
int k = 0; k < Recipe.maxRequirements; k++) {
72 if (
recipe.requiredItem[k].type == itemID) {
73 for (
int j = k; j < Recipe.maxRequirements - 1; j++) {
76 recipe.requiredItem[Recipe.maxRequirements - 1] =
new Item();
90 if (!RecipeGroup.recipeGroupIDs.TryGetValue(groupName, out groupID)) {
93 if (
recipe.acceptedGroups.Contains(groupID)) {
96 recipe.acceptedGroups.Add(groupID);
107 if (!RecipeGroup.recipeGroupIDs.TryGetValue(groupName, out groupID)) {
110 return recipe.acceptedGroups.Remove(groupID);
122 recipe.createItem.SetDefaults(itemID);
123 recipe.createItem.stack = stack;
135 for (
int k = 0; k < Recipe.maxRequirements; k++) {
136 if (
recipe.requiredTile[k] == -1) {
137 recipe.requiredTile[k] = tileID;
140 if (
recipe.requiredTile[k] == tileID) {
144 throw new RecipeException(
"Recipe already has maximum number of tiles");
156 for (
int k = 0; k < Recipe.maxRequirements; k++) {
157 if (
recipe.requiredTile[k] == tileID) {
158 for (
int j = k; j < Recipe.maxRequirements - 1; j++) {
161 recipe.requiredTile[Recipe.maxRequirements - 1] = -1;
173 recipe.needWater = needWater;
181 recipe.needLava = needLava;
189 recipe.needHoney = needHoney;
197 for (
int k = 0; k < Recipe.numRecipes; k++) {
198 if (Main.recipe[k] ==
recipe) {
199 for (
int j = k; j < Recipe.numRecipes - 1; j++) {
200 Main.recipe[j] = Main.recipe[j + 1];
202 Main.recipe[Recipe.numRecipes - 1] =
new Recipe();
This serves as the central class from which item-related functions are carried out....
This class allows you to make any changes you want to a recipe, whether it be adding/removing ingredi...
bool AcceptRecipeGroup(string groupName)
Adds the recipe group with the given name to the recipe. Note that, unlike ModRecipe and RecipeFinder...
void SetNeedLava(bool needLava)
A convenience method for setting recipe.needLava.
void SetNeedHoney(bool needHoney)
A convenience method for setting recipe.needHoney.
bool DeleteIngredient(int itemID)
Deletes the ingredient requirement with the given ID from the recipe. Returns true if the operation w...
bool DeleteRecipe()
Completely removes the recipe from the game, making it unusable. Returns true if the operation was su...
bool SetIngredientStack(int itemID, int stack)
Sets the stack requirement of the ingredient with the given item ID in the recipe....
void SetResult(int itemID, int stack=1)
A convenience method for setting the result of the recipe. Similar to calling recipe....
bool RejectRecipeGroup(string groupName)
Removes the recipe group with the given name from the recipe. This is the opposite of AcceptRecipeGro...
void SetNeedWater(bool needWater)
A convenience method for setting recipe.needWater.
bool AddTile(int tileID)
Adds the crafting station with the given tile ID to the recipe. Returns true if the operation was suc...
bool DeleteTile(int tileID)
Removes the crafting station with the given tile ID as a requirement from the recipe....
RecipeEditor(Recipe recipe)
Creates a recipe editor that acts on the given recipe.
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 contain...
This serves as the central class from which tile-related functions are supported and carried out.