From 8eab7d2432eb35acae7dc14c22428c9192f3fd61 Mon Sep 17 00:00:00 2001 From: CalMWolfs <94038482+CalMWolfs@users.noreply.github.com> Date: Wed, 28 Jun 2023 05:15:12 +1000 Subject: Merge pull request #257 * made text coloured and on by default * small code cleanup * registers on an unused hook --- .../java/at/hannibal2/skyhanni/config/features/Inventory.java | 2 +- .../skyhanni/features/inventory/ItemDisplayOverlayFeatures.kt | 9 +++++++-- 2 files changed, 8 insertions(+), 3 deletions(-) (limited to 'src/main') 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 0058bc2a9..2a98f94fc 100644 --- a/src/main/java/at/hannibal2/skyhanni/config/features/Inventory.java +++ b/src/main/java/at/hannibal2/skyhanni/config/features/Inventory.java @@ -214,7 +214,7 @@ public class Inventory { "§bLarva Hook" } ) - public List itemNumberAsStackSize = new ArrayList<>(Arrays.asList(3, 9, 11)); + public List itemNumberAsStackSize = new ArrayList<>(Arrays.asList(3, 9, 11, 12)); @Expose @ConfigOption(name = "Sack Name", desc = "Show an abbreviation of the sack name.") 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 60680897b..2622c8f14 100644 --- a/src/main/java/at/hannibal2/skyhanni/features/inventory/ItemDisplayOverlayFeatures.kt +++ b/src/main/java/at/hannibal2/skyhanni/features/inventory/ItemDisplayOverlayFeatures.kt @@ -164,8 +164,13 @@ 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") + "§7§7You may harvest §6(?.).*".toPattern().matchMatcher(line) { + val amount = group("amount").toInt() + return when { + amount > 4 -> "§a$amount" + amount > 2 -> "§e$amount" + else -> "§c$amount" + } } } } -- cgit