Hi! I have a silly issue with my first mod and first tile. It seems like for some reason, the tile displayed in the game only shows the single pixel in the bottom right of the spritesheet.
This is what it looks like in the game:
This is what the spritesheet looks like (lots of colors because I was trying to figure out what part of the spritesheet was being displayed). This is a 36x36 sheet. It did the same thing with the 16x16 sprite with only one flower.
My code is copied from ExampleMod- have tried multiple different items/tiles, I believe right now it's copying from the block.
Tile:
Code:
using Microsoft.Xna.Framework;
using System;
using System.Diagnostics;
using Terraria;
using Terraria.DataStructures;
using Terraria.ID;
using Terraria.Localization;
using Terraria.ModLoader;
using Terraria.ObjectData;
namespace OcelotMod.Tiles
{
public class cuteFlowerTile : ModTile
{
public override void SetStaticDefaults()
{
Main.tileSolid[Type] = false;
Main.tileMergeDirt[Type] = false;
Main.tileBlockLight[Type] = false;
AddMapEntry(new Color(200, 200, 200));
DustType = DustID.BubbleBurst_Pink;
}
}
}
Item:
Code:
using Terraria;
using Terraria.ID;
using Terraria.ModLoader;
using OcelotMod.Tiles;
using System.ComponentModel;
namespace OcelotMod.Items
{
public class cuteFlower : ModItem
{
// The Display Name and Tooltip of this item can be edited in the Localization/en-US_Mods.OcelotMod.hjson file.
public override void SetDefaults()
{
Item.DefaultToPlaceableTile(ModContent.TileType<Tiles.cuteFlowerTile>());
Item.value = 1;
Item.width = 8;
Item.height = 8;
Item.useTime = 10;
//Item.UseAnimation = 10;
Item.autoReuse = true;
//Item.consumable = true;
//Item.UseAnimation and Item.consumable are commented out because tmodloader keeps saying they aren't valid methods in Item, but that's a secondary issue
Item.createTile = ModContent.TileType<Tiles.cuteFlowerTile>();
}
public override void AddRecipes()
{
Recipe recipe = CreateRecipe();
recipe.AddIngredient(ItemID.Wood, 1);
recipe.AddIngredient(ItemID.Acorn, 1);
recipe.AddTile(TileID.WorkBenches);
recipe.Register();
}
}
}
Any insight into what's going on is appreciated! Thank you!