From ec9eb33c5cd77dac6ab51c60aa98a08af7f0ad50 Mon Sep 17 00:00:00 2001 From: minhperry Date: Sat, 15 Jun 2024 02:06:56 +0200 Subject: [PATCH 1/7] Feature: Forge Get from Sack pt.1 --- .../config/features/mining/MiningConfig.java | 6 +++ .../skyhanni/features/mining/ForgeGfs.kt | 48 +++++++++++++++++++ 2 files changed, 54 insertions(+) create mode 100644 src/main/java/at/hannibal2/skyhanni/features/mining/ForgeGfs.kt diff --git a/src/main/java/at/hannibal2/skyhanni/config/features/mining/MiningConfig.java b/src/main/java/at/hannibal2/skyhanni/config/features/mining/MiningConfig.java index 870c31929ee2..2ffa11a5ed4b 100644 --- a/src/main/java/at/hannibal2/skyhanni/config/features/mining/MiningConfig.java +++ b/src/main/java/at/hannibal2/skyhanni/config/features/mining/MiningConfig.java @@ -91,4 +91,10 @@ public class MiningConfig { @ConfigEditorBoolean @FeatureToggle public boolean highlightYourGoldenGoblin = true; + + @Expose + @ConfigOption(name = "Forge GfS", desc = "Get items from Sacks to forge.") + @ConfigEditorBoolean + @FeatureToggle + public boolean forgeGfs = false; } diff --git a/src/main/java/at/hannibal2/skyhanni/features/mining/ForgeGfs.kt b/src/main/java/at/hannibal2/skyhanni/features/mining/ForgeGfs.kt new file mode 100644 index 000000000000..af79bf16bf28 --- /dev/null +++ b/src/main/java/at/hannibal2/skyhanni/features/mining/ForgeGfs.kt @@ -0,0 +1,48 @@ +package at.hannibal2.skyhanni.features.mining + +import at.hannibal2.skyhanni.SkyHanniMod +import at.hannibal2.skyhanni.events.GuiContainerEvent +import at.hannibal2.skyhanni.skyhannimodule.SkyHanniModule +import at.hannibal2.skyhanni.utils.ChatUtils +import at.hannibal2.skyhanni.utils.InventoryUtils +import at.hannibal2.skyhanni.utils.ItemUtils.getLore +import at.hannibal2.skyhanni.utils.RegexUtils.matches +import at.hannibal2.skyhanni.utils.repopatterns.RepoPattern +import io.github.moulberry.notenoughupdates.util.stripControlCodes +import net.minecraftforge.fml.common.eventhandler.SubscribeEvent + +@SkyHanniModule +object ForgeGfs { + + private val patternGroup = RepoPattern.group("mining.forge") + + private val forgePattern by patternGroup.pattern( + "inventory.name", + "^(Refine|Item Casting) \\(Slot #\\d+\\)\$" + ) + + // Matching Gemstone: ^[\p{L}\p{S}\p{P}\s]+ x\d+$|^\d{1,3}(,\d{3})* Coins$ + // Old: ^[A-Za-z\s'-]+ x\d+$|^\d{1,3}(,\d{3})* Coins$ + private val ingredientPattern by patternGroup.pattern( + "ingredient", + "^[\\p{L}\\p{S}\\p{P}\\s]+ x\\d+\$|^\\d{1,3}(,\\d{3})* Coins\$" + ) + + private val config get() = SkyHanniMod.feature.mining.forgeGfs + + @SubscribeEvent + fun onSlotClick(event: GuiContainerEvent.SlotClickEvent) { + if (!config) return + if (!forgePattern.matches(InventoryUtils.openInventoryName())) return + if (!event.clickTypeEnum?.equals(GuiContainerEvent.ClickType.SHIFT)!!) return + + val itemLore = event.item?.getLore() + val itemLorePlain = itemLore?.map {it.stripControlCodes()} + // ChatUtils.debug("Item lore: ${itemLore.toString()}") + // ChatUtils.debug("Item lore plain: ${itemLorePlain.toString()}") + + val matchedLines = itemLorePlain?.filter {ingredientPattern.matches(it)} + ChatUtils.debug("Matched lines: ${matchedLines.toString()}") + + } +} From a70a7c0482ee6e9eb633b3ff16459d92e0153017 Mon Sep 17 00:00:00 2001 From: minhperry Date: Sun, 16 Jun 2024 01:05:13 +0200 Subject: [PATCH 2/7] Feature: Forge Get from Sack pt. final --- .../config/features/mining/MiningConfig.java | 2 +- .../skyhanni/features/mining/ForgeGfs.kt | 95 +++++++++++++++---- 2 files changed, 76 insertions(+), 21 deletions(-) diff --git a/src/main/java/at/hannibal2/skyhanni/config/features/mining/MiningConfig.java b/src/main/java/at/hannibal2/skyhanni/config/features/mining/MiningConfig.java index 2ffa11a5ed4b..05c5d9a99404 100644 --- a/src/main/java/at/hannibal2/skyhanni/config/features/mining/MiningConfig.java +++ b/src/main/java/at/hannibal2/skyhanni/config/features/mining/MiningConfig.java @@ -93,7 +93,7 @@ public class MiningConfig { public boolean highlightYourGoldenGoblin = true; @Expose - @ConfigOption(name = "Forge GfS", desc = "Get items from Sacks to forge.") + @ConfigOption(name = "Forge GfS", desc = "Get Forge ingredients of a recipe.") @ConfigEditorBoolean @FeatureToggle public boolean forgeGfs = false; diff --git a/src/main/java/at/hannibal2/skyhanni/features/mining/ForgeGfs.kt b/src/main/java/at/hannibal2/skyhanni/features/mining/ForgeGfs.kt index af79bf16bf28..27d89ccfd29a 100644 --- a/src/main/java/at/hannibal2/skyhanni/features/mining/ForgeGfs.kt +++ b/src/main/java/at/hannibal2/skyhanni/features/mining/ForgeGfs.kt @@ -1,14 +1,24 @@ package at.hannibal2.skyhanni.features.mining import at.hannibal2.skyhanni.SkyHanniMod +import at.hannibal2.skyhanni.api.GetFromSackAPI +import at.hannibal2.skyhanni.data.SackAPI import at.hannibal2.skyhanni.events.GuiContainerEvent +import at.hannibal2.skyhanni.events.InventoryCloseEvent +import at.hannibal2.skyhanni.events.InventoryFullyOpenedEvent +import at.hannibal2.skyhanni.events.InventoryUpdatedEvent +import at.hannibal2.skyhanni.events.render.gui.ReplaceItemEvent import at.hannibal2.skyhanni.skyhannimodule.SkyHanniModule import at.hannibal2.skyhanni.utils.ChatUtils import at.hannibal2.skyhanni.utils.InventoryUtils -import at.hannibal2.skyhanni.utils.ItemUtils.getLore +import at.hannibal2.skyhanni.utils.ItemUtils +import at.hannibal2.skyhanni.utils.ItemUtils.getInternalNameOrNull +import at.hannibal2.skyhanni.utils.ItemUtils.itemNameWithoutColor +import at.hannibal2.skyhanni.utils.NEUInternalName import at.hannibal2.skyhanni.utils.RegexUtils.matches import at.hannibal2.skyhanni.utils.repopatterns.RepoPattern -import io.github.moulberry.notenoughupdates.util.stripControlCodes +import net.minecraft.client.player.inventory.ContainerLocalMenu +import net.minecraft.item.ItemStack import net.minecraftforge.fml.common.eventhandler.SubscribeEvent @SkyHanniModule @@ -16,33 +26,78 @@ object ForgeGfs { private val patternGroup = RepoPattern.group("mining.forge") - private val forgePattern by patternGroup.pattern( - "inventory.name", - "^(Refine|Item Casting) \\(Slot #\\d+\\)\$" - ) - - // Matching Gemstone: ^[\p{L}\p{S}\p{P}\s]+ x\d+$|^\d{1,3}(,\d{3})* Coins$ - // Old: ^[A-Za-z\s'-]+ x\d+$|^\d{1,3}(,\d{3})* Coins$ - private val ingredientPattern by patternGroup.pattern( - "ingredient", - "^[\\p{L}\\p{S}\\p{P}\\s]+ x\\d+\$|^\\d{1,3}(,\\d{3})* Coins\$" + private val confirmScreenPattern by patternGroup.pattern( + "recipe.confirm", + "Confirm Process\$" ) private val config get() = SkyHanniMod.feature.mining.forgeGfs + private val gfsFakeItem by lazy { + ItemUtils.createSkull( + displayName = "§aGet items from sack", + uuid = "75ea8094-5152-4457-8c23-1ad9b3c176c0", + value = "ewogICJ0aW1lc3RhbXAiIDogMTU5MTMxMDU4NTYwOSwKICAicHJvZmlsZUlkIiA6ICI0MWQzYWJjMmQ3NDk0MDBjOTA5MGQ1NDM0ZDAzODMxYiIsCiAgInByb2ZpbGVOYW1lIiA6ICJNZWdha2xvb24iLAogICJzaWduYXR1cmVSZXF1aXJlZCIgOiB0cnVlLAogI"+ + "CJ0ZXh0dXJlcyIgOiB7CiAgICAiU0tJTiIgOiB7CiAgICAgICJ1cmwiIDogImh0dHA6Ly90ZXh0dXJlcy5taW5lY3JhZnQubmV0L3RleHR1cmUvODBhMDc3ZTI0OGQxNDI3NzJlYTgwMDg2NGY4YzU3OGI5ZDM2ODg1YjI5ZGFmODM2YjY0YTcwNjg4MmI2ZWMxMCIKICAgIH0KICB9Cn0=", + "§8(from SkyHanni)", + "§7Click here to try to get all of this", + "§7recipe's ingredients from sack." + ) + } + + private var showFakeItem = false + + @SubscribeEvent + fun onInventoryOpen(event: InventoryUpdatedEvent) { + if (!config) return + if (!confirmScreenPattern.matches(event.inventoryName)) return + + showFakeItem = config && confirmScreenPattern.matches(event.inventoryName) + } + + @SubscribeEvent + fun onInventoryClose(event: InventoryCloseEvent) { + showFakeItem = false + } + + @SubscribeEvent + fun replaceItem(event: ReplaceItemEvent) { + if (event.inventory is ContainerLocalMenu && showFakeItem && event.slot == 53) { + event.replace(gfsFakeItem) + } + } + @SubscribeEvent fun onSlotClick(event: GuiContainerEvent.SlotClickEvent) { if (!config) return - if (!forgePattern.matches(InventoryUtils.openInventoryName())) return - if (!event.clickTypeEnum?.equals(GuiContainerEvent.ClickType.SHIFT)!!) return + if (!showFakeItem || event.slotId != 53) return - val itemLore = event.item?.getLore() - val itemLorePlain = itemLore?.map {it.stripControlCodes()} - // ChatUtils.debug("Item lore: ${itemLore.toString()}") - // ChatUtils.debug("Item lore plain: ${itemLorePlain.toString()}") + event.cancel() - val matchedLines = itemLorePlain?.filter {ingredientPattern.matches(it)} - ChatUtils.debug("Matched lines: ${matchedLines.toString()}") + val itemMap: MutableMap = LinkedHashMap() + // Search for the first 4 columns only + // Normally would be 3, but the gemstone mixture is the only one that overflows to 4 + val thisContainer = event.container + for (i in 0..53) { + if (i % 9 <= 3) { + val currentItem = thisContainer.getSlot(i).stack + val amount = currentItem.stackSize + val currItemInternalName = currentItem.getInternalNameOrNull() ?: continue + if (SackAPI.sackListInternalNames.contains(currItemInternalName.asString())) { + itemMap.addAndFold(currItemInternalName, amount) + } + } + } + + for ((internalName, amount) in itemMap) { + val getItYet = GetFromSackAPI.getFromSack(internalName, amount) + if (!getItYet) { + ChatUtils.chat("§cFailed to get $amount ${internalName.itemNameWithoutColor} from sack.") + } + } + } + private fun MutableMap.addAndFold(key: NEUInternalName, value: Int) { + this[key] = this.getOrDefault(key, 0) + value } } From 0aecd437a7fdc3df7543a481689835da47453860 Mon Sep 17 00:00:00 2001 From: minhperry Date: Sun, 16 Jun 2024 01:05:56 +0200 Subject: [PATCH 3/7] Feature: Forge Get from Sack pt. final --- .../java/at/hannibal2/skyhanni/features/mining/ForgeGfs.kt | 3 --- 1 file changed, 3 deletions(-) diff --git a/src/main/java/at/hannibal2/skyhanni/features/mining/ForgeGfs.kt b/src/main/java/at/hannibal2/skyhanni/features/mining/ForgeGfs.kt index 27d89ccfd29a..cace6d54f01c 100644 --- a/src/main/java/at/hannibal2/skyhanni/features/mining/ForgeGfs.kt +++ b/src/main/java/at/hannibal2/skyhanni/features/mining/ForgeGfs.kt @@ -5,12 +5,10 @@ import at.hannibal2.skyhanni.api.GetFromSackAPI import at.hannibal2.skyhanni.data.SackAPI import at.hannibal2.skyhanni.events.GuiContainerEvent import at.hannibal2.skyhanni.events.InventoryCloseEvent -import at.hannibal2.skyhanni.events.InventoryFullyOpenedEvent import at.hannibal2.skyhanni.events.InventoryUpdatedEvent import at.hannibal2.skyhanni.events.render.gui.ReplaceItemEvent import at.hannibal2.skyhanni.skyhannimodule.SkyHanniModule import at.hannibal2.skyhanni.utils.ChatUtils -import at.hannibal2.skyhanni.utils.InventoryUtils import at.hannibal2.skyhanni.utils.ItemUtils import at.hannibal2.skyhanni.utils.ItemUtils.getInternalNameOrNull import at.hannibal2.skyhanni.utils.ItemUtils.itemNameWithoutColor @@ -18,7 +16,6 @@ import at.hannibal2.skyhanni.utils.NEUInternalName import at.hannibal2.skyhanni.utils.RegexUtils.matches import at.hannibal2.skyhanni.utils.repopatterns.RepoPattern import net.minecraft.client.player.inventory.ContainerLocalMenu -import net.minecraft.item.ItemStack import net.minecraftforge.fml.common.eventhandler.SubscribeEvent @SkyHanniModule From 75bbf69ea4e58823b06d3d11e7c56b0f51fd3fe7 Mon Sep 17 00:00:00 2001 From: minhperry Date: Sun, 16 Jun 2024 01:51:47 +0200 Subject: [PATCH 4/7] refactor: cleanup, style and small boolean logic fix --- .../at/hannibal2/skyhanni/features/mining/ForgeGfs.kt | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/src/main/java/at/hannibal2/skyhanni/features/mining/ForgeGfs.kt b/src/main/java/at/hannibal2/skyhanni/features/mining/ForgeGfs.kt index cace6d54f01c..c6a6dd81d2f1 100644 --- a/src/main/java/at/hannibal2/skyhanni/features/mining/ForgeGfs.kt +++ b/src/main/java/at/hannibal2/skyhanni/features/mining/ForgeGfs.kt @@ -34,8 +34,10 @@ object ForgeGfs { ItemUtils.createSkull( displayName = "§aGet items from sack", uuid = "75ea8094-5152-4457-8c23-1ad9b3c176c0", - value = "ewogICJ0aW1lc3RhbXAiIDogMTU5MTMxMDU4NTYwOSwKICAicHJvZmlsZUlkIiA6ICI0MWQzYWJjMmQ3NDk0MDBjOTA5MGQ1NDM0ZDAzODMxYiIsCiAgInByb2ZpbGVOYW1lIiA6ICJNZWdha2xvb24iLAogICJzaWduYXR1cmVSZXF1aXJlZCIgOiB0cnVlLAogI"+ - "CJ0ZXh0dXJlcyIgOiB7CiAgICAiU0tJTiIgOiB7CiAgICAgICJ1cmwiIDogImh0dHA6Ly90ZXh0dXJlcy5taW5lY3JhZnQubmV0L3RleHR1cmUvODBhMDc3ZTI0OGQxNDI3NzJlYTgwMDg2NGY4YzU3OGI5ZDM2ODg1YjI5ZGFmODM2YjY0YTcwNjg4MmI2ZWMxMCIKICAgIH0KICB9Cn0=", + value = "ewogICJ0aW1lc3RhbXAiIDogMTU5MTMxMDU4NTYwOSwKICAicHJvZmlsZUlkIiA6ICI0MWQzYWJjMmQ3NDk0MDBjOTA5MGQ1NDM0ZDAzODMxYiIsC" + + "iAgInByb2ZpbGVOYW1lIiA6ICJNZWdha2xvb24iLAogICJzaWduYXR1cmVSZXF1aXJlZCIgOiB0cnVlLAogI" + + "CJ0ZXh0dXJlcyIgOiB7CiAgICAiU0tJTiIgOiB7CiAgICAgICJ1cmwiIDogImh0dHA6Ly90ZXh0dXJlcy5taW5lY3JhZnQubmV0L3" + + "RleHR1cmUvODBhMDc3ZTI0OGQxNDI3NzJlYTgwMDg2NGY4YzU3OGI5ZDM2ODg1YjI5ZGFmODM2YjY0YTcwNjg4MmI2ZWMxMCIKICAgIH0KICB9Cn0=", "§8(from SkyHanni)", "§7Click here to try to get all of this", "§7recipe's ingredients from sack." @@ -49,7 +51,9 @@ object ForgeGfs { if (!config) return if (!confirmScreenPattern.matches(event.inventoryName)) return - showFakeItem = config && confirmScreenPattern.matches(event.inventoryName) + // Passing 2 filters means that both are true + // showFakeItem = config && confirmScreenPattern.matches(event.inventoryName) + showFakeItem = true } @SubscribeEvent From b80cde4197baaf77e86aa038db8831860125768e Mon Sep 17 00:00:00 2001 From: minhperry Date: Sun, 16 Jun 2024 14:25:15 +0200 Subject: [PATCH 5/7] refactor: cleanup comments and fix style --- .../hannibal2/skyhanni/features/mining/ForgeGfs.kt | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/src/main/java/at/hannibal2/skyhanni/features/mining/ForgeGfs.kt b/src/main/java/at/hannibal2/skyhanni/features/mining/ForgeGfs.kt index c6a6dd81d2f1..64168b198b79 100644 --- a/src/main/java/at/hannibal2/skyhanni/features/mining/ForgeGfs.kt +++ b/src/main/java/at/hannibal2/skyhanni/features/mining/ForgeGfs.kt @@ -12,6 +12,7 @@ import at.hannibal2.skyhanni.utils.ChatUtils import at.hannibal2.skyhanni.utils.ItemUtils import at.hannibal2.skyhanni.utils.ItemUtils.getInternalNameOrNull import at.hannibal2.skyhanni.utils.ItemUtils.itemNameWithoutColor +import at.hannibal2.skyhanni.utils.LorenzUtils import at.hannibal2.skyhanni.utils.NEUInternalName import at.hannibal2.skyhanni.utils.RegexUtils.matches import at.hannibal2.skyhanni.utils.repopatterns.RepoPattern @@ -34,10 +35,10 @@ object ForgeGfs { ItemUtils.createSkull( displayName = "§aGet items from sack", uuid = "75ea8094-5152-4457-8c23-1ad9b3c176c0", - value = "ewogICJ0aW1lc3RhbXAiIDogMTU5MTMxMDU4NTYwOSwKICAicHJvZmlsZUlkIiA6ICI0MWQzYWJjMmQ3NDk0MDBjOTA5MGQ1NDM0ZDAzODMxYiIsC" - + "iAgInByb2ZpbGVOYW1lIiA6ICJNZWdha2xvb24iLAogICJzaWduYXR1cmVSZXF1aXJlZCIgOiB0cnVlLAogI" - + "CJ0ZXh0dXJlcyIgOiB7CiAgICAiU0tJTiIgOiB7CiAgICAgICJ1cmwiIDogImh0dHA6Ly90ZXh0dXJlcy5taW5lY3JhZnQubmV0L3" - + "RleHR1cmUvODBhMDc3ZTI0OGQxNDI3NzJlYTgwMDg2NGY4YzU3OGI5ZDM2ODg1YjI5ZGFmODM2YjY0YTcwNjg4MmI2ZWMxMCIKICAgIH0KICB9Cn0=", + value = "ewogICJ0aW1lc3RhbXAiIDogMTU5MTMxMDU4NTYwOSwKICAicHJvZmlsZUlkIiA6ICI0MWQzYWJjMmQ3NDk0MDBjOTA5MGQ1NDM0ZDAzODMxYiIsC" + + "iAgInByb2ZpbGVOYW1lIiA6ICJNZWdha2xvb24iLAogICJzaWduYXR1cmVSZXF1aXJlZCIgOiB0cnVlLAogI" + + "CJ0ZXh0dXJlcyIgOiB7CiAgICAiU0tJTiIgOiB7CiAgICAgICJ1cmwiIDogImh0dHA6Ly90ZXh0dXJlcy5taW5lY3JhZnQubmV0L3" + + "RleHR1cmUvODBhMDc3ZTI0OGQxNDI3NzJlYTgwMDg2NGY4YzU3OGI5ZDM2ODg1YjI5ZGFmODM2YjY0YTcwNjg4MmI2ZWMxMCIKICAgIH0KICB9Cn0=", "§8(from SkyHanni)", "§7Click here to try to get all of this", "§7recipe's ingredients from sack." @@ -48,11 +49,10 @@ object ForgeGfs { @SubscribeEvent fun onInventoryOpen(event: InventoryUpdatedEvent) { + if (!LorenzUtils.inSkyBlock) return if (!config) return if (!confirmScreenPattern.matches(event.inventoryName)) return - // Passing 2 filters means that both are true - // showFakeItem = config && confirmScreenPattern.matches(event.inventoryName) showFakeItem = true } From 81dd3cc5d2a911502e31060810e751c2abf6ccf8 Mon Sep 17 00:00:00 2001 From: minhperry Date: Mon, 17 Jun 2024 15:29:08 +0200 Subject: [PATCH 6/7] style: "get from sacks" instead of "sack". --- .../java/at/hannibal2/skyhanni/features/mining/ForgeGfs.kt | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/main/java/at/hannibal2/skyhanni/features/mining/ForgeGfs.kt b/src/main/java/at/hannibal2/skyhanni/features/mining/ForgeGfs.kt index 64168b198b79..c7d1e18bcc74 100644 --- a/src/main/java/at/hannibal2/skyhanni/features/mining/ForgeGfs.kt +++ b/src/main/java/at/hannibal2/skyhanni/features/mining/ForgeGfs.kt @@ -33,7 +33,7 @@ object ForgeGfs { private val gfsFakeItem by lazy { ItemUtils.createSkull( - displayName = "§aGet items from sack", + displayName = "§aGet items from sacks", uuid = "75ea8094-5152-4457-8c23-1ad9b3c176c0", value = "ewogICJ0aW1lc3RhbXAiIDogMTU5MTMxMDU4NTYwOSwKICAicHJvZmlsZUlkIiA6ICI0MWQzYWJjMmQ3NDk0MDBjOTA5MGQ1NDM0ZDAzODMxYiIsC" + "iAgInByb2ZpbGVOYW1lIiA6ICJNZWdha2xvb24iLAogICJzaWduYXR1cmVSZXF1aXJlZCIgOiB0cnVlLAogI" + @@ -41,7 +41,7 @@ object ForgeGfs { "RleHR1cmUvODBhMDc3ZTI0OGQxNDI3NzJlYTgwMDg2NGY4YzU3OGI5ZDM2ODg1YjI5ZGFmODM2YjY0YTcwNjg4MmI2ZWMxMCIKICAgIH0KICB9Cn0=", "§8(from SkyHanni)", "§7Click here to try to get all of this", - "§7recipe's ingredients from sack." + "§7recipe's ingredients from sacks." ) } @@ -93,7 +93,7 @@ object ForgeGfs { for ((internalName, amount) in itemMap) { val getItYet = GetFromSackAPI.getFromSack(internalName, amount) if (!getItYet) { - ChatUtils.chat("§cFailed to get $amount ${internalName.itemNameWithoutColor} from sack.") + ChatUtils.chat("§cFailed to get $amount ${internalName.itemNameWithoutColor} from sacks.") } } } From 79b369121c1dd763f861ad047b8e80087ceaa9ee Mon Sep 17 00:00:00 2001 From: minhperry Date: Mon, 17 Jun 2024 15:31:31 +0200 Subject: [PATCH 7/7] refactor: minimize redundant vals --- .../java/at/hannibal2/skyhanni/features/mining/ForgeGfs.kt | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/main/java/at/hannibal2/skyhanni/features/mining/ForgeGfs.kt b/src/main/java/at/hannibal2/skyhanni/features/mining/ForgeGfs.kt index c7d1e18bcc74..4971aaf3b248 100644 --- a/src/main/java/at/hannibal2/skyhanni/features/mining/ForgeGfs.kt +++ b/src/main/java/at/hannibal2/skyhanni/features/mining/ForgeGfs.kt @@ -78,10 +78,10 @@ object ForgeGfs { val itemMap: MutableMap = LinkedHashMap() // Search for the first 4 columns only // Normally would be 3, but the gemstone mixture is the only one that overflows to 4 - val thisContainer = event.container + for (i in 0..53) { if (i % 9 <= 3) { - val currentItem = thisContainer.getSlot(i).stack + val currentItem = event.container.getSlot(i).stack val amount = currentItem.stackSize val currItemInternalName = currentItem.getInternalNameOrNull() ?: continue if (SackAPI.sackListInternalNames.contains(currItemInternalName.asString())) {