tModLoader v2024.09
A mod to make and play Terraria mods
NPCHeadLoader Class Reference

This class serves as a central place from which NPC head slots are stored and NPC head textures are assigned. This can be used to obtain the corresponding slots to head textures. More...

Static Public Member Functions

static int GetBossHeadSlot (string texture)
 Gets the index of the boss head texture corresponding to the given texture path. More...
 
static int GetHeadSlot (string texture)
 Gets the index of the head texture corresponding to the given texture path. More...
 

Static Public Attributes

static readonly int VanillaBossHeadCount = TextureAssets.NpcHeadBoss.Length
 The number of vanilla boss head textures that exist.
 
static readonly int VanillaHeadCount = TextureAssets.NpcHead.Length
 The number of vanilla town NPC head textures that exist.
 

Properties

static int NPCHeadCount [get]
 

Detailed Description

This class serves as a central place from which NPC head slots are stored and NPC head textures are assigned. This can be used to obtain the corresponding slots to head textures.

Member Function Documentation

◆ GetBossHeadSlot()

static int NPCHeadLoader.GetBossHeadSlot ( string  texture)
static

Gets the index of the boss head texture corresponding to the given texture path.

Parameters
texture
Returns

◆ GetHeadSlot()

static int NPCHeadLoader.GetHeadSlot ( string  texture)
static

Gets the index of the head texture corresponding to the given texture path.

Parameters
textureRelative texture path
Returns
The index of the texture in the heads array, -1 if not found.