From bbd95a7a18d7c1f157dd27772224cdb37d108a99 Mon Sep 17 00:00:00 2001 From: hannibal2 <24389977+hannibal00212@users.noreply.github.com> Date: Sat, 25 Nov 2023 19:35:25 +0100 Subject: Show max pest bag of 40 --- .../skyhanni/features/inventory/ItemDisplayOverlayFeatures.kt | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) (limited to 'src/main/java') 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 61a18a317..57b3ec36c 100644 --- a/src/main/java/at/hannibal2/skyhanni/features/inventory/ItemDisplayOverlayFeatures.kt +++ b/src/main/java/at/hannibal2/skyhanni/features/inventory/ItemDisplayOverlayFeatures.kt @@ -11,6 +11,7 @@ import at.hannibal2.skyhanni.utils.ItemUtils.getLore import at.hannibal2.skyhanni.utils.ItemUtils.name import at.hannibal2.skyhanni.utils.LorenzUtils.between import at.hannibal2.skyhanni.utils.NEUInternalName.Companion.asInternalName +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.StringUtils.matchMatcher @@ -23,14 +24,14 @@ class ItemDisplayOverlayFeatures { private val rancherBootsSpeedCapPattern = "§7Current Speed Cap: §a(?.*)".toPattern() private val petLevelPattern = "\\[Lvl (?.*)] .*".toPattern() - private val garenVacuumVariants = listOf( + private val gardenVacuumVariants = listOf( "SKYMART_VACUUM".asInternalName(), "SKYMART_TURBO_VACUUM".asInternalName(), "SKYMART_HYPER_VACUUM".asInternalName(), "INFINI_VACUUM".asInternalName(), "INFINI_VACUUM_HOOVERIUS".asInternalName(), ) - private val gardenVacuumPatterm = "§7Vacuum Bag: §6(?.*) Pests?".toPattern() + private val gardenVacuumPatterm = "§7Vacuum Bag: §6(?\\d*) Pests?".toPattern() @SubscribeEvent fun onRenderItemTip(event: RenderItemTipEvent) { @@ -178,10 +179,11 @@ class ItemDisplayOverlayFeatures { } if (itemNumberAsStackSize.contains(14)) { - if (item.getInternalNameOrNull() in garenVacuumVariants) { + if (item.getInternalNameOrNull() in gardenVacuumVariants) { for (line in item.getLore()) { gardenVacuumPatterm.matchMatcher(line) { - return group("amount") + val pests = group("amount").formatNumber() + return if (pests > 39) "§640" else "$pests" } } } -- cgit