From bc33d91ec58ecd4dd782485c48385dfad79522c2 Mon Sep 17 00:00:00 2001 From: steini225 <32608974+steini225@users.noreply.github.com> Date: Mon, 10 Apr 2023 20:04:53 +0200 Subject: bingo_topaz (#30) --- .../skyhanni/features/bingo/BingoNextStepHelper.kt | 19 ++++++++++++++++++- 1 file changed, 18 insertions(+), 1 deletion(-) (limited to 'src/main/java/at/hannibal2/skyhanni') diff --git a/src/main/java/at/hannibal2/skyhanni/features/bingo/BingoNextStepHelper.kt b/src/main/java/at/hannibal2/skyhanni/features/bingo/BingoNextStepHelper.kt index 791680545..2423ed85d 100644 --- a/src/main/java/at/hannibal2/skyhanni/features/bingo/BingoNextStepHelper.kt +++ b/src/main/java/at/hannibal2/skyhanni/features/bingo/BingoNextStepHelper.kt @@ -10,6 +10,7 @@ import at.hannibal2.skyhanni.features.bingo.nextstep.* import at.hannibal2.skyhanni.utils.InventoryUtils import at.hannibal2.skyhanni.utils.ItemUtils.name import at.hannibal2.skyhanni.utils.LorenzUtils +import at.hannibal2.skyhanni.utils.StringUtils.matchRegex import at.hannibal2.skyhanni.utils.StringUtils.removeColor import net.minecraftforge.fml.common.eventhandler.SubscribeEvent import net.minecraftforge.fml.common.gameevent.TickEvent @@ -118,11 +119,27 @@ class BingoNextStepHelper { } } + var nextMessageIsCrystal = false + @SubscribeEvent fun onChat(event: LorenzChatEvent) { if (!LorenzUtils.isBingoProfile) return if (!SkyHanniMod.feature.bingo.cardDisplay) return + for (currentStep in currentSteps) { + if (currentStep.displayName == "Obtain a Topaz Crystal") { + if (event.message.matchRegex(" *§r§5§l✦ CRYSTAL FOUND §r§7\\(.§r§7/5§r§7\\)")) { + nextMessageIsCrystal = true + return + } + if (nextMessageIsCrystal) { + nextMessageIsCrystal = false + if (event.message.matchRegex(" *§r§eTopaz Crystal")) { + currentStep.done() + } + } + } + } //TODO add thys message // if (event.message == "thys message") { // thys.done() @@ -189,7 +206,7 @@ class BingoNextStepHelper { } private fun update() { - val personalGoals = BingoCardDisplay.personalGoals + val personalGoals = BingoCardDisplay.personalGoals.filter { !it.done } if (personalGoals.isEmpty()) { if (!dirty) { reset() -- cgit