internal static bool ShouldStashItem(ACDItem cItem, bool test = false)
        {
            if (ShouldStashItemType(cItem, test))
            {
                return(true);
            }

            var item = Legendary.GetItem(cItem);

            if (item == null)
            {
                Core.Logger.Verbose("  >>  Unknown Item {0} {1} - Auto-keeping", cItem.Name, cItem.ActorSnoId);
                return(true);
            }

            return(ShouldStashItem(item, cItem, test));
        }
        private static IEnumerable <TrinityItem> GetLegendaryExtractionCandidates(InventorySlot slot)
        {
            var alreadyCubedIds = new HashSet <int>(ZetaDia.Storage.PlayerDataManager.ActivePlayerData.KanaisPowersExtractedActorSnoIds);
            var usedIds         = new HashSet <int>();

            foreach (var item in Core.Inventory.Where(i => i.InventorySlot == slot))
            {
                if (!item.IsValid)
                {
                    continue;
                }

                if (item.TrinityItemType == TrinityItemType.HealthPotion)
                {
                    continue;
                }

                if (item.FollowerType != FollowerType.None)
                {
                    continue;
                }

                if (usedIds.Contains(item.ActorSnoId))
                {
                    continue;
                }

                if (DoNotExtractRawItemTypes.Contains(item.RawItemType))
                {
                    continue;
                }

                if (DoNotExtractItemIds.Contains(item.ActorSnoId))
                {
                    continue;
                }

                if (alreadyCubedIds.Contains(item.ActorSnoId))
                {
                    continue;
                }

                if (_blacklistedActorSnoIds.Contains(item.ActorSnoId))
                {
                    continue;
                }

                if (Core.Settings.KanaisCube.ExtractLegendaryPowers == CubeExtractOption.OnlyTrashed && Combat.TrinityCombat.Loot.ShouldStash(item))
                {
                    continue;
                }

                if (Core.Settings.KanaisCube.ExtractLegendaryPowers == CubeExtractOption.OnlyNonAncient && !item.IsAncient)
                {
                    continue;
                }

                if (string.IsNullOrEmpty(Legendary.GetItem(item)?.LegendaryAffix))
                {
                    continue;
                }

                usedIds.Add(item.ActorSnoId);
                yield return(item);
            }
        }