public void AddBossHeadTexture(string texture) { int slot = NPCHeadLoader.ReserveBossHeadSlot(texture); NPCHeadLoader.bossHeads[texture] = slot; ModLoader.GetTexture(texture); }
/// <summary> /// Assigns a head texture that can be used by NPCs on the map. /// </summary> /// <param name="texture">The texture.</param> /// <param name="npcType">An optional npc id for NPCID.Sets.BossHeadTextures</param> public void AddBossHeadTexture(string texture, int npcType = -1) { if (!loading) { throw new Exception("AddBossHeadTexture can only be called from Mod.Load or Mod.Autoload"); } int slot = NPCHeadLoader.ReserveBossHeadSlot(texture); NPCHeadLoader.bossHeads[texture] = slot; ModContent.GetTexture(texture); if (npcType >= 0) { NPCHeadLoader.npcToBossHead[npcType] = slot; } }