summaryrefslogtreecommitdiff
path: root/src/main/java/at/hannibal2/skyhanni/utils
diff options
context:
space:
mode:
authorhannibal2 <24389977+hannibal00212@users.noreply.github.com>2024-04-09 19:16:36 +0200
committerhannibal2 <24389977+hannibal00212@users.noreply.github.com>2024-04-09 19:16:36 +0200
commit1f19a29b67cdcaa19d2a1c61da7098b27d808446 (patch)
tree1f30b58da455ba916458ec51cfa35ea9eec90290 /src/main/java/at/hannibal2/skyhanni/utils
parentf41a77e74500ac4123dd3e47e2bd2c2ea6d6e63f (diff)
downloadskyhanni-1f19a29b67cdcaa19d2a1c61da7098b27d808446.tar.gz
skyhanni-1f19a29b67cdcaa19d2a1c61da7098b27d808446.tar.bz2
skyhanni-1f19a29b67cdcaa19d2a1c61da7098b27d808446.zip
code cleanup
Diffstat (limited to 'src/main/java/at/hannibal2/skyhanni/utils')
-rw-r--r--src/main/java/at/hannibal2/skyhanni/utils/SkyBlockItemModifierUtils.kt6
1 files changed, 5 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 ebc0313c7..756d87d13 100644
--- a/src/main/java/at/hannibal2/skyhanni/utils/SkyBlockItemModifierUtils.kt
+++ b/src/main/java/at/hannibal2/skyhanni/utils/SkyBlockItemModifierUtils.kt
@@ -175,12 +175,16 @@ object SkyBlockItemModifierUtils {
fun ItemStack.hasArtOfPeace() = getAttributeBoolean("artOfPeaceApplied")
+ fun ItemStack.isMuseumDonated() = getAttributeBoolean("donated_museum")
+
fun ItemStack.getLivingMetalProgress() = getAttributeInt("lm_evo")
fun ItemStack.getBottleOfJyrreSeconds() = getAttributeInt("bottle_of_jyrre_seconds")
fun ItemStack.getEdition() = getAttributeInt("edition")
+ fun ItemStack.getNewYearCake() = getAttributeInt("new_years_cake")
+
fun ItemStack.getEnchantments() = getExtraAttributes()?.takeIf { it.hasKey("enchantments") }?.run {
val enchantments = this.getCompoundTag("enchantments")
enchantments.keySet.associateWith { enchantments.getInteger(it) }
@@ -251,7 +255,7 @@ object SkyBlockItemModifierUtils {
getExtraAttributes()?.getLong(label)?.takeUnless { it == 0L }
private fun ItemStack.getAttributeBoolean(label: String): Boolean {
- return getExtraAttributes()?.hasKey(label) ?: false
+ return getExtraAttributes()?.getBoolean(label) ?: false
}
fun ItemStack.getExtraAttributes() = tagCompound?.getCompoundTag("ExtraAttributes")