ItemPluginManager()
 {
     VanillaItemMaxType = Enum.GetValues(typeof(EPawnItemType)).Length;
     Logger.Info($"ItemMaxTypeint = {VanillaItemMaxType - 1}");
     foreach (PulsarPlugin plugin in PluginManager.Instance.GetAllPlugins())
     {
         Assembly asm        = plugin.GetType().Assembly;
         Type     ItemPlugin = typeof(ItemPlugin);
         foreach (Type t in asm.GetTypes())
         {
             if (ItemPlugin.IsAssignableFrom(t) && !t.IsInterface && !t.IsAbstract)
             {
                 Logger.Info("Loading Item from assembly");
                 ItemPlugin ItemPluginHandler = (ItemPlugin)Activator.CreateInstance(t);
                 GetItemIDsFromName(ItemPluginHandler.Name, out int MainType, out int SubType);
                 if (MainType == -1)
                 {
                     ItemTypes.Add(ItemPluginHandler);
                     GetItemIDsFromName(ItemPluginHandler.Name, out MainType, out SubType);
                     Logger.Info($"Added Item: '{ItemPluginHandler.Name}' with MainTypeID '{MainType}' and SubTypeID {SubType}");
                 }
                 else
                 {
                     Logger.Info($"Could not add Item from {plugin.Name} with the duplicate name of '{ItemPluginHandler.Name}'");
                 }
             }
         }
     }
 }
        /// <summary>
        /// Creates Vanilla and Modded PLPawnItems
        /// </summary>
        /// <param name="Maintype">Maintype</param>
        /// <param name="Subtype">Subtype</param>
        /// <param name="level">Level</param>
        /// <returns>Vanilla or Modded PLPawnItem</returns>
        public static PLPawnItem CreatePawnItem(int Maintype, int Subtype, int level)
        {
            PLPawnItem InItem = null;

            if (Subtype > 63)
            {
                if (Global.DebugLogging)
                {
                    Logger.Info("UpdateItem insubtype > 63");
                }
                Instance.GetActualMainAndSubTypesFromSubtype(Subtype, out Maintype, out Subtype);
            }
            if (Maintype >= Instance.VanillaItemMaxType)
            {
                int MainTypeformodded = (Maintype - Instance.VanillaItemMaxType) * 64 + Subtype;
                if (Global.DebugLogging)
                {
                    Logger.Info($"MainType for modded is {MainTypeformodded}");
                }
                if (MainTypeformodded <= Instance.ItemTypes.Count && MainTypeformodded > -1)
                {
                    if (Global.DebugLogging)
                    {
                        Logger.Info("Creating Item from list info");
                    }
                    ItemPlugin ItemType = Instance.ItemTypes[MainTypeformodded];
                    InItem         = ItemType.PLPawnItem;
                    InItem.Level   = level;
                    InItem.SubType = 64 + ((Maintype - Instance.VanillaItemMaxType) * 64) + Subtype;
                    Logger.Info($"CreatePawnItem gave item subtype {InItem.SubType}");
                }
            }
            if (InItem == null)
            {
                InItem = PLPawnItem.CreateFromInfo((EPawnItemType)Maintype, Subtype, level);
            }
            return(InItem);
        }