summaryrefslogtreecommitdiff
path: root/src/main/java/at/hannibal2/skyhanni/features/bazaar
diff options
context:
space:
mode:
Diffstat (limited to 'src/main/java/at/hannibal2/skyhanni/features/bazaar')
-rw-r--r--src/main/java/at/hannibal2/skyhanni/features/bazaar/BazaarApi.kt14
1 files changed, 8 insertions, 6 deletions
diff --git a/src/main/java/at/hannibal2/skyhanni/features/bazaar/BazaarApi.kt b/src/main/java/at/hannibal2/skyhanni/features/bazaar/BazaarApi.kt
index 57e674976..0f14c98c3 100644
--- a/src/main/java/at/hannibal2/skyhanni/features/bazaar/BazaarApi.kt
+++ b/src/main/java/at/hannibal2/skyhanni/features/bazaar/BazaarApi.kt
@@ -16,6 +16,7 @@ import at.hannibal2.skyhanni.utils.NEUInternalName
import at.hannibal2.skyhanni.utils.NEUItems
import at.hannibal2.skyhanni.utils.OSUtils
import at.hannibal2.skyhanni.utils.RenderUtils.highlight
+import at.hannibal2.skyhanni.utils.StringUtils.matchMatcher
import at.hannibal2.skyhanni.utils.StringUtils.removeColor
import net.minecraft.client.gui.inventory.GuiChest
import net.minecraft.inventory.ContainerChest
@@ -109,11 +110,12 @@ class BazaarApi {
@SubscribeEvent
fun onChat(event: LorenzChatEvent) {
- if ("\\[Bazaar] (Buy Order Setup!|Bought).*$currentSearchedItem.*".toRegex()
- .matches(event.message.removeColor())
- ) {
- currentSearchedItem = ""
- }
+ if (!LorenzUtils.inSkyBlock) return
+ if (!inBazaarInventory) return
+ // TODO USE SH-REPO
+ // TODO remove dynamic pattern
+ "\\[Bazaar] (Buy Order Setup!|Bought).*$currentSearchedItem.*".toPattern()
+ .matchMatcher(event.message.removeColor()) { currentSearchedItem = "" }
}
private fun checkIfInBazaar(event: InventoryFullyOpenedEvent): Boolean {
@@ -146,4 +148,4 @@ class BazaarApi {
inBazaarInventory = false
currentlyOpenedProduct = null
}
-} \ No newline at end of file
+}