tModLoader Block placed gray and duplicated

BlackFenix06

Terrarian
Hello to all. I'm having a problem and I honestly do not know how to solve it. Given that I've just started and I'm trying to learn. I created a 32x32 block, but when I place it I get this:


The problem is that once you have placed the block, everything becomes gray and the other problem, well, you can very well see from the video. :rolleyes::sigh:

Items\Placeable\AlloySmelter.cs:
Code:
using Terraria;
using Terraria.ID;
using Terraria.ModLoader;

namespace IndustrialMod.Items.Placeable
{
    public class AlloySmelter : ModItem
    {
        public override void SetStaticDefaults()
        {
            DisplayName.SetDefault("Fonderia");
            Tooltip.SetDefault("Utilizzato per ottenere nuovi materiali");
        }
        public override void SetDefaults()
        {
            item.width = 32;
            item.height = 32;
            item.value = 10000;
            item.useStyle = 1;
            item.useTime = 20;
            item.useAnimation = 20;
            item.useTurn = true;
            item.autoReuse = true;
            item.consumable = true;
            item.createTile = mod.TileType("AlloySmelter");
        }

        public override void AddRecipes()
        {
            ModRecipe recipe = new ModRecipe(mod);
            recipe.AddIngredient(ItemID.DirtBlock, 10);
            recipe.AddTile(TileID.WorkBenches);
            recipe.SetResult(this);
            recipe.AddRecipe();
        }
    }
}

Tiles\AlloySmelter.cs:
Code:
using Microsoft.Xna.Framework;
using Terraria;
using Terraria.ModLoader;
using Terraria.ObjectData;

namespace IndustrialMod.Tiles
{
    public class AlloySmelter : ModTile
    {
        public override void SetDefaults()
        {
            Main.tileNoAttach[Type] = true;
            Main.tileTable[Type] = true;
            Main.tileBlockLight[Type] = true;
            Main.tileLighted[Type] = true;
            TileObjectData.newTile.CopyFrom(TileObjectData.Style2x2);
            TileObjectData.addTile(Type);
            drop = mod.ItemType("AlloySmelter");
        }
        public override void KillMultiTile(int i, int j, int frameX, int frameY)
        {
            Item.NewItem(i * 32, j * 32, 32, 32, mod.ItemType("AlloySmelter"));
        }
    }
}

I used as an example, the code in "exampleMod" concerning the chest, the bed and the trophy.
 
Add
Main.tileFrameImportant[Type] = true;
Delete
drop = mod.ItemType("AlloySmelter");
Come to the tModLoader Discord for future help.
 
Thanks...
Anyway I went on Discord, the problem is that there were already other people asking for help, so to avoid unnecessary confusion I wanted to try here on the forum.
 
Back
Top Bottom