diff options
Diffstat (limited to 'src')
-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) + } } } |