From b814edd6e6d8d615e02191ddd3a7085ee81bf38f Mon Sep 17 00:00:00 2001 From: jani270 <69345714+jani270@users.noreply.github.com> Date: Mon, 10 Apr 2023 20:04:15 +0200 Subject: Added Dyes and Skins to the price calc (also removed funny prinLn's (#33) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-authored-by: Roman / Linnea Gräf --- .../skyhanni/utils/SkyBlockItemModifierUtils.kt | 19 +++++++++---------- 1 file changed, 9 insertions(+), 10 deletions(-) (limited to 'src/main/java/at/hannibal2/skyhanni/utils') 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 { -- cgit