diff options
author | Lulonaut <lulonaut@tutanota.de> | 2022-12-30 16:53:58 +0100 |
---|---|---|
committer | Lulonaut <lulonaut@tutanota.de> | 2022-12-30 16:53:58 +0100 |
commit | 786f1ad636b53852cc2f5ee56d81926e5e05869d (patch) | |
tree | 1a833e0a83737de0acb47e1e934a0d4e37338a4b /src | |
parent | 15f7b915189abaebfe851199f5c8de337002e8d1 (diff) | |
download | NotEnoughUpdates-786f1ad636b53852cc2f5ee56d81926e5e05869d.tar.gz NotEnoughUpdates-786f1ad636b53852cc2f5ee56d81926e5e05869d.tar.bz2 NotEnoughUpdates-786f1ad636b53852cc2f5ee56d81926e5e05869d.zip |
remove donated items
Diffstat (limited to 'src')
-rw-r--r-- | src/main/kotlin/io/github/moulberry/notenoughupdates/miscfeatures/inventory/MuseumCheapestItemOverlay.kt | 17 |
1 files changed, 17 insertions, 0 deletions
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 } } } } |