aboutsummaryrefslogtreecommitdiff
path: root/src/main/java
diff options
context:
space:
mode:
Diffstat (limited to 'src/main/java')
-rw-r--r--src/main/java/at/hannibal2/skyhanni/features/inventory/ItemDisplayOverlayFeatures.kt7
1 files changed, 6 insertions, 1 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 2fe34d105..4bbd64276 100644
--- a/src/main/java/at/hannibal2/skyhanni/features/inventory/ItemDisplayOverlayFeatures.kt
+++ b/src/main/java/at/hannibal2/skyhanni/features/inventory/ItemDisplayOverlayFeatures.kt
@@ -18,6 +18,7 @@ import java.util.regex.Pattern
class ItemDisplayOverlayFeatures {
private val wishingCompassPattern = Pattern.compile("§7Remaining Uses: §e(.*)§8/§e3")
+ private val collectionTier0Pattern = Pattern.compile("§7Progress to .* I: .*")
@SubscribeEvent
fun onRenderItemTip(event: RenderItemTipEvent) {
@@ -134,8 +135,10 @@ class ItemDisplayOverlayFeatures {
if (SkyHanniMod.feature.inventory.itemNumberAsStackSize.contains(10)) {
if (InventoryUtils.openInventoryName().endsWith(" Collections")) {
- if (item.getLore().any { it.contains("Click to view!") }) {
+ val lore = item.getLore()
+ if (lore.any { it.contains("Click to view!") }) {
item.name?.let {
+ if (isCollectionTier0(lore)) return "0"
if (it.startsWith("§e")) {
val text = it.split(" ").last()
return "" + text.romanToDecimalIfNeeded()
@@ -147,6 +150,8 @@ class ItemDisplayOverlayFeatures {
return ""
}
+ private fun isCollectionTier0(lore: List<String>) = lore.map { collectionTier0Pattern.matcher(it) }.any { it.matches() }
+
private fun grabSackName(name: String): String {
val split = name.split(" ")
val text = split[0]