diff options
author | hannibal2 <24389977+hannibal00212@users.noreply.github.com> | 2023-09-17 09:38:59 +0200 |
---|---|---|
committer | hannibal2 <24389977+hannibal00212@users.noreply.github.com> | 2023-09-17 09:38:59 +0200 |
commit | 92c9d6e7982bbebf619c6b6352e06d0ac6b28228 (patch) | |
tree | 645b36bbf45d85dc9c229dfb5cb770a37e4dce7a /src/main/java/at/hannibal2/skyhanni/features/misc | |
parent | 86031f42f3f904e295c8e4a402777d747cf0dfe8 (diff) | |
download | skyhanni-92c9d6e7982bbebf619c6b6352e06d0ac6b28228.tar.gz skyhanni-92c9d6e7982bbebf619c6b6352e06d0ac6b28228.tar.bz2 skyhanni-92c9d6e7982bbebf619c6b6352e06d0ac6b28228.zip |
migrate bonzo mask and chicken head config into item ability
Diffstat (limited to 'src/main/java/at/hannibal2/skyhanni/features/misc')
-rw-r--r-- | src/main/java/at/hannibal2/skyhanni/features/misc/ChickenHeadTimer.kt | 16 |
1 files changed, 12 insertions, 4 deletions
diff --git a/src/main/java/at/hannibal2/skyhanni/features/misc/ChickenHeadTimer.kt b/src/main/java/at/hannibal2/skyhanni/features/misc/ChickenHeadTimer.kt index 3b393b624..e5ce90ae8 100644 --- a/src/main/java/at/hannibal2/skyhanni/features/misc/ChickenHeadTimer.kt +++ b/src/main/java/at/hannibal2/skyhanni/features/misc/ChickenHeadTimer.kt @@ -1,6 +1,7 @@ package at.hannibal2.skyhanni.features.misc import at.hannibal2.skyhanni.SkyHanniMod +import at.hannibal2.skyhanni.config.ConfigUpdaterMigrator import at.hannibal2.skyhanni.events.GuiRenderEvent import at.hannibal2.skyhanni.events.LorenzChatEvent import at.hannibal2.skyhanni.events.LorenzTickEvent @@ -15,7 +16,7 @@ import net.minecraftforge.fml.common.eventhandler.SubscribeEvent class ChickenHeadTimer { private var hasChickenHead = false private var lastTime = 0L - private val config get() = SkyHanniMod.feature.misc + private val config get() = SkyHanniMod.feature.itemAbilities.chickenHead @SubscribeEvent fun onTick(event: LorenzTickEvent) { @@ -38,7 +39,7 @@ class ChickenHeadTimer { if (!hasChickenHead) return if (event.message == "§aYou laid an egg!") { lastTime = System.currentTimeMillis() - if (config.chickenHeadTimerHideChat) { + if (config.hideChat) { event.blockedReason = "chicken_head_timer" } } @@ -60,8 +61,15 @@ class ChickenHeadTimer { "Chicken Head Timer: §b$formatDuration" } - config.chickenHeadTimerPosition.renderString(displayText, posLabel = "Chicken Head Timer") + config.position.renderString(displayText, posLabel = "Chicken Head Timer") } - fun isEnabled() = LorenzUtils.inSkyBlock && config.chickenHeadTimerDisplay + @SubscribeEvent + fun onConfigFix(event: ConfigUpdaterMigrator.ConfigFixEvent) { + event.move(2, "misc.chickenHeadTimerHideChat", "itemAbilities.chickenHead.hideChat") + event.move(2, "misc.chickenHeadTimerPosition", "itemAbilities.chickenHead.position") + event.move(2, "misc.chickenHeadTimerDisplay", "itemAbilities.chickenHead.displayTimer") + } + + fun isEnabled() = LorenzUtils.inSkyBlock && config.displayTimer }
\ No newline at end of file |