diff options
-rw-r--r-- | src/main/java/at/hannibal2/skyhanni/config/features/inventory/InventoryConfig.java | 5 | ||||
-rw-r--r-- | src/main/java/at/hannibal2/skyhanni/features/inventory/ItemDisplayOverlayFeatures.kt | 39 |
2 files changed, 38 insertions, 6 deletions
diff --git a/src/main/java/at/hannibal2/skyhanni/config/features/inventory/InventoryConfig.java b/src/main/java/at/hannibal2/skyhanni/config/features/inventory/InventoryConfig.java index d689cc7b4..7a19fc368 100644 --- a/src/main/java/at/hannibal2/skyhanni/config/features/inventory/InventoryConfig.java +++ b/src/main/java/at/hannibal2/skyhanni/config/features/inventory/InventoryConfig.java @@ -70,10 +70,11 @@ public class InventoryConfig { "§bCollection Level", "§bRancher's Boots speed", "§bLarva Hook", - "§bDungeon Potion Level" + "§bDungeon Potion Level", + "§bVacuum (Garden)" } ) - public List<Integer> itemNumberAsStackSize = new ArrayList<>(Arrays.asList(3, 11, 12)); + public List<Integer> itemNumberAsStackSize = new ArrayList<>(Arrays.asList(3, 11, 12, 14)); @Expose @ConfigOption( 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 aa3a46ed2..8b7b6cb7d 100644 --- a/src/main/java/at/hannibal2/skyhanni/features/inventory/ItemDisplayOverlayFeatures.kt +++ b/src/main/java/at/hannibal2/skyhanni/features/inventory/ItemDisplayOverlayFeatures.kt @@ -6,9 +6,11 @@ import at.hannibal2.skyhanni.events.RenderItemTipEvent import at.hannibal2.skyhanni.utils.InventoryUtils import at.hannibal2.skyhanni.utils.ItemUtils import at.hannibal2.skyhanni.utils.ItemUtils.cleanName +import at.hannibal2.skyhanni.utils.ItemUtils.getInternalNameOrNull 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.romanToDecimal import at.hannibal2.skyhanni.utils.NumberUtil.romanToDecimalIfNeeded import at.hannibal2.skyhanni.utils.StringUtils.matchMatcher @@ -21,6 +23,15 @@ class ItemDisplayOverlayFeatures { private val rancherBootsSpeedCapPattern = "§7Current Speed Cap: §a(?<cap>.*)".toPattern() private val petLevelPattern = "\\[Lvl (?<level>.*)] .*".toPattern() + private val garenVacuumVariants = 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(?<amount>.*) Pests?".toPattern() + @SubscribeEvent fun onRenderItemTip(event: RenderItemTipEvent) { event.stackTip = getStackTip(event.stack) @@ -43,7 +54,10 @@ class ItemDisplayOverlayFeatures { return itemName.substring(itemName.length - 1) } - if (SkyHanniMod.feature.inventory.itemNumberAsStackSize.contains(2) && (itemName.contains("Golden ") || itemName.contains("Diamond "))) { + if (SkyHanniMod.feature.inventory.itemNumberAsStackSize.contains(2) && (itemName.contains("Golden ") || itemName.contains( + "Diamond " + )) + ) { when { itemName.contains("Bonzo") -> return "1" itemName.contains("Scarf") -> return "2" @@ -99,7 +113,8 @@ class ItemDisplayOverlayFeatures { if (SkyHanniMod.feature.inventory.itemNumberAsStackSize.contains(9) && InventoryUtils.openInventoryName() == "Your Skills" && - item.getLore().any { it.contains("Click to view!") }) { + item.getLore().any { it.contains("Click to view!") } + ) { if (CollectionAPI.isCollectionTier0(item.getLore())) return "0" val split = itemName.split(" ") if (!itemName.contains("Dungeon")) { @@ -109,7 +124,9 @@ class ItemDisplayOverlayFeatures { } } - if (SkyHanniMod.feature.inventory.itemNumberAsStackSize.contains(10) && InventoryUtils.openInventoryName().endsWith(" Collections")) { + if (SkyHanniMod.feature.inventory.itemNumberAsStackSize.contains(10) && InventoryUtils.openInventoryName() + .endsWith(" Collections") + ) { val lore = item.getLore() if (lore.any { it.contains("Click to view!") }) { if (CollectionAPI.isCollectionTier0(lore)) return "0" @@ -143,7 +160,10 @@ class ItemDisplayOverlayFeatures { } } - if (SkyHanniMod.feature.inventory.itemNumberAsStackSize.contains(13) && itemName.startsWith("Dungeon ") && itemName.contains(" Potion")) { + if (SkyHanniMod.feature.inventory.itemNumberAsStackSize.contains(13) && itemName.startsWith("Dungeon ") && itemName.contains( + " Potion" + ) + ) { item.name?.let { "Dungeon (?<level>.*) Potion".toPattern().matchMatcher(it.removeColor()) { return when (val level = group("level").romanToDecimal()) { @@ -156,6 +176,17 @@ class ItemDisplayOverlayFeatures { } } + if (SkyHanniMod.feature.inventory.itemNumberAsStackSize.contains(14)) { + if (item.getInternalNameOrNull() in garenVacuumVariants) { + for (line in item.getLore()) { + gardenVacuumPatterm.matchMatcher(line) { + return group("amount") + } + } + } + + } + return "" } |