diff options
Diffstat (limited to 'src/main')
-rw-r--r-- | src/main/java/at/hannibal2/skyhanni/features/misc/ChestValue.kt | 10 |
1 files 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<List<Any>>() - private val chestItems = mutableMapOf<String, Item>() + private val chestItems = mutableMapOf<NEUInternalName, Item>() 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<String>() val pair = EstimatedItemValue.getEstimatedItemPrice(stack, list) var (total, _) = pair |