diff options
author | ThatGravyBoat <thatgravyboat@gmail.com> | 2024-10-11 15:06:51 -0230 |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-10-11 19:36:51 +0200 |
commit | 60f92d58aec0ec976cf1b4933174c1143a20551c (patch) | |
tree | 4175f30a3e42deef2387d81e2c785fae678bdf01 /src/main/java/at/hannibal2/skyhanni/features/event | |
parent | 925bb0964d502bdecf74ad14002bdf7c57bb44d6 (diff) | |
download | skyhanni-60f92d58aec0ec976cf1b4933174c1143a20551c.tar.gz skyhanni-60f92d58aec0ec976cf1b4933174c1143a20551c.tar.bz2 skyhanni-60f92d58aec0ec976cf1b4933174c1143a20551c.zip |
Backend: Add event inheritance (#2047)
Co-authored-by: Cal <cwolfson58@gmail.com>
Diffstat (limited to 'src/main/java/at/hannibal2/skyhanni/features/event')
5 files changed, 9 insertions, 5 deletions
diff --git a/src/main/java/at/hannibal2/skyhanni/features/event/carnival/CarnivalQuickStart.kt b/src/main/java/at/hannibal2/skyhanni/features/event/carnival/CarnivalQuickStart.kt index 2257772c8..fe7a73d09 100644 --- a/src/main/java/at/hannibal2/skyhanni/features/event/carnival/CarnivalQuickStart.kt +++ b/src/main/java/at/hannibal2/skyhanni/features/event/carnival/CarnivalQuickStart.kt @@ -1,6 +1,7 @@ package at.hannibal2.skyhanni.features.event.carnival import at.hannibal2.skyhanni.SkyHanniMod +import at.hannibal2.skyhanni.api.event.HandleEvent import at.hannibal2.skyhanni.data.Perk import at.hannibal2.skyhanni.events.EntityClickEvent import at.hannibal2.skyhanni.events.LorenzChatEvent @@ -34,7 +35,7 @@ object CarnivalQuickStart { private var lastChat = SimpleTimeMark.farPast() private var lastClicked = SimpleTimeMark.farPast() - @SubscribeEvent + @HandleEvent fun onEntityClick(event: EntityClickEvent) { if (!isEnabled()) return if (lastChat.passedSince() > 5.0.seconds) return diff --git a/src/main/java/at/hannibal2/skyhanni/features/event/diana/DianaFixChat.kt b/src/main/java/at/hannibal2/skyhanni/features/event/diana/DianaFixChat.kt index 2f3d19c24..aefce4e58 100644 --- a/src/main/java/at/hannibal2/skyhanni/features/event/diana/DianaFixChat.kt +++ b/src/main/java/at/hannibal2/skyhanni/features/event/diana/DianaFixChat.kt @@ -1,7 +1,9 @@ package at.hannibal2.skyhanni.features.event.diana import at.hannibal2.skyhanni.SkyHanniMod +import at.hannibal2.skyhanni.api.event.HandleEvent import at.hannibal2.skyhanni.data.ClickType +import at.hannibal2.skyhanni.data.IslandType import at.hannibal2.skyhanni.events.BurrowGuessEvent import at.hannibal2.skyhanni.events.ItemClickEvent import at.hannibal2.skyhanni.events.LorenzWorldChangeEvent @@ -102,7 +104,7 @@ object DianaFixChat { } } - @SubscribeEvent + @HandleEvent(onlyOnIsland = IslandType.HUB) fun onItemClick(event: ItemClickEvent) { if (!isEnabled()) return if (event.clickType != ClickType.RIGHT_CLICK) return diff --git a/src/main/java/at/hannibal2/skyhanni/features/event/diana/GriffinBurrowHelper.kt b/src/main/java/at/hannibal2/skyhanni/features/event/diana/GriffinBurrowHelper.kt index 57cc77df5..64b33c934 100644 --- a/src/main/java/at/hannibal2/skyhanni/features/event/diana/GriffinBurrowHelper.kt +++ b/src/main/java/at/hannibal2/skyhanni/features/event/diana/GriffinBurrowHelper.kt @@ -1,6 +1,7 @@ package at.hannibal2.skyhanni.features.event.diana import at.hannibal2.skyhanni.SkyHanniMod +import at.hannibal2.skyhanni.api.event.HandleEvent import at.hannibal2.skyhanni.config.ConfigUpdaterMigrator import at.hannibal2.skyhanni.data.EntityMovementData import at.hannibal2.skyhanni.data.IslandType @@ -358,7 +359,7 @@ object GriffinBurrowHelper { event.move(2, "diana", "event.diana") } - @SubscribeEvent + @HandleEvent(onlyOnIsland = IslandType.HUB) fun onBlockClick(event: BlockClickEvent) { if (!isEnabled()) return diff --git a/src/main/java/at/hannibal2/skyhanni/features/event/diana/GriffinBurrowParticleFinder.kt b/src/main/java/at/hannibal2/skyhanni/features/event/diana/GriffinBurrowParticleFinder.kt index 80d6ea0e0..f3860276a 100644 --- a/src/main/java/at/hannibal2/skyhanni/features/event/diana/GriffinBurrowParticleFinder.kt +++ b/src/main/java/at/hannibal2/skyhanni/features/event/diana/GriffinBurrowParticleFinder.kt @@ -165,7 +165,7 @@ object GriffinBurrowParticleFinder { return true } - @SubscribeEvent + @HandleEvent(onlyOnIsland = IslandType.HUB) fun onBlockClick(event: BlockClickEvent) { if (!isEnabled()) return if (!config.burrowsSoopyGuess) return diff --git a/src/main/java/at/hannibal2/skyhanni/features/event/hoppity/HoppityEggLocator.kt b/src/main/java/at/hannibal2/skyhanni/features/event/hoppity/HoppityEggLocator.kt index bef61bfbf..92dbd9dcb 100644 --- a/src/main/java/at/hannibal2/skyhanni/features/event/hoppity/HoppityEggLocator.kt +++ b/src/main/java/at/hannibal2/skyhanni/features/event/hoppity/HoppityEggLocator.kt @@ -208,7 +208,7 @@ object HoppityEggLocator { lastParticlePosition = null } - @SubscribeEvent + @HandleEvent(onlyOnSkyblock = true) fun onItemClick(event: ItemClickEvent) { if (!isEnabled()) return val item = event.itemInHand ?: return |