From d4d16cbc7614452757e081e1498f0b9243f28318 Mon Sep 17 00:00:00 2001 From: hannibal2 <24389977+hannibal00212@users.noreply.github.com> Date: Thu, 22 Jun 2023 19:14:46 +0200 Subject: Added larva Hook uses display to item number feature --- .../at/hannibal2/skyhanni/config/features/Inventory.java | 3 ++- .../features/inventory/ItemDisplayOverlayFeatures.kt | 12 ++++++++++++ 2 files changed, 14 insertions(+), 1 deletion(-) (limited to 'src/main/java') 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 d61db3cfd..0058bc2a9 100644 --- a/src/main/java/at/hannibal2/skyhanni/config/features/Inventory.java +++ b/src/main/java/at/hannibal2/skyhanni/config/features/Inventory.java @@ -210,7 +210,8 @@ public class Inventory { "§bKuudra Key", "§bSkill Level", "§bCollection Level", - "§bRancher's Boots speed" + "§bRancher's Boots speed", + "§bLarva Hook" } ) public List itemNumberAsStackSize = new ArrayList<>(Arrays.asList(3, 9, 11)); 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 4ddfb0cf0..60680897b 100644 --- a/src/main/java/at/hannibal2/skyhanni/features/inventory/ItemDisplayOverlayFeatures.kt +++ b/src/main/java/at/hannibal2/skyhanni/features/inventory/ItemDisplayOverlayFeatures.kt @@ -6,6 +6,7 @@ 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.getInternalName import at.hannibal2.skyhanni.utils.ItemUtils.getLore import at.hannibal2.skyhanni.utils.ItemUtils.name import at.hannibal2.skyhanni.utils.LorenzUtils.between @@ -159,6 +160,17 @@ class ItemDisplayOverlayFeatures { } } } + + if (SkyHanniMod.feature.inventory.itemNumberAsStackSize.contains(12)) { + if (item.getInternalName() == "LARVA_HOOK") { + for (line in item.getLore()) { + "§7§7You may harvest §6(?.)/.*".toPattern().matchMatcher(line) { + return group("amount") + } + } + } + } + return "" } -- cgit