diff options
author | Fazfoxy <78978526+Fazfoxy@users.noreply.github.com> | 2024-10-11 17:49:06 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-10-11 18:49:06 +0200 |
commit | 8c54be95700b224c2f93b549465dbe06bf3bbe86 (patch) | |
tree | 417d145574f43305aad281ae989b5d74cf3bb821 /src | |
parent | ec5c1957e6f24a2ca25d5242fa169540ac461344 (diff) | |
download | skyhanni-8c54be95700b224c2f93b549465dbe06bf3bbe86.tar.gz skyhanni-8c54be95700b224c2f93b549465dbe06bf3bbe86.tar.bz2 skyhanni-8c54be95700b224c2f93b549465dbe06bf3bbe86.zip |
Fix: buy from bazaar supercraft on overflowed inventory names (#2703)
Co-authored-by: Cal <cwolfson58@gmail.com>
Diffstat (limited to 'src')
-rw-r--r-- | src/main/java/at/hannibal2/skyhanni/features/inventory/bazaar/CraftMaterialsFromBazaar.kt | 10 |
1 files changed, 2 insertions, 8 deletions
diff --git a/src/main/java/at/hannibal2/skyhanni/features/inventory/bazaar/CraftMaterialsFromBazaar.kt b/src/main/java/at/hannibal2/skyhanni/features/inventory/bazaar/CraftMaterialsFromBazaar.kt index b5c3c6ab4..36b5fa505 100644 --- a/src/main/java/at/hannibal2/skyhanni/features/inventory/bazaar/CraftMaterialsFromBazaar.kt +++ b/src/main/java/at/hannibal2/skyhanni/features/inventory/bazaar/CraftMaterialsFromBazaar.kt @@ -17,10 +17,8 @@ import at.hannibal2.skyhanni.utils.NumberUtil.addSeparators import at.hannibal2.skyhanni.utils.NumberUtil.shortFormat import at.hannibal2.skyhanni.utils.PrimitiveItemStack import at.hannibal2.skyhanni.utils.PrimitiveItemStack.Companion.makePrimitiveStack -import at.hannibal2.skyhanni.utils.RegexUtils.matches import at.hannibal2.skyhanni.utils.RenderUtils.renderRenderables import at.hannibal2.skyhanni.utils.renderables.Renderable -import at.hannibal2.skyhanni.utils.repopatterns.RepoPattern import net.minecraftforge.fml.common.eventhandler.SubscribeEvent @SkyHanniModule @@ -29,10 +27,6 @@ object CraftMaterialsFromBazaar { private val config get() = SkyHanniMod.feature.inventory.bazaar private val materialSlots = listOf(10, 11, 12, 19, 20, 21, 28, 29, 30) - private val inventoryPattern by RepoPattern.pattern( - "inventory.recipe.title", - ".* Recipe" - ) private var inRecipeInventory = false private var purchasing = false @@ -43,11 +37,11 @@ object CraftMaterialsFromBazaar { @SubscribeEvent fun onInventoryOpen(event: InventoryFullyOpenedEvent) { if (!isEnabled()) return - val correctInventoryName = inventoryPattern.matches(event.inventoryName) val items = event.inventoryItems val correctItem = items[23]?.name == "§aCrafting Table" + val correctSuperCraftItem = items[32]?.name == "§aSupercraft" - inRecipeInventory = correctInventoryName && correctItem && !purchasing + inRecipeInventory = correctSuperCraftItem && correctItem && !purchasing if (!inRecipeInventory) return val recipeName = items[25]?.itemName ?: return |