diff options
author | hannibal2 <24389977+hannibal00212@users.noreply.github.com> | 2023-11-29 00:10:20 +0100 |
---|---|---|
committer | hannibal2 <24389977+hannibal00212@users.noreply.github.com> | 2023-11-29 00:10:20 +0100 |
commit | 02015216b436aedc5d564ed15ea585d9e9a6972b (patch) | |
tree | 0a4331e4f0dbf9f710cf4009538fef9bf52c1fc0 /src/main | |
parent | 3737021cb83f0e973fabd778bd8901a920bef6c9 (diff) | |
download | skyhanni-02015216b436aedc5d564ed15ea585d9e9a6972b.tar.gz skyhanni-02015216b436aedc5d564ed15ea585d9e9a6972b.tar.bz2 skyhanni-02015216b436aedc5d564ed15ea585d9e9a6972b.zip |
Added show special edition number as stack size when below 1k.
Diffstat (limited to 'src/main')
3 files changed, 13 insertions, 2 deletions
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<Integer> 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) } |