當前位置: 首頁>>代碼示例>>C#>>正文


C# ModRecipe.AddRecipeGroup方法代碼示例

本文整理匯總了C#中Terraria.ModLoader.ModRecipe.AddRecipeGroup方法的典型用法代碼示例。如果您正苦於以下問題:C# ModRecipe.AddRecipeGroup方法的具體用法?C# ModRecipe.AddRecipeGroup怎麽用?C# ModRecipe.AddRecipeGroup使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在Terraria.ModLoader.ModRecipe的用法示例。


在下文中一共展示了ModRecipe.AddRecipeGroup方法的2個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的C#代碼示例。

示例1: AddRecipes

		public override void AddRecipes()
		{
			ModRecipe recipe = new ModRecipe(mod);
			recipe.AddIngredient(ItemID.Starfury);
			recipe.AddRecipeGroup("IronBar", 5);
			recipe.AddTile(TileID.FireflyinaBottle);
			recipe.SetResult(this);
			recipe.AddRecipe();
		}
開發者ID:bluemagic123,項目名稱:tModLoader,代碼行數:9,代碼來源:ExampleCloneItem.cs

示例2: AddRecipes

        public override void AddRecipes()
        {
            ModRecipe recipe = new ModRecipe(mod);
            recipe.AddIngredient(ItemID.DirtBlock);
            recipe.SetResult(this, 999);
            recipe.AddRecipe();
            recipe = new ModRecipe(mod);
            recipe.AddRecipeGroup("ExampleMod:ExampleItem");
            recipe.SetResult(this, 999);
            recipe.AddRecipe();

            /*
            // Start a new Recipe. (Prepend with "ModRecipe " if 1st recipe in code block.)
            recipe = new ModRecipe(mod);
            // Add a Vanilla Ingredient.
            // Look up ItemIDs: https://github.com/bluemagic123/tModLoader/wiki/Vanilla-Item-IDs
            // To specify more than one ingredient, use multiple recipe.AddIngredient() calls.
            recipe.AddIngredient(ItemID.DirtBlock);
            // An optional 2nd argument will specifie a stack of the item.
            recipe.AddIngredient(ItemID.Acorn, 10);
            // We can also specify the current item as an ingredient
            recipe.AddIngredient(this, 2);
            // Add a Mod Ingredient. Do not attempt ItemID.EquipMaterial, it's not how it works.
            recipe.AddIngredient(mod, "EquipMaterial", 3);
            // an alternate approach to the above.
            recipe.AddIngredient(mod.ItemType("EquipMaterial"), 3);
            // RecipeGroups allow you create a recipe that accepts items from a group of similar ingredients. For example, all varieties of Wood are in the vanilla "Wood" Group
            recipe.AddRecipeGroup("Wood"); // check here for other vanilla groups: https://github.com/bluemagic123/tModLoader/wiki/ModRecipe#public-void-addrecipegroupstring-name-int-stack--1
            // Here is using a mod recipe group. Check out ExampleMod.AddRecipeGroups() to see how to register a recipe group.
            recipe.AddRecipeGroup("ExampleMod:ExampleItem", 2);
            // To specify a crafting station, specify a tile. Look up TileIDs: https://github.com/bluemagic123/tModLoader/wiki/Vanilla-Tile-IDs
            recipe.AddTile(TileID.WorkBenches);
            // A mod Tile example. To specify more than one crafting station, use multiple recipe.AddTile() calls.
            recipe.AddTile(mod, "ExampleWorkbench");
            // There is a limit of 15 ingredients and 15 tiles to a recipe.
            // Special
            // Water, Honey, and Lava are not tiles, there are special bools for those. Also needSnowBiome. Water also specifies that it works with Sinks.
            recipe.needHoney = true;
            // Set the result of the recipe. You can use stack here too. Since this is in a ModItem class, we can use "this" to specify this item as the result.
            recipe.SetResult(this, 999); // or, for a vanilla result, recipe.SetResult(ItemID.Muramasa);
            // Finish your recipe
            recipe.AddRecipe();
            */
        }
開發者ID:bluemagic123,項目名稱:tModLoader,代碼行數:44,代碼來源:ExampleItem.cs


注:本文中的Terraria.ModLoader.ModRecipe.AddRecipeGroup方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。