diff options
| -rw-r--r-- | src/main/java/at/hannibal2/skyhanni/features/inventory/chocolatefactory/ChocolateFactoryScreenFlash.kt | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/src/main/java/at/hannibal2/skyhanni/features/inventory/chocolatefactory/ChocolateFactoryScreenFlash.kt b/src/main/java/at/hannibal2/skyhanni/features/inventory/chocolatefactory/ChocolateFactoryScreenFlash.kt index 6e833a5cc..4a6d6f2b6 100644 --- a/src/main/java/at/hannibal2/skyhanni/features/inventory/chocolatefactory/ChocolateFactoryScreenFlash.kt +++ b/src/main/java/at/hannibal2/skyhanni/features/inventory/chocolatefactory/ChocolateFactoryScreenFlash.kt @@ -1,8 +1,11 @@ package at.hannibal2.skyhanni.features.inventory.chocolatefactory +import at.hannibal2.skyhanni.api.event.HandleEvent import at.hannibal2.skyhanni.config.features.inventory.chocolatefactory.ChocolateFactoryRabbitWarningConfig.FlashScreenTypeEntry import at.hannibal2.skyhanni.events.GuiRenderEvent import at.hannibal2.skyhanni.events.SecondPassedEvent +import at.hannibal2.skyhanni.events.hoppity.RabbitFoundEvent +import at.hannibal2.skyhanni.features.event.hoppity.HoppityEggType import at.hannibal2.skyhanni.features.inventory.chocolatefactory.ChocolateFactoryAPI.specialRabbitTextures import at.hannibal2.skyhanni.features.inventory.chocolatefactory.ChocolateFactoryDataLoader.clickMeGoldenRabbitPattern import at.hannibal2.skyhanni.features.inventory.chocolatefactory.ChocolateFactoryDataLoader.clickMeRabbitPattern @@ -23,7 +26,7 @@ import kotlin.math.sin object ChocolateFactoryScreenFlash { private val config get() = ChocolateFactoryAPI.config - var flashScreen = false + private var flashScreen = false @SubscribeEvent fun onTick(event: SecondPassedEvent) { @@ -41,6 +44,12 @@ object ChocolateFactoryScreenFlash { } } + @HandleEvent + fun onRabbitFound(event: RabbitFoundEvent) { + if (event.eggType != HoppityEggType.STRAY) return + flashScreen = false + } + private fun isSpecial(slot: Slot) = clickMeGoldenRabbitPattern.matches(slot.stack.name) || slot.stack.getSkullTexture() in specialRabbitTextures |
