• For issues you find with the Switch and Console releases, please follow this link and give as much detail as possible. This is the speediest way to get info to Pipeworks and get a hotfix in the works.
  • 1.4 will bring many changes to the PC version. We strongly advise making plans to back up your worlds and players prior to updating your game. More details here.
  • Begin your search for Journey's End information here and here. Please report bugs and issues for Journey's End here.
  • For issues you find with the Mobile 1.3 update, please follow this link and give as much detail as possible. This is the speediest way to get info to DR Studios to look at your issue. Also, some troubleshooting hints here.

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.
 

jopojelly

Retinazer
tModLoader
Add
Main.tileFrameImportant[Type] = true;
Delete
drop = mod.ItemType("AlloySmelter");
Come to the tModLoader Discord for future help.
 

BlackFenix06

Terrarian
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.
 
Top Bottom