From 640d2800eb97bce9f501ee93360c06fff700caf2 Mon Sep 17 00:00:00 2001 From: hannibal2 <24389977+hannibal00212@users.noreply.github.com> Date: Sun, 24 Dec 2023 16:57:52 +0100 Subject: Fixed non god pot effects display stay after profile switch. --- .../hannibal2/skyhanni/features/misc/NonGodPotEffectDisplay.kt | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/src/main/java/at/hannibal2/skyhanni/features/misc/NonGodPotEffectDisplay.kt b/src/main/java/at/hannibal2/skyhanni/features/misc/NonGodPotEffectDisplay.kt index b95f68885..c037598e6 100644 --- a/src/main/java/at/hannibal2/skyhanni/features/misc/NonGodPotEffectDisplay.kt +++ b/src/main/java/at/hannibal2/skyhanni/features/misc/NonGodPotEffectDisplay.kt @@ -2,12 +2,14 @@ package at.hannibal2.skyhanni.features.misc import at.hannibal2.skyhanni.SkyHanniMod import at.hannibal2.skyhanni.config.ConfigUpdaterMigrator +import at.hannibal2.skyhanni.data.ProfileStorageData import at.hannibal2.skyhanni.events.GuiRenderEvent import at.hannibal2.skyhanni.events.InventoryFullyOpenedEvent import at.hannibal2.skyhanni.events.LorenzChatEvent import at.hannibal2.skyhanni.events.LorenzTickEvent import at.hannibal2.skyhanni.events.LorenzWorldChangeEvent import at.hannibal2.skyhanni.events.PacketEvent +import at.hannibal2.skyhanni.events.PreProfileSwitchEvent import at.hannibal2.skyhanni.features.rift.RiftAPI import at.hannibal2.skyhanni.test.command.ErrorManager import at.hannibal2.skyhanni.utils.ItemUtils.getLore @@ -69,6 +71,12 @@ class NonGodPotEffectDisplay { private var patternEffectsCount = "§7You have §e(?\\d+) §7non-god effects\\.".toPattern() private var totalEffectsCount = 0 + @SubscribeEvent + fun onPreProfileSwitch(event: PreProfileSwitchEvent) { + effectDuration.clear() + display = emptyList() + } + // todo : cleanup and add support for poison candy I, and add support for splash / other formats @SubscribeEvent fun onChatMessage(event: LorenzChatEvent) { @@ -159,6 +167,7 @@ class NonGodPotEffectDisplay { fun onTick(event: LorenzTickEvent) { if (!isEnabled()) return if (!event.repeatSeconds(1)) return + if (!ProfileStorageData.loaded) return update() } -- cgit