aboutsummaryrefslogtreecommitdiff
path: root/src/main/java/at/hannibal2/skyhanni/features/nether
diff options
context:
space:
mode:
authorhannibal2 <24389977+hannibal00212@users.noreply.github.com>2023-11-11 11:42:54 +0100
committerhannibal2 <24389977+hannibal00212@users.noreply.github.com>2023-11-11 11:42:54 +0100
commit30b959a6da9e516cfb190554584b9a013c0412f7 (patch)
tree19bace1a369130c0ff0c4466ae3755e7e79c7d58 /src/main/java/at/hannibal2/skyhanni/features/nether
parent5477d22a05c366095f402de10c1e0b9b15e18320 (diff)
downloadskyhanni-30b959a6da9e516cfb190554584b9a013c0412f7.tar.gz
skyhanni-30b959a6da9e516cfb190554584b9a013c0412f7.tar.bz2
skyhanni-30b959a6da9e516cfb190554584b9a013c0412f7.zip
Pablo Helper
Diffstat (limited to 'src/main/java/at/hannibal2/skyhanni/features/nether')
-rw-r--r--src/main/java/at/hannibal2/skyhanni/features/nether/PabloHelper.kt11
1 files changed, 6 insertions, 5 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 89a0a1917..12b2b78df 100644
--- a/src/main/java/at/hannibal2/skyhanni/features/nether/PabloHelper.kt
+++ b/src/main/java/at/hannibal2/skyhanni/features/nether/PabloHelper.kt
@@ -8,7 +8,7 @@ import at.hannibal2.skyhanni.utils.ItemUtils.name
import at.hannibal2.skyhanni.utils.LorenzUtils
import at.hannibal2.skyhanni.utils.LorenzUtils.isInIsland
import at.hannibal2.skyhanni.utils.SimpleTimeMark
-import at.hannibal2.skyhanni.utils.StringUtils.matchMatcher
+import at.hannibal2.skyhanni.utils.StringUtils.matchMatchers
import at.hannibal2.skyhanni.utils.StringUtils.removeColor
import net.minecraftforge.fml.common.eventhandler.SubscribeEvent
import kotlin.time.Duration.Companion.minutes
@@ -17,16 +17,17 @@ import kotlin.time.Duration.Companion.minutes
class PabloHelper {
private val config get() = SkyHanniMod.feature.crimsonIsle
- // There is a different message if the player asks Pablo with an item in their hand, but I don't think it's necessary
- // I'll add it if requested ~NetheriteMiner
- private val pabloMessagePattern = "\\[NPC] Pablo: Could you bring me an (?<flower>[\\w ]+).*".toPattern()
+ 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()
+ )
private var lastSentMessage = SimpleTimeMark.farPast()
@SubscribeEvent
fun onChat(event: LorenzChatEvent) {
if (!isEnabled()) return
if (lastSentMessage.passedSince() < 5.minutes) return
- val itemName = pabloMessagePattern.matchMatcher(event.message.removeColor()) {
+ val itemName = patterns.matchMatchers(event.message.removeColor()) {
group("flower")
} ?: return