From ab74fb169d427b66c73da184ac5a07ec07b34e02 Mon Sep 17 00:00:00 2001 From: Walker Selby Date: Sun, 3 Dec 2023 19:30:48 -0800 Subject: Internal Change: Regex To Pattern in BazaarApi, CropAccessoryData, andDicerRngCounter (#647) Misc pattern optimizations. #647 --- .../at/hannibal2/skyhanni/features/bazaar/BazaarApi.kt | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) (limited to 'src/main/java/at/hannibal2/skyhanni/features/bazaar') 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 +} -- cgit