aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorhannibal2 <24389977+hannibal00212@users.noreply.github.com>2024-06-09 12:07:55 +0200
committerhannibal2 <24389977+hannibal00212@users.noreply.github.com>2024-06-09 12:07:55 +0200
commit956f9a4d56e533a08e88896277ce9f7e9da06716 (patch)
tree76ef7f17d358af2af344551a246dd59c7ee4f31e /src
parenta7ecc57e896693632a65fa341760ebca1ed309c5 (diff)
downloadskyhanni-956f9a4d56e533a08e88896277ce9f7e9da06716.tar.gz
skyhanni-956f9a4d56e533a08e88896277ce9f7e9da06716.tar.bz2
skyhanni-956f9a4d56e533a08e88896277ce9f7e9da06716.zip
made inChocolateFactory also work when feature is disabled
Diffstat (limited to 'src')
-rw-r--r--src/main/java/at/hannibal2/skyhanni/features/inventory/chocolatefactory/ChocolateFactoryAPI.kt20
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)
+ }
}
}