Так что я делаю свой собственный Terraria Mod, но у меня есть одна проблема, которая заключается в том, что, когда я использую один элемент из моего мода в рецепте crating для чего-то еще в моем мод, он дает мне ошибку.Проблемы с tModLoader с компиляцией
Это элемент, который использует что-то из моего мода:
using System;
using Microsoft.Xna.Framework;
using Terraria;
using Terraria.Graphics.Effects;
using Terraria.Graphics.Shaders;
using Terraria.ID;
using Terraria.ModLoader;
namespace TestMod.Items.Weapons //Where it is located
{
public class BladeOfTheElements : ModItem
{
public override void SetDefaults()
{
item.name = "Blade Of The Elements"; //Sword name
item.damage = 26; //Sword damage - Damage is x2.5 - 43 here = 109 in game
item.crit = -46; //Crit chance of the weapon
item.melee = true; //Is it a melee item?
item.width = 74; //Sword width
item.height = 74; //Sword height
item.toolTip = "A blade containing the power of; Fire, Ice and Forest"; //Item Description
item.useTime = 23; //How fast is the item? How fast does it swing or shoot?
item.useAnimation = 23;
item.useStyle = 1; //How is the item used? 1 is sword
item.knockBack = 4; //The knockback of the item
item.value = 100000; //How much does it sell for? 100 = 1 Silver
item.rare = 5;
item.useSound = 1; //What sound type? 1 is sword
item.autoReuse = true; //If it's a sword can it autoswing?
item.useTurn = true;
item.shoot = mod.ProjectileType("BladeOfTheElementsProj");
item.shootSpeed = 6f; //Speed of the projectile
}
public override void AddRecipes() //How do you craft the item?
{
ModRecipe recipe = new ModRecipe(mod);
recipe.AddIngredient(ItemID.BladeOfTheForest, 1); //What do you need to craft the item? (Use 1 dirt block for testing)
recipe.AddIngredient(ItemID.BladeOfIce, 1);
recipe.AddIngredient(ItemID.BladeOfTheDemons, 1);
recipe.AddTile(TileID.Anvils); //Where is it made? Work bench, anvil, water? etc (Use worck bench for testing)
recipe.SetResult(this);
recipe.AddRecipe();
}
}
}
Все лезвия в рецепте крафт на дне из моего мода, но я получаю эту ошибку, когда я пытаюсь скомпилировать мой мод:
Произошла ошибка при компиляции мод.
c:/Users/Nicolas/Documents/My Games/Terraria/ModLoader/Mod Sources/TestMod/Items/Weapons/BladeOfTheElements.cs(37,41) : error CS0117: 'Terraria.ID.ItemID' does not contain a definition for 'BladeOfTheForest'
Я просто хотел бы отметить, что, когда я использовал грязь блоки для рецепта (Для того, чтобы проверить оружие) я мог собрать мод просто отлично.
Это похоже на вопрос C#, а не на Visual C++. Возможно, вы захотите добавить тег [C#], чтобы правильные люди смотрели на него. –