From 4d70a91399a6c1724097ef562d5210d2d1ae097a Mon Sep 17 00:00:00 2001 From: hannibal2 <24389977+hannibal00212@users.noreply.github.com> Date: Thu, 10 Aug 2023 13:31:48 +0200 Subject: using NEUInternalName in ChestValue --- .../java/at/hannibal2/skyhanni/features/misc/ChestValue.kt | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/src/main/java/at/hannibal2/skyhanni/features/misc/ChestValue.kt b/src/main/java/at/hannibal2/skyhanni/features/misc/ChestValue.kt index e0f2e860e..37f1d7c6e 100644 --- a/src/main/java/at/hannibal2/skyhanni/features/misc/ChestValue.kt +++ b/src/main/java/at/hannibal2/skyhanni/features/misc/ChestValue.kt @@ -5,11 +5,12 @@ import at.hannibal2.skyhanni.data.IslandType import at.hannibal2.skyhanni.events.* import at.hannibal2.skyhanni.features.misc.items.EstimatedItemValue import at.hannibal2.skyhanni.utils.* -import at.hannibal2.skyhanni.utils.ItemUtils.getInternalName +import at.hannibal2.skyhanni.utils.ItemUtils.getInternalNameOrNull import at.hannibal2.skyhanni.utils.LorenzUtils.addAsSingletonList import at.hannibal2.skyhanni.utils.LorenzUtils.addButton import at.hannibal2.skyhanni.utils.LorenzUtils.toBoolean import at.hannibal2.skyhanni.utils.LorenzUtils.toInt +import at.hannibal2.skyhanni.utils.NEUItems.getItemStackOrNull import at.hannibal2.skyhanni.utils.NumberUtil.addSeparators import at.hannibal2.skyhanni.utils.RenderUtils.highlight import at.hannibal2.skyhanni.utils.RenderUtils.renderStringsAndItems @@ -26,7 +27,7 @@ class ChestValue { private val config get() = SkyHanniMod.feature.inventory.chestValueConfig private var display = emptyList>() - private val chestItems = mutableMapOf() + private val chestItems = mutableMapOf() private val inInventory get() = InventoryUtils.openInventoryName().isValidStorage() @SubscribeEvent @@ -174,9 +175,8 @@ class ChestValue { } chestItems.clear() for ((i, stack) in stacks) { - val internalName = stack.getInternalName() - if (internalName == "") continue - if (NEUItems.getItemStackOrNull(internalName) == null) continue + val internalName = stack.getInternalNameOrNull() ?: continue + if (internalName.getItemStackOrNull() == null) continue val list = mutableListOf() val pair = EstimatedItemValue.getEstimatedItemPrice(stack, list) var (total, _) = pair -- cgit