aboutsummaryrefslogtreecommitdiff
path: root/src/main/java/at/hannibal2/skyhanni/utils/SkyBlockItemModifierUtils.kt
diff options
context:
space:
mode:
authorhannibal2 <24389977+hannibal00212@users.noreply.github.com>2023-05-25 16:18:43 +0200
committerhannibal2 <24389977+hannibal00212@users.noreply.github.com>2023-05-25 16:18:43 +0200
commitd5078e7c8625f1cfca46fddad3a3c1c51d5dd5e1 (patch)
tree2dd1d3269dc262a72591c606335b1d27e24521a6 /src/main/java/at/hannibal2/skyhanni/utils/SkyBlockItemModifierUtils.kt
parent7ad7804cc9b2eb87c8e55dc7636b078703f554d1 (diff)
downloadskyhanni-d5078e7c8625f1cfca46fddad3a3c1c51d5dd5e1.tar.gz
skyhanni-d5078e7c8625f1cfca46fddad3a3c1c51d5dd5e1.tar.bz2
skyhanni-d5078e7c8625f1cfca46fddad3a3c1c51d5dd5e1.zip
Fixed Silex counting on Promising Shovel
Diffstat (limited to 'src/main/java/at/hannibal2/skyhanni/utils/SkyBlockItemModifierUtils.kt')
-rw-r--r--src/main/java/at/hannibal2/skyhanni/utils/SkyBlockItemModifierUtils.kt9
1 files changed, 8 insertions, 1 deletions
diff --git a/src/main/java/at/hannibal2/skyhanni/utils/SkyBlockItemModifierUtils.kt b/src/main/java/at/hannibal2/skyhanni/utils/SkyBlockItemModifierUtils.kt
index 678772499..fa86f5a18 100644
--- a/src/main/java/at/hannibal2/skyhanni/utils/SkyBlockItemModifierUtils.kt
+++ b/src/main/java/at/hannibal2/skyhanni/utils/SkyBlockItemModifierUtils.kt
@@ -18,9 +18,16 @@ object SkyBlockItemModifierUtils {
fun ItemStack.getHoeCounter() = getAttributeLong("mined_crops")
fun ItemStack.getSilexCount() = getEnchantments()?.get("efficiency")?.let {
- it - 5 - if (getInternalName() == "STONK_PICKAXE") 1 else 0
+ it - 5 - getBaseSilexCount()
}?.takeIf { it > 0 }
+ private fun ItemStack.getBaseSilexCount() = when (getInternalName()) {
+ "STONK_PICKAXE" -> 1
+ "PROMISING_SPADE" -> 5
+
+ else -> 0
+ }
+
fun ItemStack.getTransmissionTunerCount() = getAttributeInt("tuned_transmission")
fun ItemStack.getManaDisintegrators() = getAttributeInt("mana_disintegrator_count")