From 02015216b436aedc5d564ed15ea585d9e9a6972b Mon Sep 17 00:00:00 2001 From: hannibal2 <24389977+hannibal00212@users.noreply.github.com> Date: Wed, 29 Nov 2023 00:10:20 +0100 Subject: Added show special edition number as stack size when below 1k. --- .../skyhanni/config/features/inventory/InventoryConfig.java | 3 ++- .../skyhanni/features/inventory/ItemDisplayOverlayFeatures.kt | 10 +++++++++- .../at/hannibal2/skyhanni/utils/SkyBlockItemModifierUtils.kt | 2 ++ 3 files changed, 13 insertions(+), 2 deletions(-) (limited to 'src/main') 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 83c718280..d124e6982 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 @@ -72,7 +72,8 @@ public class InventoryConfig { "§bLarva Hook", "§bDungeon Potion Level", "§bVacuum (Garden)", - "§bBottle Of Jyrre" + "§bBottle Of Jyrre", + "§bEdition Number" } ) 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 03ddafcf1..00d32b9a6 100644 --- a/src/main/java/at/hannibal2/skyhanni/features/inventory/ItemDisplayOverlayFeatures.kt +++ b/src/main/java/at/hannibal2/skyhanni/features/inventory/ItemDisplayOverlayFeatures.kt @@ -16,6 +16,7 @@ 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.SkyBlockItemModifierUtils.getEdition import at.hannibal2.skyhanni.utils.StringUtils.matchMatcher import at.hannibal2.skyhanni.utils.StringUtils.matchRegex import at.hannibal2.skyhanni.utils.StringUtils.removeColor @@ -196,7 +197,6 @@ class ItemDisplayOverlayFeatures { } } } - } if (itemNumberAsStackSize.contains(15)) { @@ -206,6 +206,14 @@ class ItemDisplayOverlayFeatures { } } + if (itemNumberAsStackSize.contains(16)) { + item.getEdition()?.let { edition -> + if (edition < 1_000) { + return "§6$edition" + } + } + } + return "" } diff --git a/src/main/java/at/hannibal2/skyhanni/utils/SkyBlockItemModifierUtils.kt b/src/main/java/at/hannibal2/skyhanni/utils/SkyBlockItemModifierUtils.kt index 4f51ad673..9db592047 100644 --- a/src/main/java/at/hannibal2/skyhanni/utils/SkyBlockItemModifierUtils.kt +++ b/src/main/java/at/hannibal2/skyhanni/utils/SkyBlockItemModifierUtils.kt @@ -181,6 +181,8 @@ object SkyBlockItemModifierUtils { fun ItemStack.getBottleOfJyrreSeconds() = getAttributeInt("bottle_of_jyrre_seconds") + fun ItemStack.getEdition() = getAttributeInt("edition") + fun ItemStack.getEnchantments() = getExtraAttributes()?.takeIf { it.hasKey("enchantments") }?.run { val enchantments = this.getCompoundTag("enchantments") enchantments.keySet.associateWith { enchantments.getInteger(it) } -- cgit