aboutsummaryrefslogtreecommitdiff
path: root/src/main/java/at/hannibal2/skyhanni/utils/SkyBlockItemModifierUtils.kt
diff options
context:
space:
mode:
authorObsidian <108832807+Obsidianninja11@users.noreply.github.com>2024-05-30 01:32:56 -0800
committerGitHub <noreply@github.com>2024-05-30 11:32:56 +0200
commitfca0126e4bbc63f8f8218d25be12f9795b70fadc (patch)
treebc62e0e9c3bcdcfe5b2a2eefaec0bcd9453b809b /src/main/java/at/hannibal2/skyhanni/utils/SkyBlockItemModifierUtils.kt
parent6b0e324c96073d824c12dff1629a782352155e99 (diff)
downloadskyhanni-fca0126e4bbc63f8f8218d25be12f9795b70fadc.tar.gz
skyhanni-fca0126e4bbc63f8f8218d25be12f9795b70fadc.tar.bz2
skyhanni-fca0126e4bbc63f8f8218d25be12f9795b70fadc.zip
Feature: Jyrre Bottle and Cacao Truffle held time in lore (#1916)
Co-authored-by: CalMWolfs <94038482+CalMWolfs@users.noreply.github.com> Co-authored-by: hannibal2 <24389977+hannibal00212@users.noreply.github.com>
Diffstat (limited to 'src/main/java/at/hannibal2/skyhanni/utils/SkyBlockItemModifierUtils.kt')
-rw-r--r--src/main/java/at/hannibal2/skyhanni/utils/SkyBlockItemModifierUtils.kt12
1 files changed, 8 insertions, 4 deletions
diff --git a/src/main/java/at/hannibal2/skyhanni/utils/SkyBlockItemModifierUtils.kt b/src/main/java/at/hannibal2/skyhanni/utils/SkyBlockItemModifierUtils.kt
index b6cb3a330..1780764cd 100644
--- a/src/main/java/at/hannibal2/skyhanni/utils/SkyBlockItemModifierUtils.kt
+++ b/src/main/java/at/hannibal2/skyhanni/utils/SkyBlockItemModifierUtils.kt
@@ -179,16 +179,20 @@ object SkyBlockItemModifierUtils {
fun ItemStack.getLivingMetalProgress() = getAttributeInt("lm_evo")
+ fun ItemStack.getSecondsHeld() = getAttributeInt("seconds_held")
+
fun ItemStack.getBottleOfJyrreSeconds() = getAttributeInt("bottle_of_jyrre_seconds")
fun ItemStack.getEdition() = getAttributeInt("edition")
fun ItemStack.getNewYearCake() = getAttributeInt("new_years_cake")
- fun ItemStack.getEnchantments(): Map<String, Int>? = getExtraAttributes()?.takeIf { it.hasKey("enchantments") }?.run {
- val enchantments = this.getCompoundTag("enchantments")
- enchantments.keySet.associateWith { enchantments.getInteger(it) }
- }
+ fun ItemStack.getEnchantments(): Map<String, Int>? = getExtraAttributes()
+ ?.takeIf { it.hasKey("enchantments") }
+ ?.run {
+ val enchantments = this.getCompoundTag("enchantments")
+ enchantments.keySet.associateWith { enchantments.getInteger(it) }
+ }
fun ItemStack.getAppliedPocketSackInASack(): Int? {
val data = cachedData