Terraria.ModLoader.ModRecipe.SetResult C# (CSharp) Method

SetResult() public method

public SetResult ( Mod mod, string itemName, int stack = 1 ) : void
mod Mod
itemName string
stack int
return void
		public void SetResult(Mod mod, string itemName, int stack = 1)
		{
			if (mod == null)
			{
				mod = this.mod;
			}
			int type = mod.ItemType(itemName);
			if (type == 0)
			{
				string message = "The item " + itemName + " does not exist in the mod " + mod.Name + "." + Environment.NewLine;
				message += "If you are trying to use a vanilla item, try removing the first argument.";
				throw new RecipeException(message);
			}
			this.SetResult(type, stack);
		}

Same methods

ModRecipe::SetResult ( ModItem item, int stack = 1 ) : void
ModRecipe::SetResult ( int itemID, int stack = 1 ) : void
ModRecipe::SetResult ( string itemName, int stack = 1 ) : void

Usage Example

Ejemplo n.º 1
0
 public override void AddRecipes()
 {
     ModRecipe recipe = new ModRecipe(mod);
         recipe.AddIngredient(null, "BismiteCrystal", 8);
         recipe.SetResult(this, 1);
         recipe.AddRecipe();
 }
All Usage Examples Of Terraria.ModLoader.ModRecipe::SetResult