public static void SerializeNPC(Terraria.NPC npc, XmlDictionaryWriter writer, bool SetDefaults_Int32 = true)
        {
            writer.WriteString("\n\t");
            writer.WriteStartElement("NPC");

            foreach (var feild in Feilds)
            {
                switch (feild)
                {
                    case "ConfusionImmunity":
                        writer.WriteCustomObject(npc.buffImmune[31], feild);
                        break;
                    case "PoisonImmunity":
                        writer.WriteCustomObject(npc.buffImmune[20], feild);
                        break;
                    case "BurningImmunity":
                        writer.WriteCustomObject(npc.buffImmune[24], feild);
                        break;
                    case "CurseImmunity":
                        writer.WriteCustomObject(npc.buffImmune[39], feild);
                        break;
                    case "Name":
                        writer.WriteCustomObject(npc.name, feild);
                        break;
                    case "Type":
                        if (SetDefaults_Int32)
                            writer.WriteCustomObject(npc.type, feild);
                        else
                            writer.WriteCustomObject(npc.type, "Inherits");
                        break;
                    case "aiStyle":
                        writer.WriteCustomObject(npc.aiStyle, feild);
                        break;
                    case "scale":
                        writer.WriteCustomObject(npc.scale, feild);
                        break;
                    case "damage":
                        writer.WriteCustomObject(npc.damage, feild);
                        break;
                    case "defense":
                        writer.WriteCustomObject(npc.defense, feild);
                        break;
                    case "lifeMax":
                        writer.WriteCustomObject(npc.lifeMax, feild);
                        break;
                    case "value":
                        writer.WriteCustomObject(npc.value, feild);
                        break;
                    case "knockBackResist":
                        writer.WriteCustomObject(npc.knockBackResist, feild);
                        break;
                    case "Width":
                        writer.WriteCustomObject(npc.width, feild);
                        break;
                    case "Height":
                        writer.WriteCustomObject(npc.height, feild);
                        break;
                    case "slots":
                        writer.WriteCustomObject(npc.npcSlots, feild);
                        break;
                    case "noTileCollide":
                        writer.WriteCustomObject(npc.noTileCollide, feild);
                        break;
                    case "noGravity":
                        writer.WriteCustomObject(npc.noGravity, feild);
                        break;
                    case "behindTiles":
                        writer.WriteCustomObject(npc.behindTiles, feild);
                        break;
                    case "DisplayName":
                        if(npc.displayName != npc.name)
                            writer.WriteCustomObject(npc.displayName, feild);
                        break;
                    case "NetAlways":
                        writer.WriteCustomObject(npc.netAlways, feild);
                        break;
                    case "netSkip":
                        writer.WriteCustomObject(npc.netSkip, feild);
                        break;
                    case "NetID":
                        writer.WriteCustomObject(npc.netID, feild);
                        break;
                    default:
                        throw new Exception("This class is feild specific! Please add the relative feild above [" + feild + "]");
                }
            }

            writer.WriteString("\n\t");
            writer.WriteEndElement();
        }