diff options
author | hannibal2 <24389977+hannibal00212@users.noreply.github.com> | 2024-08-26 13:05:38 +0200 |
---|---|---|
committer | hannibal2 <24389977+hannibal00212@users.noreply.github.com> | 2024-08-26 13:05:38 +0200 |
commit | 0de989153f2d1ae39506a6f24394118d8045ae11 (patch) | |
tree | 9e577d92798e2c6ddb1661eb5e9afac0bb83e6e6 /src/main/java | |
parent | acaaa66cf6c789282f9a4eac581b85d8de26b1e3 (diff) | |
download | skyhanni-0de989153f2d1ae39506a6f24394118d8045ae11.tar.gz skyhanni-0de989153f2d1ae39506a6f24394118d8045ae11.tar.bz2 skyhanni-0de989153f2d1ae39506a6f24394118d8045ae11.zip |
code cleanup
Diffstat (limited to 'src/main/java')
-rw-r--r-- | src/main/java/at/hannibal2/skyhanni/features/mining/ForgeGfs.kt | 13 |
1 files changed, 7 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 4971aaf3b..28f117832 100644 --- a/src/main/java/at/hannibal2/skyhanni/features/mining/ForgeGfs.kt +++ b/src/main/java/at/hannibal2/skyhanni/features/mining/ForgeGfs.kt @@ -26,10 +26,10 @@ object ForgeGfs { private val confirmScreenPattern by patternGroup.pattern( "recipe.confirm", - "Confirm Process\$" + "Confirm Process", ) - private val config get() = SkyHanniMod.feature.mining.forgeGfs + private val config get() = SkyHanniMod.feature.mining private val gfsFakeItem by lazy { ItemUtils.createSkull( @@ -41,7 +41,7 @@ object ForgeGfs { "RleHR1cmUvODBhMDc3ZTI0OGQxNDI3NzJlYTgwMDg2NGY4YzU3OGI5ZDM2ODg1YjI5ZGFmODM2YjY0YTcwNjg4MmI2ZWMxMCIKICAgIH0KICB9Cn0=", "§8(from SkyHanni)", "§7Click here to try to get all of this", - "§7recipe's ingredients from sacks." + "§7recipe's ingredients from sacks.", ) } @@ -49,8 +49,7 @@ object ForgeGfs { @SubscribeEvent fun onInventoryOpen(event: InventoryUpdatedEvent) { - if (!LorenzUtils.inSkyBlock) return - if (!config) return + if (!isEnabled()) return if (!confirmScreenPattern.matches(event.inventoryName)) return showFakeItem = true @@ -70,7 +69,7 @@ object ForgeGfs { @SubscribeEvent fun onSlotClick(event: GuiContainerEvent.SlotClickEvent) { - if (!config) return + if (!isEnabled()) return if (!showFakeItem || event.slotId != 53) return event.cancel() @@ -101,4 +100,6 @@ object ForgeGfs { private fun MutableMap<NEUInternalName, Int>.addAndFold(key: NEUInternalName, value: Int) { this[key] = this.getOrDefault(key, 0) + value } + + fun isEnabled() = LorenzUtils.inSkyBlock && config.forgeGfs } |