From bee150b333b19d3c80ca6f2fcf3d05a2128def31 Mon Sep 17 00:00:00 2001 From: HiZe_ Date: Wed, 29 Nov 2023 00:02:41 +0100 Subject: Added Bottle of Jyrre in item Stack Size (#738) Added bottle of Jyrre time overlay in stack size feature. #738 --- .../skyhanni/config/features/inventory/InventoryConfig.java | 3 ++- .../skyhanni/features/inventory/ItemDisplayOverlayFeatures.kt | 9 +++++++++ .../at/hannibal2/skyhanni/utils/SkyBlockItemModifierUtils.kt | 2 ++ 3 files changed, 13 insertions(+), 1 deletion(-) (limited to 'src/main/java') diff --git a/src/main/java/at/hannibal2/skyhanni/config/features/inventory/InventoryConfig.java b/src/main/java/at/hannibal2/skyhanni/config/features/inventory/InventoryConfig.java index f411bebb7..83c718280 100644 --- a/src/main/java/at/hannibal2/skyhanni/config/features/inventory/InventoryConfig.java +++ b/src/main/java/at/hannibal2/skyhanni/config/features/inventory/InventoryConfig.java @@ -71,7 +71,8 @@ public class InventoryConfig { "§bRancher's Boots speed", "§bLarva Hook", "§bDungeon Potion Level", - "§bVacuum (Garden)" + "§bVacuum (Garden)", + "§bBottle Of Jyrre" } ) public List itemNumberAsStackSize = new ArrayList<>(Arrays.asList(3, 11, 12, 14)); diff --git a/src/main/java/at/hannibal2/skyhanni/features/inventory/ItemDisplayOverlayFeatures.kt b/src/main/java/at/hannibal2/skyhanni/features/inventory/ItemDisplayOverlayFeatures.kt index d5569c12c..329621b4a 100644 --- a/src/main/java/at/hannibal2/skyhanni/features/inventory/ItemDisplayOverlayFeatures.kt +++ b/src/main/java/at/hannibal2/skyhanni/features/inventory/ItemDisplayOverlayFeatures.kt @@ -11,9 +11,11 @@ import at.hannibal2.skyhanni.utils.ItemUtils.getInternalNameOrNull import at.hannibal2.skyhanni.utils.ItemUtils.getLore import at.hannibal2.skyhanni.utils.ItemUtils.name import at.hannibal2.skyhanni.utils.LorenzUtils.between +import at.hannibal2.skyhanni.utils.NEUInternalName.Companion.asInternalName import at.hannibal2.skyhanni.utils.NumberUtil.formatNumber import at.hannibal2.skyhanni.utils.NumberUtil.romanToDecimal import at.hannibal2.skyhanni.utils.NumberUtil.romanToDecimalIfNeeded +import at.hannibal2.skyhanni.utils.SkyBlockItemModifierUtils.getBottleOfJyrreSeconds import at.hannibal2.skyhanni.utils.StringUtils.matchMatcher import at.hannibal2.skyhanni.utils.StringUtils.matchRegex import at.hannibal2.skyhanni.utils.StringUtils.removeColor @@ -195,6 +197,13 @@ class ItemDisplayOverlayFeatures { } + if (itemNumberAsStackSize.contains(15)) { + if (item.getInternalNameOrNull() == "NEW_BOTTLE_OF_JYRRE".asInternalName()) { + val seconds = item.getBottleOfJyrreSeconds() ?: 0 + return "§a${(seconds / 3600)}" + } + } + return "" } diff --git a/src/main/java/at/hannibal2/skyhanni/utils/SkyBlockItemModifierUtils.kt b/src/main/java/at/hannibal2/skyhanni/utils/SkyBlockItemModifierUtils.kt index 9f65a71f1..4f51ad673 100644 --- a/src/main/java/at/hannibal2/skyhanni/utils/SkyBlockItemModifierUtils.kt +++ b/src/main/java/at/hannibal2/skyhanni/utils/SkyBlockItemModifierUtils.kt @@ -179,6 +179,8 @@ object SkyBlockItemModifierUtils { fun ItemStack.getLivingMetalProgress() = getAttributeInt("lm_evo") + fun ItemStack.getBottleOfJyrreSeconds() = getAttributeInt("bottle_of_jyrre_seconds") + fun ItemStack.getEnchantments() = getExtraAttributes()?.takeIf { it.hasKey("enchantments") }?.run { val enchantments = this.getCompoundTag("enchantments") enchantments.keySet.associateWith { enchantments.getInteger(it) } -- cgit