aboutsummaryrefslogtreecommitdiff
path: root/src/main/java/at/hannibal2/skyhanni/features
diff options
context:
space:
mode:
authorhannibal2 <24389977+hannibal00212@users.noreply.github.com>2023-03-28 17:32:27 +0200
committerhannibal2 <24389977+hannibal00212@users.noreply.github.com>2023-03-28 17:32:27 +0200
commitea0fa98cbd55f87c2f9ab5ab4032a9044feeb793 (patch)
treeda267dd3c4f428241b6a1989cfae65aacbc7d21a /src/main/java/at/hannibal2/skyhanni/features
parentf20726ed77f21aead51ec3da2e90411c57aaf5f5 (diff)
downloadskyhanni-ea0fa98cbd55f87c2f9ab5ab4032a9044feeb793.tar.gz
skyhanni-ea0fa98cbd55f87c2f9ab5ab4032a9044feeb793.tar.bz2
skyhanni-ea0fa98cbd55f87c2f9ab5ab4032a9044feeb793.zip
Fixed coins per copper display in SkyMall not showing when some items are not in the NEU Repo.
Diffstat (limited to 'src/main/java/at/hannibal2/skyhanni/features')
-rw-r--r--src/main/java/at/hannibal2/skyhanni/features/garden/SkyMartBestProfit.kt9
1 files changed, 6 insertions, 3 deletions
diff --git a/src/main/java/at/hannibal2/skyhanni/features/garden/SkyMartBestProfit.kt b/src/main/java/at/hannibal2/skyhanni/features/garden/SkyMartBestProfit.kt
index 790a7020f..4de998443 100644
--- a/src/main/java/at/hannibal2/skyhanni/features/garden/SkyMartBestProfit.kt
+++ b/src/main/java/at/hannibal2/skyhanni/features/garden/SkyMartBestProfit.kt
@@ -53,7 +53,9 @@ class SkyMartBestProfit {
name = "§9Sunder I"
}
- iconMap[name] = NEUItems.getItemStack(internalName)
+ NEUItems.getItemStackOrNull(internalName)?.let {
+ iconMap[name] = it
+ }
val advancedStats = if (config.skyMartCopperPriceAdvancedStats) {
" §7(§6$priceFormat §7/ §c$amountFormat Copper§7)"
@@ -80,12 +82,13 @@ class SkyMartBestProfit {
val longest = keys.map { it.first }.maxOfOrNull { renderer.getStringWidth(it.removeColor()) } ?: 0
for ((name, second) in keys) {
- val itemStack = iconMap[name]!!
var displayName = "$name§f:"
while (renderer.getStringWidth(displayName.removeColor()) < longest) {
displayName += " "
}
- newList.add(listOf(itemStack, "$displayName $second"))
+ iconMap[name]?.let {
+ newList.add(listOf(it, "$displayName $second"))
+ }
}
return newList
}