diff options
author | hannibal2 <24389977+hannibal00212@users.noreply.github.com> | 2023-08-10 13:31:48 +0200 |
---|---|---|
committer | hannibal2 <24389977+hannibal00212@users.noreply.github.com> | 2023-08-10 13:31:48 +0200 |
commit | 4d70a91399a6c1724097ef562d5210d2d1ae097a (patch) | |
tree | c45a3d2bfe2d59cb4d30661eabf2c5925ff80dad | |
parent | 08569a422e16f251768e1c0903b21ad96c039a2d (diff) | |
download | skyhanni-4d70a91399a6c1724097ef562d5210d2d1ae097a.tar.gz skyhanni-4d70a91399a6c1724097ef562d5210d2d1ae097a.tar.bz2 skyhanni-4d70a91399a6c1724097ef562d5210d2d1ae097a.zip |
using NEUInternalName in ChestValue
-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 |