diff options
author | HiZe_ <superhize@hotmail.com> | 2023-07-25 15:46:52 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-07-25 15:46:52 +0200 |
commit | e83fef331c43b19342bdf4c2e173683163f45abf (patch) | |
tree | ec417c11a9e7d136169498d50901c9403b7f2583 | |
parent | 9b4c029bbe90a74845da7c0e3e732c7c03714536 (diff) | |
download | skyhanni-e83fef331c43b19342bdf4c2e173683163f45abf.tar.gz skyhanni-e83fef331c43b19342bdf4c2e173683163f45abf.tar.bz2 skyhanni-e83fef331c43b19342bdf4c2e173683163f45abf.zip |
Added dungeon potion level to item number (#334)
Co-authored-by: superhize <superhize@gmail.com>
-rw-r--r-- | src/main/java/at/hannibal2/skyhanni/config/features/Inventory.java | 3 | ||||
-rw-r--r-- | src/main/java/at/hannibal2/skyhanni/features/inventory/ItemDisplayOverlayFeatures.kt | 16 |
2 files changed, 18 insertions, 1 deletions
diff --git a/src/main/java/at/hannibal2/skyhanni/config/features/Inventory.java b/src/main/java/at/hannibal2/skyhanni/config/features/Inventory.java index 2a98f94fc..ffa412aff 100644 --- a/src/main/java/at/hannibal2/skyhanni/config/features/Inventory.java +++ b/src/main/java/at/hannibal2/skyhanni/config/features/Inventory.java @@ -211,7 +211,8 @@ public class Inventory { "§bSkill Level", "§bCollection Level", "§bRancher's Boots speed", - "§bLarva Hook" + "§bLarva Hook", + "§bDungeon Potion Level" } ) public List<Integer> itemNumberAsStackSize = new ArrayList<>(Arrays.asList(3, 9, 11, 12)); 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 2622c8f14..6fdb3800d 100644 --- a/src/main/java/at/hannibal2/skyhanni/features/inventory/ItemDisplayOverlayFeatures.kt +++ b/src/main/java/at/hannibal2/skyhanni/features/inventory/ItemDisplayOverlayFeatures.kt @@ -14,6 +14,7 @@ import at.hannibal2.skyhanni.utils.NumberUtil.romanToDecimal import at.hannibal2.skyhanni.utils.NumberUtil.romanToDecimalIfNeeded import at.hannibal2.skyhanni.utils.StringUtils.matchMatcher import at.hannibal2.skyhanni.utils.StringUtils.matchRegex +import at.hannibal2.skyhanni.utils.StringUtils.removeColor import net.minecraft.item.ItemStack import net.minecraftforge.fml.common.eventhandler.SubscribeEvent @@ -176,6 +177,21 @@ class ItemDisplayOverlayFeatures { } } + if (SkyHanniMod.feature.inventory.itemNumberAsStackSize.contains(13)) { + if (item.getInternalName() == "POTION") { + item.name?.let { + "Dungeon (?<level>.*) Potion".toPattern().matchMatcher(it.removeColor()) { + return when (val level = group("level").romanToDecimal()) { + in 1..2 -> "§f$level" + in 3..4 -> "§a$level" + in 5..6 -> "§9$level" + else -> "§5$level" + } + } + } + } + } + return "" } |