diff options
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 |