diff --git a/TShockAPI/TSServerPlayer.cs b/TShockAPI/TSServerPlayer.cs index 94036b96..b155bf53 100644 --- a/TShockAPI/TSServerPlayer.cs +++ b/TShockAPI/TSServerPlayer.cs @@ -153,7 +153,14 @@ namespace TShockAPI out spawnTileY); int npcid = NPC.NewNPC(spawnTileX * 16, spawnTileY * 16, type, 0); // This is for special slimes - Main.npc[npcid].SetDefaults(name); + if (type == 1) + { + Main.npc[npcid].SetDefaults(name); + } + else + { + Main.npc[npcid].netDefaults(type); + } } } diff --git a/TShockAPI/Utils.cs b/TShockAPI/Utils.cs index 34d9d20d..0dd94d71 100644 --- a/TShockAPI/Utils.cs +++ b/TShockAPI/Utils.cs @@ -420,9 +420,9 @@ namespace TShockAPI for (int i = -17; i < Main.maxNPCTypes; i++) { npc.netDefaults(i); - if (npc.name.ToLower() == nameLower) + if (npc.name.ToLower() == nameLower || npc.displayName.ToLower() == nameLower) return new List { npc }; - if (npc.name.ToLower().StartsWith(nameLower)) + if (npc.name.ToLower().StartsWith(nameLower) || npc.displayName.ToLower().StartsWith(nameLower)) found.Add((NPC)npc.Clone()); } return found;