TModLoader v1.4.4.9
TModLoader source code documentation
Loading...
Searching...
No Matches

◆ AddBossHeadTexture()

int Terraria.ModLoader.Mod.AddBossHeadTexture ( string texture,
int npcType = -1 )
inlineinherited

Assigns a head texture that can be used by NPCs on the map.

Parameters
textureThe texture.
npcTypeAn optional npc id for NPCID.Sets.BossHeadTextures
Returns
The boss head texture slot

Definition at line 279 of file Mod.cs.

280 {
281 if (!loading)
282 {
283 throw new Exception("AddBossHeadTexture can only be called from Mod.Load or Mod.Autoload");
284 }
285 int slot = NPCHeadLoader.ReserveBossHeadSlot(texture);
286 NPCHeadLoader.bossHeads[texture] = slot;
287 ModContent.Request<Texture2D>(texture);
288 if (npcType >= 0)
289 {
290 NPCHeadLoader.npcToBossHead[npcType] = slot;
291 }
292 return slot;
293 }

References Terraria.ModLoader.NPCHeadLoader.bossHeads, Terraria.ModLoader.Mod.loading, Terraria.ModLoader.NPCHeadLoader.npcToBossHead, and Terraria.ModLoader.NPCHeadLoader.ReserveBossHeadSlot().

+ Here is the call graph for this function: