summaryrefslogtreecommitdiff
path: root/src/main/java/at/hannibal2/skyhanni/features
diff options
context:
space:
mode:
authorHiZe_ <superhize@hotmail.com>2023-07-25 15:46:52 +0200
committerGitHub <noreply@github.com>2023-07-25 15:46:52 +0200
commite83fef331c43b19342bdf4c2e173683163f45abf (patch)
treeec417c11a9e7d136169498d50901c9403b7f2583 /src/main/java/at/hannibal2/skyhanni/features
parent9b4c029bbe90a74845da7c0e3e732c7c03714536 (diff)
downloadskyhanni-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>
Diffstat (limited to 'src/main/java/at/hannibal2/skyhanni/features')
-rw-r--r--src/main/java/at/hannibal2/skyhanni/features/inventory/ItemDisplayOverlayFeatures.kt16
1 files changed, 16 insertions, 0 deletions
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 ""
}