diff options
author | Walker Selby <git@walkerselby.com> | 2023-12-03 19:30:48 -0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-12-04 04:30:48 +0100 |
commit | ab74fb169d427b66c73da184ac5a07ec07b34e02 (patch) | |
tree | 44509044a72ef8d41a3000ffb8f74b1e1393af81 /src/main/java/at/hannibal2/skyhanni/features/bazaar | |
parent | 4aab6d58e4c7a7b67acf8dac2dbff76fbe6a6ca1 (diff) | |
download | skyhanni-ab74fb169d427b66c73da184ac5a07ec07b34e02.tar.gz skyhanni-ab74fb169d427b66c73da184ac5a07ec07b34e02.tar.bz2 skyhanni-ab74fb169d427b66c73da184ac5a07ec07b34e02.zip |
Internal Change: Regex To Pattern in BazaarApi, CropAccessoryData, andDicerRngCounter (#647)
Misc pattern optimizations. #647
Diffstat (limited to 'src/main/java/at/hannibal2/skyhanni/features/bazaar')
-rw-r--r-- | src/main/java/at/hannibal2/skyhanni/features/bazaar/BazaarApi.kt | 14 |
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 +} |