From c9dcfa040934df376e1bab2c893b466f2323829c Mon Sep 17 00:00:00 2001 From: jani270 <69345714+jani270@users.noreply.github.com> Date: Tue, 21 Nov 2023 17:04:08 +0100 Subject: Added Bookworm Book to the Estimated Item Value feature (#722) Added Bookworm Book to the Estimated Item Value feature. #722 --- .../features/misc/items/EstimatedItemValueCalculator.kt | 11 +++++++++++ .../at/hannibal2/skyhanni/utils/SkyBlockItemModifierUtils.kt | 2 ++ 2 files changed, 13 insertions(+) (limited to 'src/main/java/at') diff --git a/src/main/java/at/hannibal2/skyhanni/features/misc/items/EstimatedItemValueCalculator.kt b/src/main/java/at/hannibal2/skyhanni/features/misc/items/EstimatedItemValueCalculator.kt index 93edf2416..f3e27957d 100644 --- a/src/main/java/at/hannibal2/skyhanni/features/misc/items/EstimatedItemValueCalculator.kt +++ b/src/main/java/at/hannibal2/skyhanni/features/misc/items/EstimatedItemValueCalculator.kt @@ -22,6 +22,7 @@ import at.hannibal2.skyhanni.utils.SkyBlockItemModifierUtils import at.hannibal2.skyhanni.utils.SkyBlockItemModifierUtils.getAbilityScrolls import at.hannibal2.skyhanni.utils.SkyBlockItemModifierUtils.getArmorDye import at.hannibal2.skyhanni.utils.SkyBlockItemModifierUtils.getAttributes +import at.hannibal2.skyhanni.utils.SkyBlockItemModifierUtils.getBookwormBookCount import at.hannibal2.skyhanni.utils.SkyBlockItemModifierUtils.getDrillUpgrades import at.hannibal2.skyhanni.utils.SkyBlockItemModifierUtils.getDungeonStarCount import at.hannibal2.skyhanni.utils.SkyBlockItemModifierUtils.getEnchantments @@ -84,6 +85,7 @@ object EstimatedItemValueCalculator { totalPrice += addTransmissionTuners(stack, list) totalPrice += addManaDisintegrators(stack, list) totalPrice += addPolarvoidBook(stack, list) + totalPrice += addBookwormBook(stack, list) // cosmetic totalPrice += addHelmetSkin(stack, list) @@ -339,6 +341,15 @@ object EstimatedItemValueCalculator { return price } + private fun addBookwormBook(stack: ItemStack, list: MutableList): Double { + val count = stack.getBookwormBookCount() ?: return 0.0 + + val tfHardcodedItemAgain = "BOOKWORM_BOOK".asInternalName() + val price = tfHardcodedItemAgain.getPrice() * count + list.add("§7Bookworm's Favorite Book: §e$count§7/§e5 §7(§6" + NumberUtil.format(price) + "§7)") + return price + } + private fun addSilex(stack: ItemStack, list: MutableList): Double { val tier = stack.getSilexCount() ?: return 0.0 diff --git a/src/main/java/at/hannibal2/skyhanni/utils/SkyBlockItemModifierUtils.kt b/src/main/java/at/hannibal2/skyhanni/utils/SkyBlockItemModifierUtils.kt index 8d600f70e..9f65a71f1 100644 --- a/src/main/java/at/hannibal2/skyhanni/utils/SkyBlockItemModifierUtils.kt +++ b/src/main/java/at/hannibal2/skyhanni/utils/SkyBlockItemModifierUtils.kt @@ -26,6 +26,8 @@ object SkyBlockItemModifierUtils { fun ItemStack.getPolarvoidBookCount() = getAttributeInt("polarvoid") + fun ItemStack.getBookwormBookCount() = getAttributeInt("bookworm_books") + fun ItemStack.getCultivatingCounter() = getAttributeLong("farmed_cultivating") fun ItemStack.getHoeCounter() = getAttributeLong("mined_crops") -- cgit