diff options
author | hannibal2 <24389977+hannibal00212@users.noreply.github.com> | 2023-06-05 14:30:56 +0200 |
---|---|---|
committer | hannibal2 <24389977+hannibal00212@users.noreply.github.com> | 2023-06-05 14:30:56 +0200 |
commit | 2e19b6146d189175f682f703afe7fdcf04a9e629 (patch) | |
tree | 22a53db1d5ba1c4d29add1b250d8a0f9aef339ed /src | |
parent | 422d4dd7ab9096d639fe98a9da750f9feaabc848 (diff) | |
download | skyhanni-2e19b6146d189175f682f703afe7fdcf04a9e629.tar.gz skyhanni-2e19b6146d189175f682f703afe7fdcf04a9e629.tar.bz2 skyhanni-2e19b6146d189175f682f703afe7fdcf04a9e629.zip |
Showing total price for visitor items needed
Diffstat (limited to 'src')
-rw-r--r-- | src/main/java/at/hannibal2/skyhanni/features/garden/visitor/GardenVisitorFeatures.kt | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/src/main/java/at/hannibal2/skyhanni/features/garden/visitor/GardenVisitorFeatures.kt b/src/main/java/at/hannibal2/skyhanni/features/garden/visitor/GardenVisitorFeatures.kt index 588ee9172..31654398e 100644 --- a/src/main/java/at/hannibal2/skyhanni/features/garden/visitor/GardenVisitorFeatures.kt +++ b/src/main/java/at/hannibal2/skyhanni/features/garden/visitor/GardenVisitorFeatures.kt @@ -138,6 +138,7 @@ class GardenVisitorFeatures { } } if (requiredItems.isNotEmpty()) { + var totalPrice = 0.0 newDisplay.addAsSingletonList("§7Visitor items needed:") for ((internalName, amount) in requiredItems) { val name = NEUItems.getItemStack(internalName).name!! @@ -158,12 +159,17 @@ class GardenVisitorFeatures { if (config.visitorNeedsShowPrice) { val price = NEUItems.getPrice(internalName) * amount + totalPrice += price val format = NumberUtil.format(price) list.add(" §7(§6$format§7)") } newDisplay.add(list) } + if (totalPrice > 0) { + val format = NumberUtil.format(totalPrice) + newDisplay[0] = listOf("§7Visitor items needed: §7(§6$format§7)") + } } if (newVisitors.isNotEmpty()) { if (requiredItems.isNotEmpty()) { |