diff options
author | hannibal2 <24389977+hannibal00212@users.noreply.github.com> | 2023-11-30 11:09:39 +0100 |
---|---|---|
committer | hannibal2 <24389977+hannibal00212@users.noreply.github.com> | 2023-11-30 11:09:39 +0100 |
commit | 592a565cb0d030481e2e093f983c754600e288c1 (patch) | |
tree | 1caa0ef861f0f85850ea73f394844201d9f8c138 /src/main/java/at/hannibal2/skyhanni | |
parent | b97ccd10b1648e1db2884bf11c346cb7b2bead99 (diff) | |
download | skyhanni-592a565cb0d030481e2e093f983c754600e288c1.tar.gz skyhanni-592a565cb0d030481e2e093f983c754600e288c1.tar.bz2 skyhanni-592a565cb0d030481e2e093f983c754600e288c1.zip |
move pattern into member space
Diffstat (limited to 'src/main/java/at/hannibal2/skyhanni')
-rw-r--r-- | src/main/java/at/hannibal2/skyhanni/features/inventory/ItemDisplayOverlayFeatures.kt | 8 |
1 files changed, 6 insertions, 2 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 544ad6094..6f609def6 100644 --- a/src/main/java/at/hannibal2/skyhanni/features/inventory/ItemDisplayOverlayFeatures.kt +++ b/src/main/java/at/hannibal2/skyhanni/features/inventory/ItemDisplayOverlayFeatures.kt @@ -43,9 +43,13 @@ import net.minecraftforge.fml.common.eventhandler.SubscribeEvent object ItemDisplayOverlayFeatures { private val config get() = SkyHanniMod.feature.inventory + + // TODO repo private val rancherBootsSpeedCapPattern = "§7Current Speed Cap: §a(?<cap>.*)".toPattern() private val petLevelPattern = "\\[Lvl (?<level>.*)] .*".toPattern() private val gardenVacuumPatterm = "§7Vacuum Bag: §6(?<amount>\\d*) Pests?".toPattern() + private val harvestPattern = "§7§7You may harvest §6(?<amount>.).*".toPattern() + private val dungeonPotionPattern = "Dungeon (?<level>.*) Potion".toPattern() private val bottleOfJyrre = "NEW_BOTTLE_OF_JYRRE".asInternalName() @@ -161,7 +165,7 @@ object ItemDisplayOverlayFeatures { if (LARVA_HOOK.isSelected() && itemName.contains("Larva Hook")) { for (line in item.getLore()) { - "§7§7You may harvest §6(?<amount>.).*".toPattern().matchMatcher(line) { + harvestPattern.matchMatcher(line) { val amount = group("amount").toInt() return when { amount > 4 -> "§a$amount" @@ -174,7 +178,7 @@ object ItemDisplayOverlayFeatures { if (DUNGEON_POTION_LEVEL.isSelected() && itemName.startsWith("Dungeon ") && itemName.contains(" Potion")) { item.name?.let { - "Dungeon (?<level>.*) Potion".toPattern().matchMatcher(it.removeColor()) { + dungeonPotionPattern.matchMatcher(it.removeColor()) { return when (val level = group("level").romanToDecimal()) { in 1..2 -> "§f$level" in 3..4 -> "§a$level" |