From 786f1ad636b53852cc2f5ee56d81926e5e05869d Mon Sep 17 00:00:00 2001 From: Lulonaut Date: Fri, 30 Dec 2022 16:53:58 +0100 Subject: remove donated items --- .../miscfeatures/inventory/MuseumCheapestItemOverlay.kt | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) (limited to 'src/main') diff --git a/src/main/kotlin/io/github/moulberry/notenoughupdates/miscfeatures/inventory/MuseumCheapestItemOverlay.kt b/src/main/kotlin/io/github/moulberry/notenoughupdates/miscfeatures/inventory/MuseumCheapestItemOverlay.kt index 64b64d80..f97714e1 100644 --- a/src/main/kotlin/io/github/moulberry/notenoughupdates/miscfeatures/inventory/MuseumCheapestItemOverlay.kt +++ b/src/main/kotlin/io/github/moulberry/notenoughupdates/miscfeatures/inventory/MuseumCheapestItemOverlay.kt @@ -231,6 +231,23 @@ object MuseumCheapestItemOverlay { if (itemsToDonate.none { it.internalNames == internalNames }) { itemsToDonate.add(MuseumItem(displayName, internalNames, value, time)) } + } else if (stack.item is ItemDye && stack.itemDamage == 10) { //also check donated items + val name = stack.displayName.stripControlCodes() + println(name) + val armor = Utils.getOpenChestName().endsWith("Armor Sets") + val internalNames = guessInternalNames(name, armor) + println(internalNames) + //remove items that have these internalnames + itemsToDonate.retainAll { it.internalNames != internalNames } + } else { + var name = listOf( + NotEnoughUpdates.INSTANCE.manager.createItemResolutionQuery().withItemStack(stack) + .resolveInternalName() + ) + if (name[0] == null) { + name = guessInternalNames(stack.displayName, true) + } + itemsToDonate.retainAll { it.internalNames != name } } } } -- cgit