diff options
Diffstat (limited to 'src/main/java/at')
-rw-r--r-- | src/main/java/at/hannibal2/skyhanni/features/nether/PabloHelper.kt | 23 |
1 files changed, 17 insertions, 6 deletions
diff --git a/src/main/java/at/hannibal2/skyhanni/features/nether/PabloHelper.kt b/src/main/java/at/hannibal2/skyhanni/features/nether/PabloHelper.kt index 0ada23ab4..aa7cfcafc 100644 --- a/src/main/java/at/hannibal2/skyhanni/features/nether/PabloHelper.kt +++ b/src/main/java/at/hannibal2/skyhanni/features/nether/PabloHelper.kt @@ -2,12 +2,11 @@ package at.hannibal2.skyhanni.features.nether import at.hannibal2.skyhanni.SkyHanniMod import at.hannibal2.skyhanni.api.GetFromSackAPI -import at.hannibal2.skyhanni.data.IslandType import at.hannibal2.skyhanni.events.LorenzChatEvent import at.hannibal2.skyhanni.skyhannimodule.SkyHanniModule import at.hannibal2.skyhanni.utils.InventoryUtils import at.hannibal2.skyhanni.utils.ItemUtils.name -import at.hannibal2.skyhanni.utils.LorenzUtils.isInIsland +import at.hannibal2.skyhanni.utils.LorenzUtils import at.hannibal2.skyhanni.utils.NEUInternalName.Companion.asInternalName import at.hannibal2.skyhanni.utils.PrimitiveItemStack.Companion.makePrimitiveStack import at.hannibal2.skyhanni.utils.RegexUtils.matchMatchers @@ -22,10 +21,22 @@ object PabloHelper { private val config get() = SkyHanniMod.feature.crimsonIsle + // TODO RepoPattern.list does not work, find out why + +// /** +// * REGEX-TEST: §e[NPC] §5Pablo§f: §b✆ §f§rBring me that §aEnchanted Dandelion §fas soon as you can! +// */ +// private val patterns by RepoPattern.list( +// "crimson.pablo.helper", +// "\\[NPC] Pablo: (?:✆ )?Could you bring me an (?<flower>[\\w ]+).*", +// "\\[NPC] Pablo: (?:✆ )?Bring me that (?<flower>[\\w ]+) as soon as you can!", +// ) + private val patterns = listOf( - "\\[NPC] Pablo: Could you bring me an (?<flower>[\\w ]+).*".toPattern(), - "\\[NPC] Pablo: Bring me that (?<flower>[\\w ]+) as soon as you can!".toPattern() + "\\[NPC] Pablo: (?:✆ )?Could you bring me an (?<flower>[\\w ]+).*".toPattern(), + "\\[NPC] Pablo: (?:✆ )?Bring me that (?<flower>[\\w ]+) as soon as you can!".toPattern(), ) + private var lastSentMessage = SimpleTimeMark.farPast() @SubscribeEvent @@ -40,11 +51,11 @@ object PabloHelper { GetFromSackAPI.getFromChatMessageSackItems( itemName.asInternalName().makePrimitiveStack(), - "Click here to grab an $itemName from sacks!" + "Click here to grab an $itemName from sacks!", ) lastSentMessage = SimpleTimeMark.now() } - fun isEnabled() = IslandType.CRIMSON_ISLE.isInIsland() && config.pabloHelper + fun isEnabled() = LorenzUtils.inSkyBlock && config.pabloHelper } |