diff options
Diffstat (limited to 'src/main/java/at/hannibal2/skyhanni/utils')
-rw-r--r-- | src/main/java/at/hannibal2/skyhanni/utils/SkyBlockItemModifierUtils.kt | 19 |
1 files changed, 9 insertions, 10 deletions
diff --git a/src/main/java/at/hannibal2/skyhanni/utils/SkyBlockItemModifierUtils.kt b/src/main/java/at/hannibal2/skyhanni/utils/SkyBlockItemModifierUtils.kt index 4229a80df..1a27d1e4c 100644 --- a/src/main/java/at/hannibal2/skyhanni/utils/SkyBlockItemModifierUtils.kt +++ b/src/main/java/at/hannibal2/skyhanni/utils/SkyBlockItemModifierUtils.kt @@ -108,17 +108,16 @@ object SkyBlockItemModifierUtils { } fun ItemStack.getPowerScroll(): String? { - for (tags in tagCompound.keySet) { - if (tags != "ExtraAttributes") continue - val extraAttributes = tagCompound.getCompoundTag(tags) - for (attributes in extraAttributes.keySet) { - if (attributes == "power_ability_scroll") { - return extraAttributes.getString(attributes) - } - } - } + return tagCompound?.getCompoundTag("ExtraAttributes")?.getString("power_ability_scroll") + ?.takeUnless { it.isBlank() } + } - return null + fun ItemStack.getHelmetSkin(): String? { + return tagCompound?.getCompoundTag("ExtraAttributes")?.getString("skin")?.takeUnless { it.isBlank() } + } + + fun ItemStack.getArmorDye(): String? { + return tagCompound?.getCompoundTag("ExtraAttributes")?.getString("dye_item")?.takeUnless { it.isBlank() } } fun ItemStack.getAbilityScrolls(): List<String> { |