Hi Jopojelly. I've been using some of your mods for quite some time and now I'm trying to start making my own (for now, just a simple furniture mod).
I'm starting by making the Red Dye placeable. I want it to be placed on tables AND on the ground, but I'm not being able to do that.
I can only enable it to be placed on one or the other.
This is my code:
using Microsoft.Xna.Framework;
using Terraria;
using Terraria.Enums;
using Terraria.ID;
using Terraria.ModLoader;
using Terraria.ObjectData;
namespace RascalFurn.Tiles
{
public class RedDye : ModTile
{
public override void SetDefaults()
{
Main.tileFrameImportant[Type] = true;
Main.tileNoAttach[Type] = true;
Main.tileLavaDeath[Type] = true;
TileObjectData.newTile.CopyFrom(TileObjectData.StyleOnTable1x1);
TileObjectData.newTile.Height = 2;
TileObjectData.newTile.CoordinateHeights = new int[]{ 16 , 16 };
Main.tileNoAttach[Type] = true;
TileObjectData.newTile.StyleHorizontal = true;
//TileObjectData.newAlternate.CopyFrom(TileObjectData.StyleOnTable1x1);
TileObjectData.newTile.UsesCustomCanPlace = true;
TileObjectData.addTile(Type);
ModTranslation name = CreateMapEntryName();
name.SetDefault("Red Dye (Placeable)");
//AddMapEntry(new Color(200, 200, 200), name);
dustType = mod.DustType("Sparkle");
disableSmartCursor = true;
}
public override void NumDust(int i, int j, bool fail, ref int num)
{
num = fail ? 1 : 3;
}
public override void KillMultiTile(int i, int j, int frameX, int frameY)
{
Item.NewItem(i * 16, j * 16, 16, 32, mod.ItemType("RedDye"));
}
}
}
--------------------------------------------------------------------------------------------------------------------------------------------
With that code, I can place it on tables just fine. I also tried TileObjectData.newTile.CopyFrom(TileObjectData.Style1x2):
I was able to place it on the ground, but no on tables with that.
What am I missing? Thanks!!!