diff options
author | Clicks <58398364+CuzImClicks@users.noreply.github.com> | 2024-09-23 16:47:07 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-09-23 16:47:07 +0200 |
commit | f71458b10781f366d6220b662dba42abe0aa80b3 (patch) | |
tree | fc861dca649ed138090492ce03e990cd5d2ec149 /src/main/java/at/hannibal2/skyhanni/features | |
parent | 7c9f889efd9c5d889394f8bf00288ef1c38f8ae4 (diff) | |
download | skyhanni-f71458b10781f366d6220b662dba42abe0aa80b3.tar.gz skyhanni-f71458b10781f366d6220b662dba42abe0aa80b3.tar.bz2 skyhanni-f71458b10781f366d6220b662dba42abe0aa80b3.zip |
Feature: Reindrake Warp Helper (#2569)
Diffstat (limited to 'src/main/java/at/hannibal2/skyhanni/features')
-rw-r--r-- | src/main/java/at/hannibal2/skyhanni/features/event/winter/ReindrakeWarpHelper.kt | 42 |
1 files changed, 42 insertions, 0 deletions
diff --git a/src/main/java/at/hannibal2/skyhanni/features/event/winter/ReindrakeWarpHelper.kt b/src/main/java/at/hannibal2/skyhanni/features/event/winter/ReindrakeWarpHelper.kt new file mode 100644 index 000000000..7131426d4 --- /dev/null +++ b/src/main/java/at/hannibal2/skyhanni/features/event/winter/ReindrakeWarpHelper.kt @@ -0,0 +1,42 @@ +package at.hannibal2.skyhanni.features.event.winter + +import at.hannibal2.skyhanni.SkyHanniMod +import at.hannibal2.skyhanni.data.IslandType +import at.hannibal2.skyhanni.events.LorenzChatEvent +import at.hannibal2.skyhanni.skyhannimodule.SkyHanniModule +import at.hannibal2.skyhanni.utils.ChatUtils +import at.hannibal2.skyhanni.utils.HypixelCommands +import at.hannibal2.skyhanni.utils.LorenzUtils.isInIsland +import at.hannibal2.skyhanni.utils.RegexUtils.matches +import at.hannibal2.skyhanni.utils.repopatterns.RepoPattern +import net.minecraftforge.fml.common.eventhandler.SubscribeEvent + +@SkyHanniModule +object ReindrakeWarpHelper { + + private val config get() = SkyHanniMod.feature.event.winter + + private val patternGroup = RepoPattern.group("event.winter.reindrakewarphelper") + + /** + * REGEX-TEST: §c§lWOAH! §cA §4Reindrake §cwas summoned from the depths! + */ + private val spawnPattern by patternGroup.pattern( + "spawn.message", + "§c§lWOAH! §cA §4Reindrake §cwas summoned from the depths!", + ) + + @SubscribeEvent + fun onMessage(event: LorenzChatEvent) { + if (!isEnabled()) return + if (!spawnPattern.matches(event.message)) return + ChatUtils.clickToActionOrDisable( + "A Reindrake was detected. Click to warp to the Winter Island spawn!", + config::reindrakeWarpHelper, + actionName = "warp to winter island spawn", + action = { HypixelCommands.warp("winter") } + ) + } + + fun isEnabled() = IslandType.WINTER.isInIsland() && config.reindrakeWarpHelper +} |