diff options
-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 "" } |