diff options
author | hannibal2 <24389977+hannibal00212@users.noreply.github.com> | 2024-06-09 12:07:55 +0200 |
---|---|---|
committer | hannibal2 <24389977+hannibal00212@users.noreply.github.com> | 2024-06-09 12:07:55 +0200 |
commit | 956f9a4d56e533a08e88896277ce9f7e9da06716 (patch) | |
tree | 76ef7f17d358af2af344551a246dd59c7ee4f31e /src/main/java/at | |
parent | a7ecc57e896693632a65fa341760ebca1ed309c5 (diff) | |
download | skyhanni-956f9a4d56e533a08e88896277ce9f7e9da06716.tar.gz skyhanni-956f9a4d56e533a08e88896277ce9f7e9da06716.tar.bz2 skyhanni-956f9a4d56e533a08e88896277ce9f7e9da06716.zip |
made inChocolateFactory also work when feature is disabled
Diffstat (limited to 'src/main/java/at')
-rw-r--r-- | src/main/java/at/hannibal2/skyhanni/features/inventory/chocolatefactory/ChocolateFactoryAPI.kt | 20 |
1 files changed, 12 insertions, 8 deletions
diff --git a/src/main/java/at/hannibal2/skyhanni/features/inventory/chocolatefactory/ChocolateFactoryAPI.kt b/src/main/java/at/hannibal2/skyhanni/features/inventory/chocolatefactory/ChocolateFactoryAPI.kt index e9cfad554..c331c8f54 100644 --- a/src/main/java/at/hannibal2/skyhanni/features/inventory/chocolatefactory/ChocolateFactoryAPI.kt +++ b/src/main/java/at/hannibal2/skyhanni/features/inventory/chocolatefactory/ChocolateFactoryAPI.kt @@ -35,11 +35,11 @@ object ChocolateFactoryAPI { val patternGroup = RepoPattern.group("misc.chocolatefactory") val chocolateAmountPattern by patternGroup.pattern( "chocolate.amount", - "(?<amount>[\\d,]+) Chocolate" + "(?<amount>[\\d,]+) Chocolate", ) private val chocolateFactoryInventoryNamePattern by patternGroup.pattern( "inventory.name", - "Hoppity|Chocolate Factory Milestones" + "Hoppity|Chocolate Factory Milestones", ) var rabbitSlots = mapOf<Int, Int>() @@ -78,19 +78,23 @@ object ChocolateFactoryAPI { @SubscribeEvent fun onInventoryOpen(event: InventoryFullyOpenedEvent) { - if (!isEnabled()) return + if (!LorenzUtils.inSkyBlock) return if (chocolateFactoryInventoryNamePattern.matches(event.inventoryName)) { - chocolateFactoryPaused = true - ChocolateFactoryStats.updateDisplay() + if (config.enabled) { + chocolateFactoryPaused = true + ChocolateFactoryStats.updateDisplay() + } return } if (event.inventoryName != "Chocolate Factory") return inChocolateFactory = true - factoryUpgrades = emptyList() - DelayedRun.runNextTick { - ChocolateFactoryDataLoader.updateInventoryItems(event.inventoryItems) + if (config.enabled) { + factoryUpgrades = emptyList() + DelayedRun.runNextTick { + ChocolateFactoryDataLoader.updateInventoryItems(event.inventoryItems) + } } } |