diff --git a/src/main/java/at/hannibal2/skyhanni/api/CollectionAPI.kt b/src/main/java/at/hannibal2/skyhanni/api/CollectionAPI.kt index b67b26faa83a..ac4b411df1f5 100644 --- a/src/main/java/at/hannibal2/skyhanni/api/CollectionAPI.kt +++ b/src/main/java/at/hannibal2/skyhanni/api/CollectionAPI.kt @@ -1,5 +1,6 @@ package at.hannibal2.skyhanni.api +import at.hannibal2.skyhanni.api.event.HandleEvent import at.hannibal2.skyhanni.data.ItemAddManager import at.hannibal2.skyhanni.events.CollectionUpdateEvent import at.hannibal2.skyhanni.events.InventoryFullyOpenedEvent @@ -99,7 +100,7 @@ object CollectionAPI { } } - @SubscribeEvent + @HandleEvent fun onItemAdd(event: ItemAddEvent) { if (event.source == ItemAddManager.Source.COMMAND) return val internalName = event.internalName diff --git a/src/main/java/at/hannibal2/skyhanni/api/SkillAPI.kt b/src/main/java/at/hannibal2/skyhanni/api/SkillAPI.kt index 907619b363b1..4c7d1ad89d97 100644 --- a/src/main/java/at/hannibal2/skyhanni/api/SkillAPI.kt +++ b/src/main/java/at/hannibal2/skyhanni/api/SkillAPI.kt @@ -1,5 +1,6 @@ package at.hannibal2.skyhanni.api +import at.hannibal2.skyhanni.api.event.HandleEvent import at.hannibal2.skyhanni.data.ProfileStorageData import at.hannibal2.skyhanni.data.jsonobjects.repo.neu.NeuSkillLevelJson import at.hannibal2.skyhanni.events.ActionBarUpdateEvent @@ -104,7 +105,7 @@ object SkillAPI { } } - @SubscribeEvent + @HandleEvent fun onActionBarUpdate(event: ActionBarUpdateEvent) { val actionBar = event.actionBar.removeColor() val components = SPACE_SPLITTER.splitToList(actionBar) diff --git a/src/main/java/at/hannibal2/skyhanni/api/event/SkyHanniEvent.kt b/src/main/java/at/hannibal2/skyhanni/api/event/SkyHanniEvent.kt index c05b438cde20..d0de65300b10 100644 --- a/src/main/java/at/hannibal2/skyhanni/api/event/SkyHanniEvent.kt +++ b/src/main/java/at/hannibal2/skyhanni/api/event/SkyHanniEvent.kt @@ -5,6 +5,7 @@ package at.hannibal2.skyhanni.api.event */ abstract class SkyHanniEvent protected constructor() { + // TODO: This should only be accessible in the cancellable interface var isCancelled: Boolean = false private set diff --git a/src/main/java/at/hannibal2/skyhanni/data/ActionBarData.kt b/src/main/java/at/hannibal2/skyhanni/data/ActionBarData.kt index 2aef3fa791ec..2aacf4d2bdea 100644 --- a/src/main/java/at/hannibal2/skyhanni/data/ActionBarData.kt +++ b/src/main/java/at/hannibal2/skyhanni/data/ActionBarData.kt @@ -30,7 +30,7 @@ object ActionBarData { val message = original.formattedText.stripHypixelMessage() actionBar = message val actionBarEvent = ActionBarUpdateEvent(actionBar, event.message) - actionBarEvent.postAndCatch() + actionBarEvent.post() if (event.message.formattedText != actionBarEvent.chatComponent.formattedText) { event.message = actionBarEvent.chatComponent } diff --git a/src/main/java/at/hannibal2/skyhanni/data/ActionBarStatsData.kt b/src/main/java/at/hannibal2/skyhanni/data/ActionBarStatsData.kt index b2145db767c5..dd2417420088 100644 --- a/src/main/java/at/hannibal2/skyhanni/data/ActionBarStatsData.kt +++ b/src/main/java/at/hannibal2/skyhanni/data/ActionBarStatsData.kt @@ -1,12 +1,12 @@ package at.hannibal2.skyhanni.data +import at.hannibal2.skyhanni.api.event.HandleEvent import at.hannibal2.skyhanni.events.ActionBarUpdateEvent import at.hannibal2.skyhanni.events.ActionBarValueUpdateEvent import at.hannibal2.skyhanni.skyhannimodule.SkyHanniModule import at.hannibal2.skyhanni.utils.LorenzUtils import at.hannibal2.skyhanni.utils.RegexUtils.matchMatcher import at.hannibal2.skyhanni.utils.repopatterns.RepoPattern -import net.minecraftforge.fml.common.eventhandler.SubscribeEvent import org.intellij.lang.annotations.Language enum class ActionBarStatsData(@Language("RegExp") rawPattern: String) { @@ -45,7 +45,7 @@ enum class ActionBarStatsData(@Language("RegExp") rawPattern: String) { entries.forEach { it.pattern } } - @SubscribeEvent + @HandleEvent fun onActionBarUpdate(event: ActionBarUpdateEvent) { if (!LorenzUtils.inSkyBlock) return @@ -57,7 +57,7 @@ enum class ActionBarStatsData(@Language("RegExp") rawPattern: String) { ActionBarValueUpdateEvent(data) } else null } - }.forEach { it.postAndCatch() } + }.forEach { it.post() } } } } diff --git a/src/main/java/at/hannibal2/skyhanni/data/BitsAPI.kt b/src/main/java/at/hannibal2/skyhanni/data/BitsAPI.kt index bb5a51407842..a2646d6925dc 100644 --- a/src/main/java/at/hannibal2/skyhanni/data/BitsAPI.kt +++ b/src/main/java/at/hannibal2/skyhanni/data/BitsAPI.kt @@ -383,10 +383,10 @@ object BitsAPI { fun hasCookieBuff() = cookieBuffTime?.isInFuture() ?: false private fun sendBitsGainEvent(difference: Int) = - BitsUpdateEvent.BitsGain(bits, bitsAvailable, difference).postAndCatch() + BitsUpdateEvent.BitsGain(bits, bitsAvailable, difference).post() - private fun sendBitsSpentEvent() = BitsUpdateEvent.BitsSpent(bits, bitsAvailable).postAndCatch() - private fun sendBitsAvailableGainedEvent() = BitsUpdateEvent.BitsAvailableGained(bits, bitsAvailable).postAndCatch() + private fun sendBitsSpentEvent() = BitsUpdateEvent.BitsSpent(bits, bitsAvailable).post() + private fun sendBitsAvailableGainedEvent() = BitsUpdateEvent.BitsAvailableGained(bits, bitsAvailable).post() fun isEnabled() = LorenzUtils.inSkyBlock && !LorenzUtils.isOnAlphaServer && profileStorage != null diff --git a/src/main/java/at/hannibal2/skyhanni/data/BossbarData.kt b/src/main/java/at/hannibal2/skyhanni/data/BossbarData.kt index 1e234f5a6207..288c3cf50932 100644 --- a/src/main/java/at/hannibal2/skyhanni/data/BossbarData.kt +++ b/src/main/java/at/hannibal2/skyhanni/data/BossbarData.kt @@ -39,6 +39,6 @@ object BossbarData { if (previousServerBossbar.isNotEmpty()) previousServerBossbar = "" bossbar = bossbarLine - BossbarUpdateEvent(bossbarLine).postAndCatch() + BossbarUpdateEvent(bossbarLine).post() } } diff --git a/src/main/java/at/hannibal2/skyhanni/data/EntityData.kt b/src/main/java/at/hannibal2/skyhanni/data/EntityData.kt index 0f6fc666fae5..31904ec8bd33 100644 --- a/src/main/java/at/hannibal2/skyhanni/data/EntityData.kt +++ b/src/main/java/at/hannibal2/skyhanni/data/EntityData.kt @@ -52,7 +52,7 @@ object EntityData { val oldMaxHealth = maxHealthMap.getOrDefault(id, -1) if (oldMaxHealth != maxHealth) { maxHealthMap[id] = maxHealth - EntityMaxHealthUpdateEvent(entity, maxHealth.derpy()).postAndCatch() + EntityMaxHealthUpdateEvent(entity, maxHealth.derpy()).post() } } } @@ -83,7 +83,7 @@ object EntityData { val health = (it.`object` as Float).toInt() if (entity is EntityWither && health == 300 && entityId < 0) return if (entity is EntityLivingBase) { - EntityHealthUpdateEvent(entity, health.derpy()).postAndCatch() + EntityHealthUpdateEvent(entity, health.derpy()).post() } } } @@ -107,7 +107,7 @@ object EntityData { @JvmStatic fun getHealthDisplay(text: String) = healthDisplayCache.getOrPut(text) { val event = EntityHealthDisplayEvent(text) - event.postAndCatch() + event.post() event.text } diff --git a/src/main/java/at/hannibal2/skyhanni/data/FriendAPI.kt b/src/main/java/at/hannibal2/skyhanni/data/FriendAPI.kt index 79c182d3b874..269b1312757c 100644 --- a/src/main/java/at/hannibal2/skyhanni/data/FriendAPI.kt +++ b/src/main/java/at/hannibal2/skyhanni/data/FriendAPI.kt @@ -1,6 +1,7 @@ package at.hannibal2.skyhanni.data import at.hannibal2.skyhanni.SkyHanniMod +import at.hannibal2.skyhanni.api.event.HandleEvent import at.hannibal2.skyhanni.config.ConfigFileType import at.hannibal2.skyhanni.data.jsonobjects.local.FriendsJson import at.hannibal2.skyhanni.data.jsonobjects.local.FriendsJson.PlayerFriends.Friend @@ -74,7 +75,7 @@ object FriendAPI { FriendsJson.PlayerFriends().also { it.friends = mutableMapOf() } }.friends - @SubscribeEvent + @HandleEvent fun onHypixelJoin(event: HypixelJoinEvent) { if (SkyHanniMod.friendsData.players == null) { SkyHanniMod.friendsData.players = mutableMapOf() diff --git a/src/main/java/at/hannibal2/skyhanni/data/GuiEditManager.kt b/src/main/java/at/hannibal2/skyhanni/data/GuiEditManager.kt index df0dd897f14a..0826813f1da8 100644 --- a/src/main/java/at/hannibal2/skyhanni/data/GuiEditManager.kt +++ b/src/main/java/at/hannibal2/skyhanni/data/GuiEditManager.kt @@ -73,7 +73,7 @@ object GuiEditManager { @SubscribeEvent fun onTick(event: LorenzTickEvent) { lastMovedGui?.let { - GuiPositionMovedEvent(it).postAndCatch() + GuiPositionMovedEvent(it).post() lastMovedGui = null } } diff --git a/src/main/java/at/hannibal2/skyhanni/data/HypixelData.kt b/src/main/java/at/hannibal2/skyhanni/data/HypixelData.kt index 71e478d0609e..b243fe9be355 100644 --- a/src/main/java/at/hannibal2/skyhanni/data/HypixelData.kt +++ b/src/main/java/at/hannibal2/skyhanni/data/HypixelData.kt @@ -419,7 +419,7 @@ object HypixelData { if (!LorenzUtils.onHypixel) { checkHypixel() if (LorenzUtils.onHypixel) { - HypixelJoinEvent().postAndCatch() + HypixelJoinEvent.post() SkyHanniMod.repo.displayRepoStatus(true) } } diff --git a/src/main/java/at/hannibal2/skyhanni/data/ItemAddManager.kt b/src/main/java/at/hannibal2/skyhanni/data/ItemAddManager.kt index fd300d9e2944..f35f024a14bf 100644 --- a/src/main/java/at/hannibal2/skyhanni/data/ItemAddManager.kt +++ b/src/main/java/at/hannibal2/skyhanni/data/ItemAddManager.kt @@ -1,5 +1,6 @@ package at.hannibal2.skyhanni.data +import at.hannibal2.skyhanni.api.event.HandleEvent import at.hannibal2.skyhanni.events.InventoryCloseEvent import at.hannibal2.skyhanni.events.InventoryOpenEvent import at.hannibal2.skyhanni.events.ItemAddEvent @@ -54,7 +55,7 @@ object ItemAddManager { } } - @SubscribeEvent + @HandleEvent fun onSackChange(event: SackChangeEvent) { if (!LorenzUtils.inSkyBlock) return @@ -70,7 +71,7 @@ object ItemAddManager { superCraftedItems.clear() } - @SubscribeEvent + @HandleEvent fun onItemAdd(event: ItemAddInInventoryEvent) { if (!LorenzUtils.inSkyBlock) return @@ -85,7 +86,7 @@ object ItemAddManager { } private fun Source.addItem(internalName: NEUInternalName, amount: Int) { - ItemAddEvent(internalName, amount, this).postAndCatch() + ItemAddEvent(internalName, amount, this).post() } private var lastDiceRoll = SimpleTimeMark.farPast() diff --git a/src/main/java/at/hannibal2/skyhanni/data/ItemTipHelper.kt b/src/main/java/at/hannibal2/skyhanni/data/ItemTipHelper.kt index fbbd78e138ba..ce49b0add140 100644 --- a/src/main/java/at/hannibal2/skyhanni/data/ItemTipHelper.kt +++ b/src/main/java/at/hannibal2/skyhanni/data/ItemTipHelper.kt @@ -1,5 +1,6 @@ package at.hannibal2.skyhanni.data +import at.hannibal2.skyhanni.api.event.HandleEvent import at.hannibal2.skyhanni.events.DrawScreenAfterEvent import at.hannibal2.skyhanni.events.GuiRenderItemEvent import at.hannibal2.skyhanni.events.RenderInventoryItemTipEvent @@ -14,13 +15,11 @@ import net.minecraft.client.Minecraft import net.minecraft.client.gui.inventory.GuiChest import net.minecraft.client.renderer.GlStateManager import net.minecraft.inventory.ContainerChest -import net.minecraftforge.fml.common.eventhandler.EventPriority -import net.minecraftforge.fml.common.eventhandler.SubscribeEvent @SkyHanniModule object ItemTipHelper { - @SubscribeEvent + @HandleEvent fun onRenderItemOverlayPost(event: GuiRenderItemEvent.RenderOverlayEvent.GuiRenderItemPost) { val stack = event.stack ?: return if (!LorenzUtils.inSkyBlock || stack.stackSize != 1) return @@ -39,7 +38,7 @@ object ItemTipHelper { } } - @SubscribeEvent(priority = EventPriority.HIGHEST) + @HandleEvent(priority = HandleEvent.HIGHEST) fun onRenderInventoryItemOverlayPost(event: DrawScreenAfterEvent) { if (!LorenzUtils.inSkyBlock) return if (!SkyHanniDebugsAndTests.globalRender) return diff --git a/src/main/java/at/hannibal2/skyhanni/data/MinecraftData.kt b/src/main/java/at/hannibal2/skyhanni/data/MinecraftData.kt index 02768fc3d4bf..8ad581e73937 100644 --- a/src/main/java/at/hannibal2/skyhanni/data/MinecraftData.kt +++ b/src/main/java/at/hannibal2/skyhanni/data/MinecraftData.kt @@ -90,7 +90,7 @@ object MinecraftData { } InventoryUtils.itemInHandId = newItem InventoryUtils.latestItemInHand = hand - ItemInHandChangeEvent(newItem, oldItem).postAndCatch() + ItemInHandChangeEvent(newItem, oldItem).post() } } diff --git a/src/main/java/at/hannibal2/skyhanni/data/MiningAPI.kt b/src/main/java/at/hannibal2/skyhanni/data/MiningAPI.kt index 8b0790c07e8f..575c2af4040e 100644 --- a/src/main/java/at/hannibal2/skyhanni/data/MiningAPI.kt +++ b/src/main/java/at/hannibal2/skyhanni/data/MiningAPI.kt @@ -248,7 +248,7 @@ object MiningAPI { } - @SubscribeEvent + @HandleEvent fun onPlayerDeath(event: PlayerDeathEvent) { if (event.name == LorenzUtils.getPlayerName()) { updateCold(0) @@ -477,7 +477,7 @@ object MiningAPI { // Hypixel sends cold data once in scoreboard even after resetting it if (cold == 0 && lastColdUpdate.passedSince() < 1.seconds) return lastColdUpdate = SimpleTimeMark.now() - ColdUpdateEvent(newCold).postAndCatch() + ColdUpdateEvent(newCold).post() cold = newCold } diff --git a/src/main/java/at/hannibal2/skyhanni/data/OwnInventoryData.kt b/src/main/java/at/hannibal2/skyhanni/data/OwnInventoryData.kt index 3ef0b90cec42..f7bb5929b823 100644 --- a/src/main/java/at/hannibal2/skyhanni/data/OwnInventoryData.kt +++ b/src/main/java/at/hannibal2/skyhanni/data/OwnInventoryData.kt @@ -191,6 +191,6 @@ object OwnInventoryData { if (internalName.startsWith("MAP-")) return - ItemAddInInventoryEvent(internalName, add).postAndCatch() + ItemAddInInventoryEvent(internalName, add).post() } } diff --git a/src/main/java/at/hannibal2/skyhanni/data/PlayerDeathManager.kt b/src/main/java/at/hannibal2/skyhanni/data/PlayerDeathManager.kt index 75616520f8ff..5eb2954a6f5f 100644 --- a/src/main/java/at/hannibal2/skyhanni/data/PlayerDeathManager.kt +++ b/src/main/java/at/hannibal2/skyhanni/data/PlayerDeathManager.kt @@ -25,7 +25,7 @@ object PlayerDeathManager { deathMessagePattern.matchMatcher(message) { val name = group("name") val reason = group("reason").removeColor() - PlayerDeathEvent(name, reason, event).postAndCatch() + PlayerDeathEvent(name, reason, event).post() } } } diff --git a/src/main/java/at/hannibal2/skyhanni/data/ProfileStorageData.kt b/src/main/java/at/hannibal2/skyhanni/data/ProfileStorageData.kt index b6dc4b06375c..6db19ef80f41 100644 --- a/src/main/java/at/hannibal2/skyhanni/data/ProfileStorageData.kt +++ b/src/main/java/at/hannibal2/skyhanni/data/ProfileStorageData.kt @@ -1,6 +1,7 @@ package at.hannibal2.skyhanni.data import at.hannibal2.skyhanni.SkyHanniMod +import at.hannibal2.skyhanni.api.event.HandleEvent import at.hannibal2.skyhanni.config.SackData import at.hannibal2.skyhanni.config.storage.PlayerSpecificStorage import at.hannibal2.skyhanni.config.storage.ProfileSpecificStorage @@ -125,7 +126,7 @@ object ProfileStorageData { ConfigLoadEvent().postAndCatch() } - @SubscribeEvent + @HandleEvent fun onHypixelJoin(event: HypixelJoinEvent) { val playerUuid = LorenzUtils.getRawPlayerUuid() playerSpecific = SkyHanniMod.feature.storage.players.getOrPut(playerUuid) { PlayerSpecificStorage() } diff --git a/src/main/java/at/hannibal2/skyhanni/data/QuiverAPI.kt b/src/main/java/at/hannibal2/skyhanni/data/QuiverAPI.kt index 4aee4d02ae67..1833ad599d07 100644 --- a/src/main/java/at/hannibal2/skyhanni/data/QuiverAPI.kt +++ b/src/main/java/at/hannibal2/skyhanni/data/QuiverAPI.kt @@ -282,7 +282,7 @@ object QuiverAPI { } private fun postUpdateEvent(arrowType: ArrowType? = currentArrow) { - QuiverUpdateEvent(arrowType, currentAmount).postAndCatch() + QuiverUpdateEvent(arrowType, currentAmount).post() } @SubscribeEvent diff --git a/src/main/java/at/hannibal2/skyhanni/data/SackAPI.kt b/src/main/java/at/hannibal2/skyhanni/data/SackAPI.kt index ee3b5c7b9d72..e137cfb62a42 100644 --- a/src/main/java/at/hannibal2/skyhanni/data/SackAPI.kt +++ b/src/main/java/at/hannibal2/skyhanni/data/SackAPI.kt @@ -273,7 +273,7 @@ object SackAPI { } val sackEvent = SackChangeEvent(sackChanges, otherItemsAdded, otherItemsRemoved) updateSacks(sackEvent) - sackEvent.postAndCatch() + sackEvent.post() if (chatConfig.hideSacksChange) { event.blockedReason = "sacks_change" } diff --git a/src/main/java/at/hannibal2/skyhanni/data/SkillExperience.kt b/src/main/java/at/hannibal2/skyhanni/data/SkillExperience.kt index 367c3794e8d7..4e886e34d560 100644 --- a/src/main/java/at/hannibal2/skyhanni/data/SkillExperience.kt +++ b/src/main/java/at/hannibal2/skyhanni/data/SkillExperience.kt @@ -1,5 +1,6 @@ package at.hannibal2.skyhanni.data +import at.hannibal2.skyhanni.api.event.HandleEvent import at.hannibal2.skyhanni.events.ActionBarUpdateEvent import at.hannibal2.skyhanni.events.InventoryFullyOpenedEvent import at.hannibal2.skyhanni.events.ProfileJoinEvent @@ -31,7 +32,7 @@ object SkillExperience { skillExp.clear() } - @SubscribeEvent + @HandleEvent fun onActionBarUpdate(event: ActionBarUpdateEvent) { if (!LorenzUtils.inSkyBlock) return diff --git a/src/main/java/at/hannibal2/skyhanni/data/TrackerManager.kt b/src/main/java/at/hannibal2/skyhanni/data/TrackerManager.kt index c1a7a60c3f49..f2bce67b3617 100644 --- a/src/main/java/at/hannibal2/skyhanni/data/TrackerManager.kt +++ b/src/main/java/at/hannibal2/skyhanni/data/TrackerManager.kt @@ -62,7 +62,7 @@ object TrackerManager { } commandEditTrackerSuccess = false - ItemAddEvent(internalName, amount, ItemAddManager.Source.COMMAND).postAndCatch() + ItemAddEvent(internalName, amount, ItemAddManager.Source.COMMAND).post() if (!commandEditTrackerSuccess) { ChatUtils.userError("Could not edit the Item Tracker! Does this item belong to this tracker? Is the tracker active right now?") } diff --git a/src/main/java/at/hannibal2/skyhanni/data/mob/MobDetection.kt b/src/main/java/at/hannibal2/skyhanni/data/mob/MobDetection.kt index 712fa28ad917..65e8101cf05d 100644 --- a/src/main/java/at/hannibal2/skyhanni/data/mob/MobDetection.kt +++ b/src/main/java/at/hannibal2/skyhanni/data/mob/MobDetection.kt @@ -252,7 +252,7 @@ object MobDetection { } } - @SubscribeEvent + @HandleEvent fun onEntityHealthUpdateEvent(event: EntityHealthUpdateEvent) { when { event.entity is EntityBat && event.health == 6 -> { diff --git a/src/main/java/at/hannibal2/skyhanni/events/ActionBarUpdateEvent.kt b/src/main/java/at/hannibal2/skyhanni/events/ActionBarUpdateEvent.kt index 52ec909c0216..911910ec7f38 100644 --- a/src/main/java/at/hannibal2/skyhanni/events/ActionBarUpdateEvent.kt +++ b/src/main/java/at/hannibal2/skyhanni/events/ActionBarUpdateEvent.kt @@ -1,9 +1,10 @@ package at.hannibal2.skyhanni.events +import at.hannibal2.skyhanni.api.event.SkyHanniEvent import net.minecraft.util.ChatComponentText import net.minecraft.util.IChatComponent -class ActionBarUpdateEvent(var actionBar: String, var chatComponent: IChatComponent) : LorenzEvent() { +class ActionBarUpdateEvent(var actionBar: String, var chatComponent: IChatComponent) : SkyHanniEvent() { fun changeActionBar(newText: String) { chatComponent = ChatComponentText(newText) } diff --git a/src/main/java/at/hannibal2/skyhanni/events/ActionBarValueUpdateEvent.kt b/src/main/java/at/hannibal2/skyhanni/events/ActionBarValueUpdateEvent.kt index fa3d6a730392..9ed1342580fc 100644 --- a/src/main/java/at/hannibal2/skyhanni/events/ActionBarValueUpdateEvent.kt +++ b/src/main/java/at/hannibal2/skyhanni/events/ActionBarValueUpdateEvent.kt @@ -1,5 +1,6 @@ package at.hannibal2.skyhanni.events +import at.hannibal2.skyhanni.api.event.SkyHanniEvent import at.hannibal2.skyhanni.data.ActionBarStatsData -class ActionBarValueUpdateEvent(val updated: ActionBarStatsData) : LorenzEvent() +class ActionBarValueUpdateEvent(val updated: ActionBarStatsData) : SkyHanniEvent() diff --git a/src/main/java/at/hannibal2/skyhanni/events/BazaarOpenedProductEvent.kt b/src/main/java/at/hannibal2/skyhanni/events/BazaarOpenedProductEvent.kt index e4995564de97..ac4193841fb1 100644 --- a/src/main/java/at/hannibal2/skyhanni/events/BazaarOpenedProductEvent.kt +++ b/src/main/java/at/hannibal2/skyhanni/events/BazaarOpenedProductEvent.kt @@ -1,6 +1,6 @@ package at.hannibal2.skyhanni.events +import at.hannibal2.skyhanni.api.event.SkyHanniEvent import at.hannibal2.skyhanni.utils.NEUInternalName -class BazaarOpenedProductEvent(val openedProduct: NEUInternalName?, val inventoryOpenEvent: InventoryFullyOpenedEvent) : - LorenzEvent() +class BazaarOpenedProductEvent(val openedProduct: NEUInternalName?, val inventoryOpenEvent: InventoryFullyOpenedEvent) : SkyHanniEvent() diff --git a/src/main/java/at/hannibal2/skyhanni/events/BitsUpdateEvent.kt b/src/main/java/at/hannibal2/skyhanni/events/BitsUpdateEvent.kt index 78ff15baee49..08147206e499 100644 --- a/src/main/java/at/hannibal2/skyhanni/events/BitsUpdateEvent.kt +++ b/src/main/java/at/hannibal2/skyhanni/events/BitsUpdateEvent.kt @@ -1,6 +1,8 @@ package at.hannibal2.skyhanni.events -open class BitsUpdateEvent(val bits: Int, val bitsAvailable: Int, val difference: Int = 0) : LorenzEvent() { +import at.hannibal2.skyhanni.api.event.SkyHanniEvent + +open class BitsUpdateEvent(val bits: Int, val bitsAvailable: Int, val difference: Int = 0) : SkyHanniEvent() { class BitsGain(bits: Int, bitsAvailable: Int, difference: Int) : BitsUpdateEvent(bits, bitsAvailable, difference) class BitsSpent(bits: Int, bitsAvailable: Int) : BitsUpdateEvent(bits, bitsAvailable) class BitsAvailableGained(bits: Int, bitsAvailable: Int) : BitsUpdateEvent(bits, bitsAvailable) diff --git a/src/main/java/at/hannibal2/skyhanni/events/BossHealthChangeEvent.kt b/src/main/java/at/hannibal2/skyhanni/events/BossHealthChangeEvent.kt index 42a827123411..e2f7a60db609 100644 --- a/src/main/java/at/hannibal2/skyhanni/events/BossHealthChangeEvent.kt +++ b/src/main/java/at/hannibal2/skyhanni/events/BossHealthChangeEvent.kt @@ -1,5 +1,6 @@ package at.hannibal2.skyhanni.events +import at.hannibal2.skyhanni.api.event.SkyHanniEvent import at.hannibal2.skyhanni.features.combat.damageindicator.EntityData -class BossHealthChangeEvent(val entityData: EntityData, val lastHealth: Long, val health: Long, val maxHealth: Long) : LorenzEvent() +class BossHealthChangeEvent(val entityData: EntityData, val lastHealth: Long, val health: Long, val maxHealth: Long) : SkyHanniEvent() diff --git a/src/main/java/at/hannibal2/skyhanni/events/BossbarUpdateEvent.kt b/src/main/java/at/hannibal2/skyhanni/events/BossbarUpdateEvent.kt index 7dd0d10bbf31..84f8985edd46 100644 --- a/src/main/java/at/hannibal2/skyhanni/events/BossbarUpdateEvent.kt +++ b/src/main/java/at/hannibal2/skyhanni/events/BossbarUpdateEvent.kt @@ -1,3 +1,5 @@ package at.hannibal2.skyhanni.events -class BossbarUpdateEvent(val bossbar: String) : LorenzEvent() +import at.hannibal2.skyhanni.api.event.SkyHanniEvent + +class BossbarUpdateEvent(val bossbar: String) : SkyHanniEvent() diff --git a/src/main/java/at/hannibal2/skyhanni/events/BurrowDetectEvent.kt b/src/main/java/at/hannibal2/skyhanni/events/BurrowDetectEvent.kt index 26e13c42daa6..4ac1836da478 100644 --- a/src/main/java/at/hannibal2/skyhanni/events/BurrowDetectEvent.kt +++ b/src/main/java/at/hannibal2/skyhanni/events/BurrowDetectEvent.kt @@ -1,6 +1,7 @@ package at.hannibal2.skyhanni.events +import at.hannibal2.skyhanni.api.event.SkyHanniEvent import at.hannibal2.skyhanni.features.event.diana.BurrowType import at.hannibal2.skyhanni.utils.LorenzVec -class BurrowDetectEvent(val burrowLocation: LorenzVec, val type: BurrowType) : LorenzEvent() +class BurrowDetectEvent(val burrowLocation: LorenzVec, val type: BurrowType) : SkyHanniEvent() diff --git a/src/main/java/at/hannibal2/skyhanni/events/BurrowDugEvent.kt b/src/main/java/at/hannibal2/skyhanni/events/BurrowDugEvent.kt index 3f601fd2bb31..191b8ea0d2b9 100644 --- a/src/main/java/at/hannibal2/skyhanni/events/BurrowDugEvent.kt +++ b/src/main/java/at/hannibal2/skyhanni/events/BurrowDugEvent.kt @@ -1,5 +1,6 @@ package at.hannibal2.skyhanni.events +import at.hannibal2.skyhanni.api.event.SkyHanniEvent import at.hannibal2.skyhanni.utils.LorenzVec -class BurrowDugEvent(val burrowLocation: LorenzVec) : LorenzEvent() +class BurrowDugEvent(val burrowLocation: LorenzVec) : SkyHanniEvent() diff --git a/src/main/java/at/hannibal2/skyhanni/events/BurrowGuessEvent.kt b/src/main/java/at/hannibal2/skyhanni/events/BurrowGuessEvent.kt index 844e43eef3e5..3e6b8f8c164f 100644 --- a/src/main/java/at/hannibal2/skyhanni/events/BurrowGuessEvent.kt +++ b/src/main/java/at/hannibal2/skyhanni/events/BurrowGuessEvent.kt @@ -1,5 +1,6 @@ package at.hannibal2.skyhanni.events +import at.hannibal2.skyhanni.api.event.SkyHanniEvent import at.hannibal2.skyhanni.utils.LorenzVec -class BurrowGuessEvent(val guessLocation: LorenzVec) : LorenzEvent() +class BurrowGuessEvent(val guessLocation: LorenzVec) : SkyHanniEvent() diff --git a/src/main/java/at/hannibal2/skyhanni/events/ChatHoverEvent.kt b/src/main/java/at/hannibal2/skyhanni/events/ChatHoverEvent.kt index 097f175abb36..a8d4c12a9ff9 100644 --- a/src/main/java/at/hannibal2/skyhanni/events/ChatHoverEvent.kt +++ b/src/main/java/at/hannibal2/skyhanni/events/ChatHoverEvent.kt @@ -1,5 +1,6 @@ package at.hannibal2.skyhanni.events +import at.hannibal2.skyhanni.api.event.SkyHanniEvent import net.minecraft.event.HoverEvent import net.minecraft.util.ChatComponentText @@ -12,6 +13,6 @@ import net.minecraft.util.ChatComponentText * The edited chat component in [GuiChatHook][at.hannibal2.skyhanni.mixins.hooks.GuiChatHook] does not change the actual * chat component, but rather makes a new one just before rendering. */ -class ChatHoverEvent(val component: ChatComponentText) : LorenzEvent() { +class ChatHoverEvent(val component: ChatComponentText) : SkyHanniEvent() { fun getHoverEvent(): HoverEvent = component.chatStyle.chatHoverEvent!! } diff --git a/src/main/java/at/hannibal2/skyhanni/events/ColdUpdateEvent.kt b/src/main/java/at/hannibal2/skyhanni/events/ColdUpdateEvent.kt index 9894943b795d..1e654c021249 100644 --- a/src/main/java/at/hannibal2/skyhanni/events/ColdUpdateEvent.kt +++ b/src/main/java/at/hannibal2/skyhanni/events/ColdUpdateEvent.kt @@ -1,3 +1,5 @@ package at.hannibal2.skyhanni.events -class ColdUpdateEvent(val cold: Int) : LorenzEvent() +import at.hannibal2.skyhanni.api.event.SkyHanniEvent + +class ColdUpdateEvent(val cold: Int) : SkyHanniEvent() diff --git a/src/main/java/at/hannibal2/skyhanni/events/CropClickEvent.kt b/src/main/java/at/hannibal2/skyhanni/events/CropClickEvent.kt index 960724a1701e..78e87eb5b41c 100644 --- a/src/main/java/at/hannibal2/skyhanni/events/CropClickEvent.kt +++ b/src/main/java/at/hannibal2/skyhanni/events/CropClickEvent.kt @@ -1,5 +1,6 @@ package at.hannibal2.skyhanni.events +import at.hannibal2.skyhanni.api.event.SkyHanniEvent import at.hannibal2.skyhanni.data.ClickType import at.hannibal2.skyhanni.features.garden.CropType import at.hannibal2.skyhanni.utils.LorenzVec @@ -12,4 +13,4 @@ class CropClickEvent( val blockState: IBlockState, val clickType: ClickType, val itemInHand: ItemStack?, -) : LorenzEvent() +) : SkyHanniEvent() diff --git a/src/main/java/at/hannibal2/skyhanni/events/DamageIndicatorDeathEvent.kt b/src/main/java/at/hannibal2/skyhanni/events/DamageIndicatorDeathEvent.kt index 95b08ec51926..62c663c36342 100644 --- a/src/main/java/at/hannibal2/skyhanni/events/DamageIndicatorDeathEvent.kt +++ b/src/main/java/at/hannibal2/skyhanni/events/DamageIndicatorDeathEvent.kt @@ -1,7 +1,8 @@ package at.hannibal2.skyhanni.events +import at.hannibal2.skyhanni.api.event.SkyHanniEvent import at.hannibal2.skyhanni.features.combat.damageindicator.EntityData import net.minecraft.entity.EntityLivingBase -class DamageIndicatorDeathEvent(val entity: EntityLivingBase, val data: EntityData) : LorenzEvent() +class DamageIndicatorDeathEvent(val entity: EntityLivingBase, val data: EntityData) : SkyHanniEvent() diff --git a/src/main/java/at/hannibal2/skyhanni/events/DamageIndicatorDetectedEvent.kt b/src/main/java/at/hannibal2/skyhanni/events/DamageIndicatorDetectedEvent.kt index 2ca276e4c884..731199c3df5c 100644 --- a/src/main/java/at/hannibal2/skyhanni/events/DamageIndicatorDetectedEvent.kt +++ b/src/main/java/at/hannibal2/skyhanni/events/DamageIndicatorDetectedEvent.kt @@ -1,5 +1,6 @@ package at.hannibal2.skyhanni.events +import at.hannibal2.skyhanni.api.event.SkyHanniEvent import at.hannibal2.skyhanni.features.combat.damageindicator.EntityData -class DamageIndicatorDetectedEvent(val entityData: EntityData) : LorenzEvent() +class DamageIndicatorDetectedEvent(val entityData: EntityData) : SkyHanniEvent() diff --git a/src/main/java/at/hannibal2/skyhanni/events/DamageIndicatorFinalBossEvent.kt b/src/main/java/at/hannibal2/skyhanni/events/DamageIndicatorFinalBossEvent.kt index 0d2564005091..6938ab9b527d 100644 --- a/src/main/java/at/hannibal2/skyhanni/events/DamageIndicatorFinalBossEvent.kt +++ b/src/main/java/at/hannibal2/skyhanni/events/DamageIndicatorFinalBossEvent.kt @@ -1,3 +1,5 @@ package at.hannibal2.skyhanni.events -class DamageIndicatorFinalBossEvent(val id: Int) : LorenzEvent() +import at.hannibal2.skyhanni.api.event.SkyHanniEvent + +class DamageIndicatorFinalBossEvent(val id: Int) : SkyHanniEvent() diff --git a/src/main/java/at/hannibal2/skyhanni/events/DrawScreenAfterEvent.kt b/src/main/java/at/hannibal2/skyhanni/events/DrawScreenAfterEvent.kt index 822b80419983..8ef9dc54a43b 100644 --- a/src/main/java/at/hannibal2/skyhanni/events/DrawScreenAfterEvent.kt +++ b/src/main/java/at/hannibal2/skyhanni/events/DrawScreenAfterEvent.kt @@ -1,5 +1,6 @@ package at.hannibal2.skyhanni.events +import at.hannibal2.skyhanni.api.event.SkyHanniEvent import org.spongepowered.asm.mixin.injection.callback.CallbackInfo -class DrawScreenAfterEvent(val mouseX: Int, val mouseY: Int, val ci: CallbackInfo) : LorenzEvent() +class DrawScreenAfterEvent(val mouseX: Int, val mouseY: Int, val ci: CallbackInfo) : SkyHanniEvent() diff --git a/src/main/java/at/hannibal2/skyhanni/events/DungeonCompleteEvent.kt b/src/main/java/at/hannibal2/skyhanni/events/DungeonCompleteEvent.kt index d278753cb9ba..67e1e6c5fff5 100644 --- a/src/main/java/at/hannibal2/skyhanni/events/DungeonCompleteEvent.kt +++ b/src/main/java/at/hannibal2/skyhanni/events/DungeonCompleteEvent.kt @@ -1,3 +1,5 @@ package at.hannibal2.skyhanni.events -class DungeonCompleteEvent(val floor: String) : LorenzEvent() +import at.hannibal2.skyhanni.api.event.SkyHanniEvent + +class DungeonCompleteEvent(val floor: String) : SkyHanniEvent() diff --git a/src/main/java/at/hannibal2/skyhanni/events/DungeonEnterEvent.kt b/src/main/java/at/hannibal2/skyhanni/events/DungeonEnterEvent.kt index 1703b8a00e9a..e399104a9ff4 100644 --- a/src/main/java/at/hannibal2/skyhanni/events/DungeonEnterEvent.kt +++ b/src/main/java/at/hannibal2/skyhanni/events/DungeonEnterEvent.kt @@ -1,4 +1,5 @@ package at.hannibal2.skyhanni.events -@Suppress("UnusedPrivateProperty") -class DungeonEnterEvent(dungeonFloor: String) : LorenzEvent() +import at.hannibal2.skyhanni.api.event.SkyHanniEvent + +class DungeonEnterEvent(val dungeonFloor: String) : SkyHanniEvent() diff --git a/src/main/java/at/hannibal2/skyhanni/events/DungeonStartEvent.kt b/src/main/java/at/hannibal2/skyhanni/events/DungeonStartEvent.kt index bb3cb36c3d45..eecb566f7f46 100644 --- a/src/main/java/at/hannibal2/skyhanni/events/DungeonStartEvent.kt +++ b/src/main/java/at/hannibal2/skyhanni/events/DungeonStartEvent.kt @@ -1,4 +1,6 @@ package at.hannibal2.skyhanni.events +import at.hannibal2.skyhanni.api.event.SkyHanniEvent + @Suppress("UnusedPrivateProperty") -class DungeonStartEvent(dungeonFloor: String) : LorenzEvent() +class DungeonStartEvent(dungeonFloor: String) : SkyHanniEvent() diff --git a/src/main/java/at/hannibal2/skyhanni/events/EntityHealthUpdateEvent.kt b/src/main/java/at/hannibal2/skyhanni/events/EntityHealthUpdateEvent.kt index 162efd9caa59..014259ce4fb8 100644 --- a/src/main/java/at/hannibal2/skyhanni/events/EntityHealthUpdateEvent.kt +++ b/src/main/java/at/hannibal2/skyhanni/events/EntityHealthUpdateEvent.kt @@ -1,5 +1,6 @@ package at.hannibal2.skyhanni.events +import at.hannibal2.skyhanni.api.event.SkyHanniEvent import net.minecraft.entity.EntityLivingBase -class EntityHealthUpdateEvent(val entity: EntityLivingBase, val health: Int) : LorenzEvent() +class EntityHealthUpdateEvent(val entity: EntityLivingBase, val health: Int) : SkyHanniEvent() diff --git a/src/main/java/at/hannibal2/skyhanni/events/EntityMaxHealthUpdateEvent.kt b/src/main/java/at/hannibal2/skyhanni/events/EntityMaxHealthUpdateEvent.kt index 943a11cc3720..e19458c2b34e 100644 --- a/src/main/java/at/hannibal2/skyhanni/events/EntityMaxHealthUpdateEvent.kt +++ b/src/main/java/at/hannibal2/skyhanni/events/EntityMaxHealthUpdateEvent.kt @@ -1,5 +1,6 @@ package at.hannibal2.skyhanni.events +import at.hannibal2.skyhanni.api.event.SkyHanniEvent import net.minecraft.entity.EntityLivingBase -class EntityMaxHealthUpdateEvent(val entity: EntityLivingBase, val maxHealth: Int) : LorenzEvent() +class EntityMaxHealthUpdateEvent(val entity: EntityLivingBase, val maxHealth: Int) : SkyHanniEvent() diff --git a/src/main/java/at/hannibal2/skyhanni/events/FarmingContestEvent.kt b/src/main/java/at/hannibal2/skyhanni/events/FarmingContestEvent.kt index 5a4a83c1f829..ccb00a84efa4 100644 --- a/src/main/java/at/hannibal2/skyhanni/events/FarmingContestEvent.kt +++ b/src/main/java/at/hannibal2/skyhanni/events/FarmingContestEvent.kt @@ -1,6 +1,7 @@ package at.hannibal2.skyhanni.events +import at.hannibal2.skyhanni.api.event.SkyHanniEvent import at.hannibal2.skyhanni.features.garden.CropType import at.hannibal2.skyhanni.features.garden.contest.FarmingContestPhase -class FarmingContestEvent(val crop: CropType, val phase: FarmingContestPhase) : LorenzEvent() +class FarmingContestEvent(val crop: CropType, val phase: FarmingContestPhase) : SkyHanniEvent() diff --git a/src/main/java/at/hannibal2/skyhanni/events/FishingBobberCastEvent.kt b/src/main/java/at/hannibal2/skyhanni/events/FishingBobberCastEvent.kt index 01ea0222e82b..ee9b1daa9522 100644 --- a/src/main/java/at/hannibal2/skyhanni/events/FishingBobberCastEvent.kt +++ b/src/main/java/at/hannibal2/skyhanni/events/FishingBobberCastEvent.kt @@ -1,5 +1,6 @@ package at.hannibal2.skyhanni.events +import at.hannibal2.skyhanni.api.event.SkyHanniEvent import net.minecraft.entity.projectile.EntityFishHook -class FishingBobberCastEvent(val bobber: EntityFishHook) : LorenzEvent() +class FishingBobberCastEvent(val bobber: EntityFishHook) : SkyHanniEvent() diff --git a/src/main/java/at/hannibal2/skyhanni/events/FishingBobberInLiquidEvent.kt b/src/main/java/at/hannibal2/skyhanni/events/FishingBobberInLiquidEvent.kt index a2cf6d2709c7..2e5c317795be 100644 --- a/src/main/java/at/hannibal2/skyhanni/events/FishingBobberInLiquidEvent.kt +++ b/src/main/java/at/hannibal2/skyhanni/events/FishingBobberInLiquidEvent.kt @@ -1,5 +1,6 @@ package at.hannibal2.skyhanni.events +import at.hannibal2.skyhanni.api.event.SkyHanniEvent import net.minecraft.entity.projectile.EntityFishHook -class FishingBobberInLiquidEvent(val bobber: EntityFishHook, val onWater: Boolean) : LorenzEvent() +class FishingBobberInLiquidEvent(val bobber: EntityFishHook, val onWater: Boolean) : SkyHanniEvent() diff --git a/src/main/java/at/hannibal2/skyhanni/events/GardenToolChangeEvent.kt b/src/main/java/at/hannibal2/skyhanni/events/GardenToolChangeEvent.kt index 2ad07aad8975..64aa2f48a6e9 100644 --- a/src/main/java/at/hannibal2/skyhanni/events/GardenToolChangeEvent.kt +++ b/src/main/java/at/hannibal2/skyhanni/events/GardenToolChangeEvent.kt @@ -1,6 +1,7 @@ package at.hannibal2.skyhanni.events +import at.hannibal2.skyhanni.api.event.SkyHanniEvent import at.hannibal2.skyhanni.features.garden.CropType import net.minecraft.item.ItemStack -class GardenToolChangeEvent(val crop: CropType?, val toolItem: ItemStack?) : LorenzEvent() +class GardenToolChangeEvent(val crop: CropType?, val toolItem: ItemStack?) : SkyHanniEvent() diff --git a/src/main/java/at/hannibal2/skyhanni/events/GuiKeyPressEvent.kt b/src/main/java/at/hannibal2/skyhanni/events/GuiKeyPressEvent.kt index 4cfd1dfd913c..8601e9189d1a 100644 --- a/src/main/java/at/hannibal2/skyhanni/events/GuiKeyPressEvent.kt +++ b/src/main/java/at/hannibal2/skyhanni/events/GuiKeyPressEvent.kt @@ -1,7 +1,6 @@ package at.hannibal2.skyhanni.events +import at.hannibal2.skyhanni.api.event.CancellableSkyHanniEvent import net.minecraft.client.gui.inventory.GuiContainer -import net.minecraftforge.fml.common.eventhandler.Cancelable -@Cancelable -class GuiKeyPressEvent(val guiContainer: GuiContainer) : LorenzEvent() +class GuiKeyPressEvent(val guiContainer: GuiContainer) : CancellableSkyHanniEvent() diff --git a/src/main/java/at/hannibal2/skyhanni/events/GuiPositionMovedEvent.kt b/src/main/java/at/hannibal2/skyhanni/events/GuiPositionMovedEvent.kt index 3d8fe02f991a..6c2c7e509449 100644 --- a/src/main/java/at/hannibal2/skyhanni/events/GuiPositionMovedEvent.kt +++ b/src/main/java/at/hannibal2/skyhanni/events/GuiPositionMovedEvent.kt @@ -1,3 +1,5 @@ package at.hannibal2.skyhanni.events -class GuiPositionMovedEvent(val guiName: String) : LorenzEvent() +import at.hannibal2.skyhanni.api.event.SkyHanniEvent + +class GuiPositionMovedEvent(val guiName: String) : SkyHanniEvent() diff --git a/src/main/java/at/hannibal2/skyhanni/events/GuiRenderItemEvent.kt b/src/main/java/at/hannibal2/skyhanni/events/GuiRenderItemEvent.kt index 58dc557e856a..6766e1f396b3 100644 --- a/src/main/java/at/hannibal2/skyhanni/events/GuiRenderItemEvent.kt +++ b/src/main/java/at/hannibal2/skyhanni/events/GuiRenderItemEvent.kt @@ -1,9 +1,10 @@ package at.hannibal2.skyhanni.events +import at.hannibal2.skyhanni.api.event.SkyHanniEvent import net.minecraft.client.gui.FontRenderer import net.minecraft.item.ItemStack -abstract class GuiRenderItemEvent : LorenzEvent() { +abstract class GuiRenderItemEvent : SkyHanniEvent() { abstract class RenderOverlayEvent( open val fontRenderer: FontRenderer, open val stack: ItemStack?, @@ -18,7 +19,6 @@ abstract class GuiRenderItemEvent : LorenzEvent() { override val x: Int, override val y: Int, override val text: String?, - ) : - RenderOverlayEvent(fontRenderer, stack, x, y, text) + ) : RenderOverlayEvent(fontRenderer, stack, x, y, text) } } diff --git a/src/main/java/at/hannibal2/skyhanni/events/HypixelJoinEvent.kt b/src/main/java/at/hannibal2/skyhanni/events/HypixelJoinEvent.kt index 6f7711118be6..69406065841a 100644 --- a/src/main/java/at/hannibal2/skyhanni/events/HypixelJoinEvent.kt +++ b/src/main/java/at/hannibal2/skyhanni/events/HypixelJoinEvent.kt @@ -1,3 +1,5 @@ package at.hannibal2.skyhanni.events -class HypixelJoinEvent : LorenzEvent() +import at.hannibal2.skyhanni.api.event.SkyHanniEvent + +object HypixelJoinEvent : SkyHanniEvent() diff --git a/src/main/java/at/hannibal2/skyhanni/events/ItemAddEvent.kt b/src/main/java/at/hannibal2/skyhanni/events/ItemAddEvent.kt index ad0c6355dfd3..f5e067ab810a 100644 --- a/src/main/java/at/hannibal2/skyhanni/events/ItemAddEvent.kt +++ b/src/main/java/at/hannibal2/skyhanni/events/ItemAddEvent.kt @@ -1,7 +1,7 @@ package at.hannibal2.skyhanni.events +import at.hannibal2.skyhanni.api.event.SkyHanniEvent import at.hannibal2.skyhanni.data.ItemAddManager import at.hannibal2.skyhanni.utils.NEUInternalName -class ItemAddEvent(val internalName: NEUInternalName, val amount: Int, val source: ItemAddManager.Source) : - LorenzEvent() +class ItemAddEvent(val internalName: NEUInternalName, val amount: Int, val source: ItemAddManager.Source) : SkyHanniEvent() diff --git a/src/main/java/at/hannibal2/skyhanni/events/ItemInHandChangeEvent.kt b/src/main/java/at/hannibal2/skyhanni/events/ItemInHandChangeEvent.kt index 4ef39df43345..9312aa4aaa69 100644 --- a/src/main/java/at/hannibal2/skyhanni/events/ItemInHandChangeEvent.kt +++ b/src/main/java/at/hannibal2/skyhanni/events/ItemInHandChangeEvent.kt @@ -1,5 +1,6 @@ package at.hannibal2.skyhanni.events +import at.hannibal2.skyhanni.api.event.SkyHanniEvent import at.hannibal2.skyhanni.utils.NEUInternalName -class ItemInHandChangeEvent(val newItem: NEUInternalName, val oldItem: NEUInternalName) : LorenzEvent() +class ItemInHandChangeEvent(val newItem: NEUInternalName, val oldItem: NEUInternalName) : SkyHanniEvent() diff --git a/src/main/java/at/hannibal2/skyhanni/events/KuudraCompleteEvent.kt b/src/main/java/at/hannibal2/skyhanni/events/KuudraCompleteEvent.kt index 98b207f49b49..d57a327ed157 100644 --- a/src/main/java/at/hannibal2/skyhanni/events/KuudraCompleteEvent.kt +++ b/src/main/java/at/hannibal2/skyhanni/events/KuudraCompleteEvent.kt @@ -1,3 +1,5 @@ package at.hannibal2.skyhanni.events -class KuudraCompleteEvent(val kuudraTier: Int) : LorenzEvent() +import at.hannibal2.skyhanni.api.event.SkyHanniEvent + +class KuudraCompleteEvent(val kuudraTier: Int) : SkyHanniEvent() diff --git a/src/main/java/at/hannibal2/skyhanni/events/KuudraEnterEvent.kt b/src/main/java/at/hannibal2/skyhanni/events/KuudraEnterEvent.kt index 8482058a7320..4b3ca2c9f3a3 100644 --- a/src/main/java/at/hannibal2/skyhanni/events/KuudraEnterEvent.kt +++ b/src/main/java/at/hannibal2/skyhanni/events/KuudraEnterEvent.kt @@ -1,3 +1,5 @@ package at.hannibal2.skyhanni.events -class KuudraEnterEvent(val kuudraTier: Int) : LorenzEvent() +import at.hannibal2.skyhanni.api.event.SkyHanniEvent + +class KuudraEnterEvent(val kuudraTier: Int) : SkyHanniEvent() diff --git a/src/main/java/at/hannibal2/skyhanni/events/NEURenderEvent.kt b/src/main/java/at/hannibal2/skyhanni/events/NEURenderEvent.kt index af85871783d4..c92944c31fc0 100644 --- a/src/main/java/at/hannibal2/skyhanni/events/NEURenderEvent.kt +++ b/src/main/java/at/hannibal2/skyhanni/events/NEURenderEvent.kt @@ -2,4 +2,4 @@ package at.hannibal2.skyhanni.events import at.hannibal2.skyhanni.api.event.CancellableSkyHanniEvent -class NEURenderEvent : CancellableSkyHanniEvent() +object NEURenderEvent : CancellableSkyHanniEvent() diff --git a/src/main/java/at/hannibal2/skyhanni/events/NeuEventWrappers.kt b/src/main/java/at/hannibal2/skyhanni/events/NeuEventWrappers.kt index bc707f9d4f47..dc59e0b7aef4 100644 --- a/src/main/java/at/hannibal2/skyhanni/events/NeuEventWrappers.kt +++ b/src/main/java/at/hannibal2/skyhanni/events/NeuEventWrappers.kt @@ -59,7 +59,7 @@ object NeuEventWrappers { val apiData = event.data ?: return try { val playerData = hypixelApiGson.fromJson(apiData) - NeuProfileDataLoadedEvent(playerData).postAndCatch() + NeuProfileDataLoadedEvent(playerData).post() } catch (e: Exception) { ErrorManager.logErrorWithData( diff --git a/src/main/java/at/hannibal2/skyhanni/events/NeuProfileDataLoadedEvent.kt b/src/main/java/at/hannibal2/skyhanni/events/NeuProfileDataLoadedEvent.kt index 175271e6902e..a2d4e4062c7e 100644 --- a/src/main/java/at/hannibal2/skyhanni/events/NeuProfileDataLoadedEvent.kt +++ b/src/main/java/at/hannibal2/skyhanni/events/NeuProfileDataLoadedEvent.kt @@ -1,10 +1,11 @@ package at.hannibal2.skyhanni.events +import at.hannibal2.skyhanni.api.event.SkyHanniEvent import at.hannibal2.skyhanni.data.HypixelData import at.hannibal2.skyhanni.data.jsonobjects.other.HypixelPlayerApiJson import at.hannibal2.skyhanni.utils.LorenzUtils -class NeuProfileDataLoadedEvent(val playerData: HypixelPlayerApiJson) : LorenzEvent() { +class NeuProfileDataLoadedEvent(val playerData: HypixelPlayerApiJson) : SkyHanniEvent() { fun getCurrentProfileData() = playerData.profiles.firstOrNull { it.profileName.lowercase() == HypixelData.profileName } diff --git a/src/main/java/at/hannibal2/skyhanni/events/QuiverUpdateEvent.kt b/src/main/java/at/hannibal2/skyhanni/events/QuiverUpdateEvent.kt index d0c0e5b0b1ac..eaaf4a1665ac 100644 --- a/src/main/java/at/hannibal2/skyhanni/events/QuiverUpdateEvent.kt +++ b/src/main/java/at/hannibal2/skyhanni/events/QuiverUpdateEvent.kt @@ -1,5 +1,6 @@ package at.hannibal2.skyhanni.events +import at.hannibal2.skyhanni.api.event.SkyHanniEvent import at.hannibal2.skyhanni.data.ArrowType -class QuiverUpdateEvent(val currentArrow: ArrowType?, val currentAmount: Int) : LorenzEvent() +class QuiverUpdateEvent(val currentArrow: ArrowType?, val currentAmount: Int) : SkyHanniEvent() diff --git a/src/main/java/at/hannibal2/skyhanni/events/SackChangeEvent.kt b/src/main/java/at/hannibal2/skyhanni/events/SackChangeEvent.kt index aa81287d7568..d51791a60125 100644 --- a/src/main/java/at/hannibal2/skyhanni/events/SackChangeEvent.kt +++ b/src/main/java/at/hannibal2/skyhanni/events/SackChangeEvent.kt @@ -1,9 +1,10 @@ package at.hannibal2.skyhanni.events +import at.hannibal2.skyhanni.api.event.SkyHanniEvent import at.hannibal2.skyhanni.data.SackAPI class SackChangeEvent( val sackChanges: List, val otherItemsAdded: Boolean, val otherItemsRemoved: Boolean, -) : LorenzEvent() +) : SkyHanniEvent() diff --git a/src/main/java/at/hannibal2/skyhanni/events/entity/EntityHealthDisplayEvent.kt b/src/main/java/at/hannibal2/skyhanni/events/entity/EntityHealthDisplayEvent.kt index 5657dc2c83da..6194a53c38d6 100644 --- a/src/main/java/at/hannibal2/skyhanni/events/entity/EntityHealthDisplayEvent.kt +++ b/src/main/java/at/hannibal2/skyhanni/events/entity/EntityHealthDisplayEvent.kt @@ -1,5 +1,5 @@ package at.hannibal2.skyhanni.events.entity -import at.hannibal2.skyhanni.events.LorenzEvent +import at.hannibal2.skyhanni.api.event.SkyHanniEvent -class EntityHealthDisplayEvent(var text: String) : LorenzEvent() +class EntityHealthDisplayEvent(var text: String) : SkyHanniEvent() diff --git a/src/main/java/at/hannibal2/skyhanni/events/entity/ItemAddInInventoryEvent.kt b/src/main/java/at/hannibal2/skyhanni/events/entity/ItemAddInInventoryEvent.kt index 6b9747adfd40..2cf2501c0ced 100644 --- a/src/main/java/at/hannibal2/skyhanni/events/entity/ItemAddInInventoryEvent.kt +++ b/src/main/java/at/hannibal2/skyhanni/events/entity/ItemAddInInventoryEvent.kt @@ -1,6 +1,6 @@ package at.hannibal2.skyhanni.events.entity -import at.hannibal2.skyhanni.events.LorenzEvent +import at.hannibal2.skyhanni.api.event.SkyHanniEvent import at.hannibal2.skyhanni.utils.NEUInternalName -class ItemAddInInventoryEvent(val internalName: NEUInternalName, val amount: Int) : LorenzEvent() +class ItemAddInInventoryEvent(val internalName: NEUInternalName, val amount: Int) : SkyHanniEvent() diff --git a/src/main/java/at/hannibal2/skyhanni/events/garden/visitor/VisitorAcceptEvent.kt b/src/main/java/at/hannibal2/skyhanni/events/garden/visitor/VisitorAcceptEvent.kt index 41a429cfd372..250d103423cb 100644 --- a/src/main/java/at/hannibal2/skyhanni/events/garden/visitor/VisitorAcceptEvent.kt +++ b/src/main/java/at/hannibal2/skyhanni/events/garden/visitor/VisitorAcceptEvent.kt @@ -1,6 +1,6 @@ package at.hannibal2.skyhanni.events.garden.visitor -import at.hannibal2.skyhanni.events.LorenzEvent +import at.hannibal2.skyhanni.api.event.SkyHanniEvent import at.hannibal2.skyhanni.features.garden.visitor.VisitorAPI -class VisitorAcceptEvent(val visitor: VisitorAPI.Visitor) : LorenzEvent() +class VisitorAcceptEvent(val visitor: VisitorAPI.Visitor) : SkyHanniEvent() diff --git a/src/main/java/at/hannibal2/skyhanni/events/garden/visitor/VisitorAcceptedEvent.kt b/src/main/java/at/hannibal2/skyhanni/events/garden/visitor/VisitorAcceptedEvent.kt index 5b894768fb39..1636f9fc3ff3 100644 --- a/src/main/java/at/hannibal2/skyhanni/events/garden/visitor/VisitorAcceptedEvent.kt +++ b/src/main/java/at/hannibal2/skyhanni/events/garden/visitor/VisitorAcceptedEvent.kt @@ -1,6 +1,6 @@ package at.hannibal2.skyhanni.events.garden.visitor -import at.hannibal2.skyhanni.events.LorenzEvent +import at.hannibal2.skyhanni.api.event.SkyHanniEvent import at.hannibal2.skyhanni.features.garden.visitor.VisitorAPI -class VisitorAcceptedEvent(val visitor: VisitorAPI.Visitor) : LorenzEvent() +class VisitorAcceptedEvent(val visitor: VisitorAPI.Visitor) : SkyHanniEvent() diff --git a/src/main/java/at/hannibal2/skyhanni/events/garden/visitor/VisitorArrivalEvent.kt b/src/main/java/at/hannibal2/skyhanni/events/garden/visitor/VisitorArrivalEvent.kt index f26dbb971275..1d5135d1c53e 100644 --- a/src/main/java/at/hannibal2/skyhanni/events/garden/visitor/VisitorArrivalEvent.kt +++ b/src/main/java/at/hannibal2/skyhanni/events/garden/visitor/VisitorArrivalEvent.kt @@ -1,6 +1,6 @@ package at.hannibal2.skyhanni.events.garden.visitor -import at.hannibal2.skyhanni.events.LorenzEvent +import at.hannibal2.skyhanni.api.event.SkyHanniEvent import at.hannibal2.skyhanni.features.garden.visitor.VisitorAPI.Visitor -class VisitorArrivalEvent(val visitor: Visitor) : LorenzEvent() +class VisitorArrivalEvent(val visitor: Visitor) : SkyHanniEvent() diff --git a/src/main/java/at/hannibal2/skyhanni/events/garden/visitor/VisitorLeftEvent.kt b/src/main/java/at/hannibal2/skyhanni/events/garden/visitor/VisitorLeftEvent.kt index f5673decd0e4..127d518277fe 100644 --- a/src/main/java/at/hannibal2/skyhanni/events/garden/visitor/VisitorLeftEvent.kt +++ b/src/main/java/at/hannibal2/skyhanni/events/garden/visitor/VisitorLeftEvent.kt @@ -1,6 +1,6 @@ package at.hannibal2.skyhanni.events.garden.visitor -import at.hannibal2.skyhanni.events.LorenzEvent +import at.hannibal2.skyhanni.api.event.SkyHanniEvent import at.hannibal2.skyhanni.features.garden.visitor.VisitorAPI -class VisitorLeftEvent(val visitor: VisitorAPI.Visitor) : LorenzEvent() +class VisitorLeftEvent(val visitor: VisitorAPI.Visitor) : SkyHanniEvent() diff --git a/src/main/java/at/hannibal2/skyhanni/events/garden/visitor/VisitorOpenEvent.kt b/src/main/java/at/hannibal2/skyhanni/events/garden/visitor/VisitorOpenEvent.kt index c2e7a40b0c3d..f86b388f1e99 100644 --- a/src/main/java/at/hannibal2/skyhanni/events/garden/visitor/VisitorOpenEvent.kt +++ b/src/main/java/at/hannibal2/skyhanni/events/garden/visitor/VisitorOpenEvent.kt @@ -1,6 +1,6 @@ package at.hannibal2.skyhanni.events.garden.visitor -import at.hannibal2.skyhanni.events.LorenzEvent +import at.hannibal2.skyhanni.api.event.SkyHanniEvent import at.hannibal2.skyhanni.features.garden.visitor.VisitorAPI -class VisitorOpenEvent(val visitor: VisitorAPI.Visitor) : LorenzEvent() +class VisitorOpenEvent(val visitor: VisitorAPI.Visitor) : SkyHanniEvent() diff --git a/src/main/java/at/hannibal2/skyhanni/events/garden/visitor/VisitorRefusedEvent.kt b/src/main/java/at/hannibal2/skyhanni/events/garden/visitor/VisitorRefusedEvent.kt index 94de16081b04..bcfe5b93d0af 100644 --- a/src/main/java/at/hannibal2/skyhanni/events/garden/visitor/VisitorRefusedEvent.kt +++ b/src/main/java/at/hannibal2/skyhanni/events/garden/visitor/VisitorRefusedEvent.kt @@ -1,6 +1,6 @@ package at.hannibal2.skyhanni.events.garden.visitor -import at.hannibal2.skyhanni.events.LorenzEvent +import at.hannibal2.skyhanni.api.event.SkyHanniEvent import at.hannibal2.skyhanni.features.garden.visitor.VisitorAPI -class VisitorRefusedEvent(val visitor: VisitorAPI.Visitor) : LorenzEvent() +class VisitorRefusedEvent(val visitor: VisitorAPI.Visitor) : SkyHanniEvent() diff --git a/src/main/java/at/hannibal2/skyhanni/events/garden/visitor/VisitorRenderEvent.kt b/src/main/java/at/hannibal2/skyhanni/events/garden/visitor/VisitorRenderEvent.kt index 9282d3e04fe6..0ca47d3ff0ea 100644 --- a/src/main/java/at/hannibal2/skyhanni/events/garden/visitor/VisitorRenderEvent.kt +++ b/src/main/java/at/hannibal2/skyhanni/events/garden/visitor/VisitorRenderEvent.kt @@ -1,8 +1,8 @@ package at.hannibal2.skyhanni.events.garden.visitor -import at.hannibal2.skyhanni.events.LorenzEvent +import at.hannibal2.skyhanni.api.event.SkyHanniEvent import at.hannibal2.skyhanni.events.LorenzRenderWorldEvent import at.hannibal2.skyhanni.features.garden.visitor.VisitorAPI import at.hannibal2.skyhanni.utils.LorenzVec -class VisitorRenderEvent(val visitor: VisitorAPI.Visitor, val location: LorenzVec, val parent: LorenzRenderWorldEvent) : LorenzEvent() +class VisitorRenderEvent(val visitor: VisitorAPI.Visitor, val location: LorenzVec, val parent: LorenzRenderWorldEvent) : SkyHanniEvent() diff --git a/src/main/java/at/hannibal2/skyhanni/events/mining/CorpseLootedEvent.kt b/src/main/java/at/hannibal2/skyhanni/events/mining/CorpseLootedEvent.kt index 9e38d8e956d5..3e1008644368 100644 --- a/src/main/java/at/hannibal2/skyhanni/events/mining/CorpseLootedEvent.kt +++ b/src/main/java/at/hannibal2/skyhanni/events/mining/CorpseLootedEvent.kt @@ -1,6 +1,6 @@ package at.hannibal2.skyhanni.events.mining -import at.hannibal2.skyhanni.events.LorenzEvent +import at.hannibal2.skyhanni.api.event.SkyHanniEvent import at.hannibal2.skyhanni.features.mining.glacitemineshaft.CorpseType -class CorpseLootedEvent(val corpseType: CorpseType, val loot: List>) : LorenzEvent() +class CorpseLootedEvent(val corpseType: CorpseType, val loot: List>) : SkyHanniEvent() diff --git a/src/main/java/at/hannibal2/skyhanni/events/mining/FossilExcavationEvent.kt b/src/main/java/at/hannibal2/skyhanni/events/mining/FossilExcavationEvent.kt index 98b18a83f3ea..df827e7df169 100644 --- a/src/main/java/at/hannibal2/skyhanni/events/mining/FossilExcavationEvent.kt +++ b/src/main/java/at/hannibal2/skyhanni/events/mining/FossilExcavationEvent.kt @@ -1,5 +1,5 @@ package at.hannibal2.skyhanni.events.mining -import at.hannibal2.skyhanni.events.LorenzEvent +import at.hannibal2.skyhanni.api.event.SkyHanniEvent -class FossilExcavationEvent(val loot: List>) : LorenzEvent() +class FossilExcavationEvent(val loot: List>) : SkyHanniEvent() diff --git a/src/main/java/at/hannibal2/skyhanni/events/player/PlayerDeathEvent.kt b/src/main/java/at/hannibal2/skyhanni/events/player/PlayerDeathEvent.kt index fe9cac685512..3a0ec886e19f 100644 --- a/src/main/java/at/hannibal2/skyhanni/events/player/PlayerDeathEvent.kt +++ b/src/main/java/at/hannibal2/skyhanni/events/player/PlayerDeathEvent.kt @@ -1,9 +1,9 @@ package at.hannibal2.skyhanni.events.player +import at.hannibal2.skyhanni.api.event.SkyHanniEvent import at.hannibal2.skyhanni.events.LorenzChatEvent -import at.hannibal2.skyhanni.events.LorenzEvent /** * When the player "you" dies in the game. does not fire when other players die. */ -class PlayerDeathEvent(val name: String, val reason: String, val chatEvent: LorenzChatEvent) : LorenzEvent() +class PlayerDeathEvent(val name: String, val reason: String, val chatEvent: LorenzChatEvent) : SkyHanniEvent() diff --git a/src/main/java/at/hannibal2/skyhanni/events/render/EntityRenderLayersEvent.kt b/src/main/java/at/hannibal2/skyhanni/events/render/EntityRenderLayersEvent.kt index ff951736e764..8389ee3cdbb4 100644 --- a/src/main/java/at/hannibal2/skyhanni/events/render/EntityRenderLayersEvent.kt +++ b/src/main/java/at/hannibal2/skyhanni/events/render/EntityRenderLayersEvent.kt @@ -1,12 +1,12 @@ package at.hannibal2.skyhanni.events.render -import at.hannibal2.skyhanni.events.LorenzEvent +import at.hannibal2.skyhanni.api.event.GenericSkyHanniEvent import net.minecraft.entity.Entity import net.minecraftforge.fml.common.eventhandler.Cancelable open class EntityRenderLayersEvent( val entity: T, -) : LorenzEvent() { +) : GenericSkyHanniEvent(entity.javaClass) { @Cancelable class Pre( diff --git a/src/main/java/at/hannibal2/skyhanni/events/render/gui/ReplaceItemEvent.kt b/src/main/java/at/hannibal2/skyhanni/events/render/gui/ReplaceItemEvent.kt index ca2f2efbb6f4..55887f7b995c 100644 --- a/src/main/java/at/hannibal2/skyhanni/events/render/gui/ReplaceItemEvent.kt +++ b/src/main/java/at/hannibal2/skyhanni/events/render/gui/ReplaceItemEvent.kt @@ -1,12 +1,12 @@ package at.hannibal2.skyhanni.events.render.gui -import at.hannibal2.skyhanni.events.LorenzEvent +import at.hannibal2.skyhanni.api.event.SkyHanniEvent import net.minecraft.inventory.IInventory import net.minecraft.inventory.InventoryBasic import net.minecraft.item.ItemStack import org.spongepowered.asm.mixin.injection.callback.CallbackInfoReturnable -class ReplaceItemEvent(val inventory: IInventory, val originalItem: ItemStack, val slot: Int) : LorenzEvent() { +class ReplaceItemEvent(val inventory: IInventory, val originalItem: ItemStack, val slot: Int) : SkyHanniEvent() { var replacement: ItemStack? = null private set @@ -24,7 +24,7 @@ class ReplaceItemEvent(val inventory: IInventory, val originalItem: ItemStack, v ) { val originalItem = inventoryContents.getOrNull(slot) ?: return val event = ReplaceItemEvent(inventory, originalItem, slot) - event.postAndCatch() + event.post() event.replacement?.let { cir.returnValue = it } } } diff --git a/src/main/java/at/hannibal2/skyhanni/features/chat/PlayerDeathMessages.kt b/src/main/java/at/hannibal2/skyhanni/features/chat/PlayerDeathMessages.kt index 2afc9276bbf0..515438ef8aa1 100644 --- a/src/main/java/at/hannibal2/skyhanni/features/chat/PlayerDeathMessages.kt +++ b/src/main/java/at/hannibal2/skyhanni/features/chat/PlayerDeathMessages.kt @@ -1,6 +1,7 @@ package at.hannibal2.skyhanni.features.chat import at.hannibal2.skyhanni.SkyHanniMod +import at.hannibal2.skyhanni.api.event.HandleEvent import at.hannibal2.skyhanni.events.SecondPassedEvent import at.hannibal2.skyhanni.events.player.PlayerDeathEvent import at.hannibal2.skyhanni.features.dungeon.DungeonAPI @@ -26,7 +27,7 @@ object PlayerDeathMessages { checkOtherPlayers() } - @SubscribeEvent + @HandleEvent fun onPlayerDeath(event: PlayerDeathEvent) { if (!LorenzUtils.inSkyBlock) return diff --git a/src/main/java/at/hannibal2/skyhanni/features/chat/SkyblockXPInChat.kt b/src/main/java/at/hannibal2/skyhanni/features/chat/SkyblockXPInChat.kt index d0a08c86fd4d..4b1522a62ac3 100644 --- a/src/main/java/at/hannibal2/skyhanni/features/chat/SkyblockXPInChat.kt +++ b/src/main/java/at/hannibal2/skyhanni/features/chat/SkyblockXPInChat.kt @@ -1,18 +1,18 @@ package at.hannibal2.skyhanni.features.chat import at.hannibal2.skyhanni.SkyHanniMod +import at.hannibal2.skyhanni.api.event.HandleEvent import at.hannibal2.skyhanni.data.ActionBarStatsData import at.hannibal2.skyhanni.events.ActionBarValueUpdateEvent import at.hannibal2.skyhanni.skyhannimodule.SkyHanniModule import at.hannibal2.skyhanni.utils.ChatUtils -import net.minecraftforge.fml.common.eventhandler.SubscribeEvent @SkyHanniModule object SkyblockXPInChat { val config get() = SkyHanniMod.feature.chat.skyBlockXPInChat - @SubscribeEvent + @HandleEvent fun onActionBarValueUpdate(event: ActionBarValueUpdateEvent) { if (event.updated != ActionBarStatsData.SKYBLOCK_XP) return if (!config) return diff --git a/src/main/java/at/hannibal2/skyhanni/features/combat/ArmorStackDisplay.kt b/src/main/java/at/hannibal2/skyhanni/features/combat/ArmorStackDisplay.kt index 3ca87ef98994..27fcbf137a83 100644 --- a/src/main/java/at/hannibal2/skyhanni/features/combat/ArmorStackDisplay.kt +++ b/src/main/java/at/hannibal2/skyhanni/features/combat/ArmorStackDisplay.kt @@ -1,6 +1,7 @@ package at.hannibal2.skyhanni.features.combat import at.hannibal2.skyhanni.SkyHanniMod +import at.hannibal2.skyhanni.api.event.HandleEvent import at.hannibal2.skyhanni.events.ActionBarUpdateEvent import at.hannibal2.skyhanni.events.GuiRenderEvent import at.hannibal2.skyhanni.skyhannimodule.SkyHanniModule @@ -24,7 +25,7 @@ object ArmorStackDisplay { " (?:§6|§6§l)(?\\d+[ᝐ⁑|҉Ѫ⚶])" ) - @SubscribeEvent + @HandleEvent fun onActionBar(event: ActionBarUpdateEvent) { if (!isEnabled()) return val stacks = armorStackPattern.findMatcher(event.actionBar) { diff --git a/src/main/java/at/hannibal2/skyhanni/features/combat/damageindicator/DamageIndicatorManager.kt b/src/main/java/at/hannibal2/skyhanni/features/combat/damageindicator/DamageIndicatorManager.kt index 29f9eb820fe0..9a3a139548a5 100644 --- a/src/main/java/at/hannibal2/skyhanni/features/combat/damageindicator/DamageIndicatorManager.kt +++ b/src/main/java/at/hannibal2/skyhanni/features/combat/damageindicator/DamageIndicatorManager.kt @@ -371,7 +371,7 @@ object DamageIndicatorManager { checkDamage(entityData, health, lastHealth) tickDamage(entityData.damageCounter) - BossHealthChangeEvent(entityData, lastHealth, health, maxHealth).postAndCatch() + BossHealthChangeEvent(entityData, lastHealth, health, maxHealth).post() } entityData.lastHealth = health @@ -837,13 +837,13 @@ object DamageIndicatorManager { entityResult.bossType, foundTime = SimpleTimeMark.now(), ) - DamageIndicatorDetectedEvent(entityData).postAndCatch() + DamageIndicatorDetectedEvent(entityData).post() return entityData } private fun checkFinalBoss(finalBoss: Boolean, id: Int) { if (finalBoss) { - DamageIndicatorFinalBossEvent(id).postAndCatch() + DamageIndicatorFinalBossEvent(id).post() } } @@ -898,13 +898,13 @@ object DamageIndicatorManager { } } - @SubscribeEvent + @HandleEvent fun onEntityHealthUpdate(event: EntityHealthUpdateEvent) { val data = data[event.entity.uniqueID] ?: return if (event.health <= 1) { if (!data.firstDeath) { data.firstDeath = true - DamageIndicatorDeathEvent(event.entity, data).postAndCatch() + DamageIndicatorDeathEvent(event.entity, data).post() } } } diff --git a/src/main/java/at/hannibal2/skyhanni/features/combat/endernodetracker/EnderNodeTracker.kt b/src/main/java/at/hannibal2/skyhanni/features/combat/endernodetracker/EnderNodeTracker.kt index 00e3e9e9f0e0..26b434903819 100644 --- a/src/main/java/at/hannibal2/skyhanni/features/combat/endernodetracker/EnderNodeTracker.kt +++ b/src/main/java/at/hannibal2/skyhanni/features/combat/endernodetracker/EnderNodeTracker.kt @@ -1,6 +1,7 @@ package at.hannibal2.skyhanni.features.combat.endernodetracker import at.hannibal2.skyhanni.SkyHanniMod +import at.hannibal2.skyhanni.api.event.HandleEvent import at.hannibal2.skyhanni.config.ConfigUpdaterMigrator import at.hannibal2.skyhanni.config.features.combat.EnderNodeConfig.EnderNodeDisplayEntry import at.hannibal2.skyhanni.data.IslandType @@ -143,7 +144,7 @@ object EnderNodeTracker { }.sumOf { it.stackSize } } - @SubscribeEvent + @HandleEvent fun onSackChange(event: SackChangeEvent) { if (!isEnabled()) return if (!ProfileStorageData.loaded) return diff --git a/src/main/java/at/hannibal2/skyhanni/features/combat/mobs/MobHighlight.kt b/src/main/java/at/hannibal2/skyhanni/features/combat/mobs/MobHighlight.kt index 9d76b5af2214..99638814d9a0 100644 --- a/src/main/java/at/hannibal2/skyhanni/features/combat/mobs/MobHighlight.kt +++ b/src/main/java/at/hannibal2/skyhanni/features/combat/mobs/MobHighlight.kt @@ -1,6 +1,7 @@ package at.hannibal2.skyhanni.features.combat.mobs import at.hannibal2.skyhanni.SkyHanniMod +import at.hannibal2.skyhanni.api.event.HandleEvent import at.hannibal2.skyhanni.events.EntityHealthUpdateEvent import at.hannibal2.skyhanni.events.EntityMaxHealthUpdateEvent import at.hannibal2.skyhanni.events.LorenzRenderWorldEvent @@ -31,7 +32,7 @@ object MobHighlight { private val config get() = SkyHanniMod.feature.combat.mobs private var arachne: EntityLivingBase? = null - @SubscribeEvent + @HandleEvent fun onEntityHealthUpdate(event: EntityHealthUpdateEvent) { if (!LorenzUtils.inSkyBlock) return @@ -45,7 +46,7 @@ object MobHighlight { } } - @SubscribeEvent + @HandleEvent fun onEntityHealthUpdate(event: EntityMaxHealthUpdateEvent) { if (!LorenzUtils.inSkyBlock) return diff --git a/src/main/java/at/hannibal2/skyhanni/features/commands/WikiManager.kt b/src/main/java/at/hannibal2/skyhanni/features/commands/WikiManager.kt index e6a1ef4e955e..666014ed15d2 100644 --- a/src/main/java/at/hannibal2/skyhanni/features/commands/WikiManager.kt +++ b/src/main/java/at/hannibal2/skyhanni/features/commands/WikiManager.kt @@ -1,6 +1,7 @@ package at.hannibal2.skyhanni.features.commands import at.hannibal2.skyhanni.SkyHanniMod +import at.hannibal2.skyhanni.api.event.HandleEvent import at.hannibal2.skyhanni.config.ConfigUpdaterMigrator import at.hannibal2.skyhanni.events.GuiKeyPressEvent import at.hannibal2.skyhanni.events.MessageSendToServerEvent @@ -57,7 +58,7 @@ object WikiManager { } } - @SubscribeEvent + @HandleEvent fun onKeybind(event: GuiKeyPressEvent) { if (!LorenzUtils.inSkyBlock) return if (NEUItems.neuHasFocus()) return diff --git a/src/main/java/at/hannibal2/skyhanni/features/dungeon/CroesusChestTracker.kt b/src/main/java/at/hannibal2/skyhanni/features/dungeon/CroesusChestTracker.kt index bcae24943c72..e11dc7185149 100644 --- a/src/main/java/at/hannibal2/skyhanni/features/dungeon/CroesusChestTracker.kt +++ b/src/main/java/at/hannibal2/skyhanni/features/dungeon/CroesusChestTracker.kt @@ -1,6 +1,7 @@ package at.hannibal2.skyhanni.features.dungeon import at.hannibal2.skyhanni.SkyHanniMod +import at.hannibal2.skyhanni.api.event.HandleEvent import at.hannibal2.skyhanni.config.storage.ProfileSpecificStorage.DungeonStorage.DungeonRunInfo import at.hannibal2.skyhanni.data.ProfileStorageData import at.hannibal2.skyhanni.data.SackAPI.getAmountInSacks @@ -227,7 +228,7 @@ object CroesusChestTracker { event.stackTip = "§a✔" } - @SubscribeEvent + @HandleEvent fun onDungeonComplete(event: DungeonCompleteEvent) { if (event.floor == "E") return croesusChests?.add(0, DungeonRunInfo(event.floor)) diff --git a/src/main/java/at/hannibal2/skyhanni/features/dungeon/DungeonAPI.kt b/src/main/java/at/hannibal2/skyhanni/features/dungeon/DungeonAPI.kt index a12b202f405f..987c9bc4dbc2 100644 --- a/src/main/java/at/hannibal2/skyhanni/features/dungeon/DungeonAPI.kt +++ b/src/main/java/at/hannibal2/skyhanni/features/dungeon/DungeonAPI.kt @@ -190,7 +190,7 @@ object DungeonAPI { val floor = group("floor") if (dungeonFloor == floor) return dungeonFloor = floor - DungeonEnterEvent(floor).postAndCatch() + DungeonEnterEvent(floor).post() return } if (!inDungeon()) return @@ -258,7 +258,7 @@ object DungeonAPI { val floor = dungeonFloor ?: return if (event.message == "§e[NPC] §bMort§f: §rHere, I found this map when I first entered the dungeon.") { started = true - DungeonStartEvent(floor).postAndCatch() + DungeonStartEvent(floor).post() } if (event.message.removeColor().matches(uniqueClassBonus)) { isUniqueClass = true @@ -275,7 +275,7 @@ object DungeonAPI { } dungeonComplete.matchMatcher(event.message) { completed = true - DungeonCompleteEvent(floor).postAndCatch() + DungeonCompleteEvent(floor).post() return } } diff --git a/src/main/java/at/hannibal2/skyhanni/features/dungeon/DungeonBossAPI.kt b/src/main/java/at/hannibal2/skyhanni/features/dungeon/DungeonBossAPI.kt index 1217723fad57..1fec4bc17011 100644 --- a/src/main/java/at/hannibal2/skyhanni/features/dungeon/DungeonBossAPI.kt +++ b/src/main/java/at/hannibal2/skyhanni/features/dungeon/DungeonBossAPI.kt @@ -1,5 +1,6 @@ package at.hannibal2.skyhanni.features.dungeon +import at.hannibal2.skyhanni.api.event.HandleEvent import at.hannibal2.skyhanni.events.DungeonBossPhaseChangeEvent import at.hannibal2.skyhanni.events.DungeonCompleteEvent import at.hannibal2.skyhanni.events.LorenzChatEvent @@ -161,7 +162,7 @@ object DungeonBossAPI { bossPhase = null } - @SubscribeEvent + @HandleEvent fun onDungeonEnd(event: DungeonCompleteEvent) { bossPhase = null } diff --git a/src/main/java/at/hannibal2/skyhanni/features/dungeon/DungeonCleanEnd.kt b/src/main/java/at/hannibal2/skyhanni/features/dungeon/DungeonCleanEnd.kt index a1b7142380ec..3a07e3e7e363 100644 --- a/src/main/java/at/hannibal2/skyhanni/features/dungeon/DungeonCleanEnd.kt +++ b/src/main/java/at/hannibal2/skyhanni/features/dungeon/DungeonCleanEnd.kt @@ -69,7 +69,7 @@ object DungeonCleanEnd { lastBossId = -1 } - @SubscribeEvent + @HandleEvent fun onBossDead(event: DamageIndicatorFinalBossEvent) { if (!DungeonAPI.inDungeon()) return if (bossDone) return @@ -79,7 +79,7 @@ object DungeonCleanEnd { } } - @SubscribeEvent + @HandleEvent fun onEntityHealthUpdate(event: EntityHealthUpdateEvent) { if (!DungeonAPI.inDungeon()) return if (!config.enabled) return diff --git a/src/main/java/at/hannibal2/skyhanni/features/dungeon/DungeonCopilot.kt b/src/main/java/at/hannibal2/skyhanni/features/dungeon/DungeonCopilot.kt index 8a976a7a8518..b9c1889117c2 100644 --- a/src/main/java/at/hannibal2/skyhanni/features/dungeon/DungeonCopilot.kt +++ b/src/main/java/at/hannibal2/skyhanni/features/dungeon/DungeonCopilot.kt @@ -124,13 +124,13 @@ object DungeonCopilot { } } - @SubscribeEvent + @HandleEvent fun onDungeonStart(event: DungeonStartEvent) { changeNextStep("Clear first room") searchForKey = true } - @SubscribeEvent + @HandleEvent fun onDungeonStart(event: DungeonEnterEvent) { changeNextStep("Talk to Mort") searchForKey = true diff --git a/src/main/java/at/hannibal2/skyhanni/features/dungeon/DungeonDeathCounter.kt b/src/main/java/at/hannibal2/skyhanni/features/dungeon/DungeonDeathCounter.kt index 7245ab8f58af..f67dc57d62ee 100644 --- a/src/main/java/at/hannibal2/skyhanni/features/dungeon/DungeonDeathCounter.kt +++ b/src/main/java/at/hannibal2/skyhanni/features/dungeon/DungeonDeathCounter.kt @@ -1,6 +1,7 @@ package at.hannibal2.skyhanni.features.dungeon import at.hannibal2.skyhanni.SkyHanniMod +import at.hannibal2.skyhanni.api.event.HandleEvent import at.hannibal2.skyhanni.events.DungeonStartEvent import at.hannibal2.skyhanni.events.GuiRenderEvent import at.hannibal2.skyhanni.events.LorenzChatEvent @@ -77,7 +78,7 @@ object DungeonDeathCounter { display = color + "Deaths: $deaths" } - @SubscribeEvent + @HandleEvent fun onDungeonStart(event: DungeonStartEvent) { deaths = 0 update() diff --git a/src/main/java/at/hannibal2/skyhanni/features/dungeon/DungeonMilestonesDisplay.kt b/src/main/java/at/hannibal2/skyhanni/features/dungeon/DungeonMilestonesDisplay.kt index 7e1192493024..f8b374a24b21 100644 --- a/src/main/java/at/hannibal2/skyhanni/features/dungeon/DungeonMilestonesDisplay.kt +++ b/src/main/java/at/hannibal2/skyhanni/features/dungeon/DungeonMilestonesDisplay.kt @@ -1,6 +1,7 @@ package at.hannibal2.skyhanni.features.dungeon import at.hannibal2.skyhanni.SkyHanniMod +import at.hannibal2.skyhanni.api.event.HandleEvent import at.hannibal2.skyhanni.events.DungeonStartEvent import at.hannibal2.skyhanni.events.GuiRenderEvent import at.hannibal2.skyhanni.events.LorenzChatEvent @@ -72,7 +73,7 @@ object DungeonMilestonesDisplay { currentMilestone = 0 } - @SubscribeEvent + @HandleEvent fun onDungeonStart(event: DungeonStartEvent) { currentMilestone = 0 update() diff --git a/src/main/java/at/hannibal2/skyhanni/features/dungeon/DungeonsRaceGuide.kt b/src/main/java/at/hannibal2/skyhanni/features/dungeon/DungeonsRaceGuide.kt index e2f5c2cc13da..5e052e133f34 100644 --- a/src/main/java/at/hannibal2/skyhanni/features/dungeon/DungeonsRaceGuide.kt +++ b/src/main/java/at/hannibal2/skyhanni/features/dungeon/DungeonsRaceGuide.kt @@ -1,6 +1,7 @@ package at.hannibal2.skyhanni.features.dungeon import at.hannibal2.skyhanni.SkyHanniMod +import at.hannibal2.skyhanni.api.event.HandleEvent import at.hannibal2.skyhanni.data.IslandType import at.hannibal2.skyhanni.data.jsonobjects.repo.DungeonHubRacesJson import at.hannibal2.skyhanni.events.ActionBarUpdateEvent @@ -63,7 +64,7 @@ object DungeonsRaceGuide { } } - @SubscribeEvent + @HandleEvent fun onActionBarUpdate(event: ActionBarUpdateEvent) { if (!isEnabled()) return currentRace = null diff --git a/src/main/java/at/hannibal2/skyhanni/features/event/diana/AllBurrowsList.kt b/src/main/java/at/hannibal2/skyhanni/features/event/diana/AllBurrowsList.kt index 40bc4a97fdff..d3656916c274 100644 --- a/src/main/java/at/hannibal2/skyhanni/features/event/diana/AllBurrowsList.kt +++ b/src/main/java/at/hannibal2/skyhanni/features/event/diana/AllBurrowsList.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.events.BurrowDetectEvent import at.hannibal2.skyhanni.events.LorenzRenderWorldEvent import at.hannibal2.skyhanni.events.SecondPassedEvent @@ -25,7 +26,7 @@ object AllBurrowsList { SkyHanniMod.feature.storage?.foundDianaBurrowLocations = value } - @SubscribeEvent + @HandleEvent fun onBurrowDetect(event: BurrowDetectEvent) { if (!isEnabled()) return burrowLocations = burrowLocations?.editCopy { 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 a51e94f8d740..8b17ba292612 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 @@ -120,7 +120,7 @@ object DianaFixChat { } } - @SubscribeEvent + @HandleEvent fun onBurrowGuess(event: BurrowGuessEvent) { foundGuess = true diff --git a/src/main/java/at/hannibal2/skyhanni/features/event/diana/DianaProfitTracker.kt b/src/main/java/at/hannibal2/skyhanni/features/event/diana/DianaProfitTracker.kt index d99b3b015832..909d4a4a9984 100644 --- a/src/main/java/at/hannibal2/skyhanni/features/event/diana/DianaProfitTracker.kt +++ b/src/main/java/at/hannibal2/skyhanni/features/event/diana/DianaProfitTracker.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.data.ElectionAPI.getElectionYear import at.hannibal2.skyhanni.data.ItemAddManager import at.hannibal2.skyhanni.data.jsonobjects.repo.DianaDropsJson @@ -107,7 +108,7 @@ object DianaProfitTracker { tracker.addPriceFromButton(this) } - @SubscribeEvent + @HandleEvent fun onItemAdd(event: ItemAddEvent) { if (!(DianaAPI.isDoingDiana() && config.enabled)) 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 c8b6da4fd6d8..46cdb2f9c382 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 @@ -149,7 +149,7 @@ object GriffinBurrowHelper { } } - @SubscribeEvent + @HandleEvent fun onBurrowGuess(event: BurrowGuessEvent) { EntityMovementData.addToTrack(Minecraft.getMinecraft().thePlayer) @@ -157,7 +157,7 @@ object GriffinBurrowHelper { update() } - @SubscribeEvent + @HandleEvent fun onBurrowDetect(event: BurrowDetectEvent) { EntityMovementData.addToTrack(Minecraft.getMinecraft().thePlayer) particleBurrows = particleBurrows.editCopy { this[event.burrowLocation] = event.type } @@ -173,7 +173,7 @@ object GriffinBurrowHelper { } } - @SubscribeEvent + @HandleEvent fun onBurrowDug(event: BurrowDugEvent) { val location = event.burrowLocation particleBurrows = particleBurrows.editCopy { remove(location) } 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 a082dfaac6b0..8a926c920263 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 @@ -83,7 +83,7 @@ object GriffinBurrowParticleFinder { if (burrow.hasEnchant && burrow.hasFootstep && burrow.type != -1) { if (!burrow.found) { - BurrowDetectEvent(burrow.location, burrow.getType()).postAndCatch() + BurrowDetectEvent(burrow.location, burrow.getType()).post() burrow.found = true } } @@ -166,7 +166,7 @@ object GriffinBurrowParticleFinder { recentlyDugParticleBurrows.add(location) lastDugParticleBurrow = null - BurrowDugEvent(burrow.location).postAndCatch() + BurrowDugEvent(burrow.location).post() return true } diff --git a/src/main/java/at/hannibal2/skyhanni/features/event/diana/GriffinPetWarning.kt b/src/main/java/at/hannibal2/skyhanni/features/event/diana/GriffinPetWarning.kt index f5ce6675bb98..cd890e427044 100644 --- a/src/main/java/at/hannibal2/skyhanni/features/event/diana/GriffinPetWarning.kt +++ b/src/main/java/at/hannibal2/skyhanni/features/event/diana/GriffinPetWarning.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.events.BurrowDugEvent import at.hannibal2.skyhanni.events.IslandChangeEvent import at.hannibal2.skyhanni.events.LorenzTickEvent @@ -37,7 +38,7 @@ object GriffinPetWarning { warn() } - @SubscribeEvent + @HandleEvent fun onBurrowDug(event: BurrowDugEvent) { DelayedRun.runDelayed(2.seconds) { wasCorrectPetAlready = false diff --git a/src/main/java/at/hannibal2/skyhanni/features/event/diana/InquisitorWaypointShare.kt b/src/main/java/at/hannibal2/skyhanni/features/event/diana/InquisitorWaypointShare.kt index 68590e5596b3..e661646fa480 100644 --- a/src/main/java/at/hannibal2/skyhanni/features/event/diana/InquisitorWaypointShare.kt +++ b/src/main/java/at/hannibal2/skyhanni/features/event/diana/InquisitorWaypointShare.kt @@ -186,7 +186,7 @@ object InquisitorWaypointShare { } } - @SubscribeEvent + @HandleEvent fun onEntityHealthUpdate(event: EntityHealthUpdateEvent) { if (!isEnabled()) return if (event.health > 0) return diff --git a/src/main/java/at/hannibal2/skyhanni/features/event/diana/SoopyGuessBurrow.kt b/src/main/java/at/hannibal2/skyhanni/features/event/diana/SoopyGuessBurrow.kt index d5527382b259..7328070366fb 100644 --- a/src/main/java/at/hannibal2/skyhanni/features/event/diana/SoopyGuessBurrow.kt +++ b/src/main/java/at/hannibal2/skyhanni/features/event/diana/SoopyGuessBurrow.kt @@ -247,7 +247,7 @@ object SoopyGuessBurrow { } else { LorenzVec(floor(p2.x), 255.0, floor(p2.z)) } - BurrowGuessEvent(finalLocation).postAndCatch() + BurrowGuessEvent(finalLocation).post() } } } diff --git a/src/main/java/at/hannibal2/skyhanni/features/event/hoppity/HoppityCollectionStats.kt b/src/main/java/at/hannibal2/skyhanni/features/event/hoppity/HoppityCollectionStats.kt index bb759e83f436..aff9442c5780 100644 --- a/src/main/java/at/hannibal2/skyhanni/features/event/hoppity/HoppityCollectionStats.kt +++ b/src/main/java/at/hannibal2/skyhanni/features/event/hoppity/HoppityCollectionStats.kt @@ -259,7 +259,7 @@ object HoppityCollectionStats { private val replacementCache: MutableMap = mutableMapOf() - @SubscribeEvent + @HandleEvent fun replaceItem(event: ReplaceItemEvent) { replacementCache[event.originalItem.displayName]?.let { event.replace(it) } } diff --git a/src/main/java/at/hannibal2/skyhanni/features/event/hoppity/HoppityEggDisplayManager.kt b/src/main/java/at/hannibal2/skyhanni/features/event/hoppity/HoppityEggDisplayManager.kt index 5c5cc41a16dd..ae6e4a584156 100644 --- a/src/main/java/at/hannibal2/skyhanni/features/event/hoppity/HoppityEggDisplayManager.kt +++ b/src/main/java/at/hannibal2/skyhanni/features/event/hoppity/HoppityEggDisplayManager.kt @@ -1,5 +1,6 @@ package at.hannibal2.skyhanni.features.event.hoppity +import at.hannibal2.skyhanni.api.event.HandleEvent import at.hannibal2.skyhanni.config.features.event.hoppity.HoppityEggsConfig.UnclaimedEggsOrder.SOONEST_FIRST import at.hannibal2.skyhanni.data.mob.MobFilter.isRealPlayer import at.hannibal2.skyhanni.events.GuiRenderEvent @@ -59,7 +60,7 @@ object HoppityEggDisplayManager { GlStateManager.disableBlend() } - @SubscribeEvent + @HandleEvent fun onRenderPlayerLayers(event: EntityRenderLayersEvent.Pre) { if (!canChangeOpacity(event.entity)) return if (!shouldHidePlayer) return diff --git a/src/main/java/at/hannibal2/skyhanni/features/event/hoppity/HoppityEggLocations.kt b/src/main/java/at/hannibal2/skyhanni/features/event/hoppity/HoppityEggLocations.kt index becaa31a801e..2a361e97dd76 100644 --- a/src/main/java/at/hannibal2/skyhanni/features/event/hoppity/HoppityEggLocations.kt +++ b/src/main/java/at/hannibal2/skyhanni/features/event/hoppity/HoppityEggLocations.kt @@ -1,5 +1,6 @@ package at.hannibal2.skyhanni.features.event.hoppity +import at.hannibal2.skyhanni.api.event.HandleEvent import at.hannibal2.skyhanni.data.IslandType import at.hannibal2.skyhanni.data.jsonobjects.repo.HoppityEggLocationsJson import at.hannibal2.skyhanni.events.LorenzRenderWorldEvent @@ -79,7 +80,7 @@ object HoppityEggLocations { loadedNeuThisProfile = false } - @SubscribeEvent + @HandleEvent fun onNeuProfileDataLoaded(event: NeuProfileDataLoadedEvent) { if (loadedNeuThisProfile || !HoppityEggsManager.config.loadFromNeuPv) return diff --git a/src/main/java/at/hannibal2/skyhanni/features/event/jerry/HighlightJerries.kt b/src/main/java/at/hannibal2/skyhanni/features/event/jerry/HighlightJerries.kt index 467cbcb2042c..9bce1c4adb2e 100644 --- a/src/main/java/at/hannibal2/skyhanni/features/event/jerry/HighlightJerries.kt +++ b/src/main/java/at/hannibal2/skyhanni/features/event/jerry/HighlightJerries.kt @@ -1,6 +1,7 @@ package at.hannibal2.skyhanni.features.event.jerry import at.hannibal2.skyhanni.SkyHanniMod +import at.hannibal2.skyhanni.api.event.HandleEvent import at.hannibal2.skyhanni.events.EntityMaxHealthUpdateEvent import at.hannibal2.skyhanni.mixins.hooks.RenderLivingEntityHelper import at.hannibal2.skyhanni.skyhannimodule.SkyHanniModule @@ -8,7 +9,6 @@ import at.hannibal2.skyhanni.utils.ColorUtils.addAlpha import at.hannibal2.skyhanni.utils.LorenzColor import at.hannibal2.skyhanni.utils.LorenzUtils import net.minecraft.entity.passive.EntityVillager -import net.minecraftforge.fml.common.eventhandler.SubscribeEvent @SkyHanniModule object HighlightJerries { @@ -27,7 +27,7 @@ object HighlightJerries { LorenzColor.LIGHT_PURPLE, ) - @SubscribeEvent + @HandleEvent fun onEntityHealthUpdate(event: EntityMaxHealthUpdateEvent) { if (!LorenzUtils.inSkyBlock) return if (!config.highlightJerries) return diff --git a/src/main/java/at/hannibal2/skyhanni/features/fishing/FishingAPI.kt b/src/main/java/at/hannibal2/skyhanni/features/fishing/FishingAPI.kt index e407a5dd4434..5f59e0943231 100644 --- a/src/main/java/at/hannibal2/skyhanni/features/fishing/FishingAPI.kt +++ b/src/main/java/at/hannibal2/skyhanni/features/fishing/FishingAPI.kt @@ -70,7 +70,7 @@ object FishingAPI { lastCastTime = SimpleTimeMark.now() bobber = event.entity bobberHasTouchedLiquid = false - FishingBobberCastEvent(event.entity).postAndCatch() + FishingBobberCastEvent(event.entity).post() } private fun resetBobber() { @@ -103,7 +103,7 @@ object FishingAPI { } bobberHasTouchedLiquid = true - FishingBobberInLiquidEvent(bobber, isWater).postAndCatch() + FishingBobberInLiquidEvent(bobber, isWater).post() } } } @@ -117,7 +117,7 @@ object FishingAPI { fun ItemStack.isBait(): Boolean = stackSize == 1 && getItemCategoryOrNull() == ItemCategory.BAIT - @SubscribeEvent + @HandleEvent fun onItemInHandChange(event: ItemInHandChangeEvent) { // TODO correct rod type per island water/lava holdingRod = event.newItem.isFishingRod() diff --git a/src/main/java/at/hannibal2/skyhanni/features/fishing/FishingBaitWarnings.kt b/src/main/java/at/hannibal2/skyhanni/features/fishing/FishingBaitWarnings.kt index 7d11f91fd7eb..651fe4636d2b 100644 --- a/src/main/java/at/hannibal2/skyhanni/features/fishing/FishingBaitWarnings.kt +++ b/src/main/java/at/hannibal2/skyhanni/features/fishing/FishingBaitWarnings.kt @@ -47,7 +47,7 @@ object FishingBaitWarnings { wasUsingBait = true } - @SubscribeEvent + @HandleEvent fun onBobber(event: FishingBobberInLiquidEvent) { if (!isEnabled()) return DelayedRun.runDelayed(500.milliseconds) { diff --git a/src/main/java/at/hannibal2/skyhanni/features/fishing/FishingHookDisplay.kt b/src/main/java/at/hannibal2/skyhanni/features/fishing/FishingHookDisplay.kt index d1f005ae490c..f0dcdb935c15 100644 --- a/src/main/java/at/hannibal2/skyhanni/features/fishing/FishingHookDisplay.kt +++ b/src/main/java/at/hannibal2/skyhanni/features/fishing/FishingHookDisplay.kt @@ -27,7 +27,7 @@ object FishingHookDisplay { reset() } - @SubscribeEvent + @HandleEvent fun onBobberThrow(event: FishingBobberCastEvent) { reset() } diff --git a/src/main/java/at/hannibal2/skyhanni/features/fishing/IsFishingDetection.kt b/src/main/java/at/hannibal2/skyhanni/features/fishing/IsFishingDetection.kt index 4bd6d170cd6c..84a6981f2a2d 100644 --- a/src/main/java/at/hannibal2/skyhanni/features/fishing/IsFishingDetection.kt +++ b/src/main/java/at/hannibal2/skyhanni/features/fishing/IsFishingDetection.kt @@ -1,5 +1,6 @@ package at.hannibal2.skyhanni.features.fishing +import at.hannibal2.skyhanni.api.event.HandleEvent import at.hannibal2.skyhanni.events.FishingBobberInLiquidEvent import at.hannibal2.skyhanni.events.LorenzTickEvent import at.hannibal2.skyhanni.skyhannimodule.SkyHanniModule @@ -25,7 +26,7 @@ object IsFishingDetection { private var lastSeaCreatureKillArea: LorenzVec? = null private var lastSeaCreatureKillAreaTime = SimpleTimeMark.farPast() - @SubscribeEvent + @HandleEvent fun onBobber(event: FishingBobberInLiquidEvent) { lastRodCastLocation = LocationUtils.playerLocation() lastRodCastTime = SimpleTimeMark.now() diff --git a/src/main/java/at/hannibal2/skyhanni/features/fishing/tracker/FishingProfitTracker.kt b/src/main/java/at/hannibal2/skyhanni/features/fishing/tracker/FishingProfitTracker.kt index fcf400410c08..cd9e8e9ec10b 100644 --- a/src/main/java/at/hannibal2/skyhanni/features/fishing/tracker/FishingProfitTracker.kt +++ b/src/main/java/at/hannibal2/skyhanni/features/fishing/tracker/FishingProfitTracker.kt @@ -1,6 +1,7 @@ package at.hannibal2.skyhanni.features.fishing.tracker import at.hannibal2.skyhanni.SkyHanniMod +import at.hannibal2.skyhanni.api.event.HandleEvent import at.hannibal2.skyhanni.data.ItemAddManager import at.hannibal2.skyhanni.data.jsonobjects.repo.FishingProfitItemsJson import at.hannibal2.skyhanni.events.FishingBobberCastEvent @@ -186,7 +187,7 @@ object FishingProfitTracker { } } - @SubscribeEvent + @HandleEvent fun onItemAdd(event: ItemAddEvent) { if (!isEnabled()) return @@ -243,7 +244,7 @@ object FishingProfitTracker { private fun isAllowedItem(internalName: NEUInternalName) = itemCategories.any { internalName in it.value } - @SubscribeEvent + @HandleEvent fun onBobberThrow(event: FishingBobberCastEvent) { tracker.firstUpdate() } diff --git a/src/main/java/at/hannibal2/skyhanni/features/fishing/tracker/SeaCreatureTracker.kt b/src/main/java/at/hannibal2/skyhanni/features/fishing/tracker/SeaCreatureTracker.kt index e106858012de..0b8e2c3559e8 100644 --- a/src/main/java/at/hannibal2/skyhanni/features/fishing/tracker/SeaCreatureTracker.kt +++ b/src/main/java/at/hannibal2/skyhanni/features/fishing/tracker/SeaCreatureTracker.kt @@ -1,6 +1,7 @@ package at.hannibal2.skyhanni.features.fishing.tracker import at.hannibal2.skyhanni.SkyHanniMod +import at.hannibal2.skyhanni.api.event.HandleEvent import at.hannibal2.skyhanni.events.ConfigLoadEvent import at.hannibal2.skyhanni.events.FishingBobberCastEvent import at.hannibal2.skyhanni.events.GuiRenderEvent @@ -174,7 +175,7 @@ object SeaCreatureTracker { } } - @SubscribeEvent + @HandleEvent fun onBobberThrow(event: FishingBobberCastEvent) { tracker.firstUpdate() } diff --git a/src/main/java/at/hannibal2/skyhanni/features/fishing/trophy/GoldenFishTimer.kt b/src/main/java/at/hannibal2/skyhanni/features/fishing/trophy/GoldenFishTimer.kt index b5b1abf6d10d..578488015a99 100644 --- a/src/main/java/at/hannibal2/skyhanni/features/fishing/trophy/GoldenFishTimer.kt +++ b/src/main/java/at/hannibal2/skyhanni/features/fishing/trophy/GoldenFishTimer.kt @@ -1,6 +1,7 @@ package at.hannibal2.skyhanni.features.fishing.trophy import at.hannibal2.skyhanni.SkyHanniMod +import at.hannibal2.skyhanni.api.event.HandleEvent import at.hannibal2.skyhanni.data.IslandType import at.hannibal2.skyhanni.data.TitleManager import at.hannibal2.skyhanni.events.DebugDataCollectEvent @@ -276,14 +277,14 @@ object GoldenFishTimer { } } - @SubscribeEvent + @HandleEvent fun onBobberThrow(event: FishingBobberCastEvent) { if (!isActive()) return goingDownInit = true goingDownPost = false } - @SubscribeEvent + @HandleEvent fun onEntityHealthUpdate(event: EntityMaxHealthUpdateEvent) { if (!isActive()) return if (isGoldenFishActive()) return diff --git a/src/main/java/at/hannibal2/skyhanni/features/fishing/trophy/TrophyFishManager.kt b/src/main/java/at/hannibal2/skyhanni/features/fishing/trophy/TrophyFishManager.kt index 4b91b6240243..584312c4f7b7 100644 --- a/src/main/java/at/hannibal2/skyhanni/features/fishing/trophy/TrophyFishManager.kt +++ b/src/main/java/at/hannibal2/skyhanni/features/fishing/trophy/TrophyFishManager.kt @@ -1,6 +1,7 @@ package at.hannibal2.skyhanni.features.fishing.trophy import at.hannibal2.skyhanni.SkyHanniMod +import at.hannibal2.skyhanni.api.event.HandleEvent import at.hannibal2.skyhanni.data.ProfileStorageData import at.hannibal2.skyhanni.data.jsonobjects.repo.TrophyFishInfo import at.hannibal2.skyhanni.data.jsonobjects.repo.TrophyFishJson @@ -28,7 +29,7 @@ object TrophyFishManager { private var loadedNeu = false - @SubscribeEvent + @HandleEvent fun onNeuProfileDataLoaded(event: NeuProfileDataLoadedEvent) { if (loadedNeu || !config.loadFromNeuPV) return diff --git a/src/main/java/at/hannibal2/skyhanni/features/garden/FarmingFortuneDisplay.kt b/src/main/java/at/hannibal2/skyhanni/features/garden/FarmingFortuneDisplay.kt index a4eb2ef0a47f..9f4adefdd98f 100644 --- a/src/main/java/at/hannibal2/skyhanni/features/garden/FarmingFortuneDisplay.kt +++ b/src/main/java/at/hannibal2/skyhanni/features/garden/FarmingFortuneDisplay.kt @@ -1,5 +1,6 @@ package at.hannibal2.skyhanni.features.garden +import at.hannibal2.skyhanni.api.event.HandleEvent import at.hannibal2.skyhanni.config.ConfigUpdaterMigrator import at.hannibal2.skyhanni.data.GardenCropMilestones import at.hannibal2.skyhanni.data.GardenCropMilestones.getCounter @@ -133,7 +134,7 @@ object FarmingFortuneDisplay { } } - @SubscribeEvent + @HandleEvent fun onGardenToolChange(event: GardenToolChangeEvent) { lastToolSwitch = SimpleTimeMark.now() } @@ -250,7 +251,7 @@ object FarmingFortuneDisplay { } } - @SubscribeEvent + @HandleEvent fun onCropClick(event: CropClickEvent) { if (firstBrokenCropTime == SimpleTimeMark.farPast()) firstBrokenCropTime = SimpleTimeMark.now() } diff --git a/src/main/java/at/hannibal2/skyhanni/features/garden/GardenAPI.kt b/src/main/java/at/hannibal2/skyhanni/features/garden/GardenAPI.kt index 460b112540c6..ebcc82491e4c 100644 --- a/src/main/java/at/hannibal2/skyhanni/features/garden/GardenAPI.kt +++ b/src/main/java/at/hannibal2/skyhanni/features/garden/GardenAPI.kt @@ -130,7 +130,7 @@ object GardenAPI { } private fun updateGardenTool() { - GardenToolChangeEvent(cropInHand, itemInHand).postAndCatch() + GardenToolChangeEvent(cropInHand, itemInHand).post() } private fun checkItemInHand() { @@ -231,7 +231,7 @@ object GardenAPI { } lastLocation = position - CropClickEvent(position, cropBroken, blockState, event.clickType, event.itemInHand).postAndCatch() + CropClickEvent(position, cropBroken, blockState, event.clickType, event.itemInHand).post() } fun getExpForLevel(requestedLevel: Int): Long { diff --git a/src/main/java/at/hannibal2/skyhanni/features/garden/GardenOptimalSpeed.kt b/src/main/java/at/hannibal2/skyhanni/features/garden/GardenOptimalSpeed.kt index 6a32e54ef044..e692aad39f48 100644 --- a/src/main/java/at/hannibal2/skyhanni/features/garden/GardenOptimalSpeed.kt +++ b/src/main/java/at/hannibal2/skyhanni/features/garden/GardenOptimalSpeed.kt @@ -1,5 +1,6 @@ package at.hannibal2.skyhanni.features.garden +import at.hannibal2.skyhanni.api.event.HandleEvent import at.hannibal2.skyhanni.config.ConfigUpdaterMigrator import at.hannibal2.skyhanni.events.ConfigLoadEvent import at.hannibal2.skyhanni.events.GardenToolChangeEvent @@ -120,7 +121,7 @@ object GardenOptimalSpeed { ) } - @SubscribeEvent + @HandleEvent fun onGardenToolChange(event: GardenToolChangeEvent) { lastToolSwitch = SimpleTimeMark.now() cropInHand = event.crop diff --git a/src/main/java/at/hannibal2/skyhanni/features/garden/GardenYawAndPitch.kt b/src/main/java/at/hannibal2/skyhanni/features/garden/GardenYawAndPitch.kt index ef1aaa1bd9c4..73cf8634ac06 100755 --- a/src/main/java/at/hannibal2/skyhanni/features/garden/GardenYawAndPitch.kt +++ b/src/main/java/at/hannibal2/skyhanni/features/garden/GardenYawAndPitch.kt @@ -1,5 +1,6 @@ package at.hannibal2.skyhanni.features.garden +import at.hannibal2.skyhanni.api.event.HandleEvent import at.hannibal2.skyhanni.config.ConfigUpdaterMigrator import at.hannibal2.skyhanni.config.enums.OutsideSbFeature import at.hannibal2.skyhanni.events.GardenToolChangeEvent @@ -54,7 +55,7 @@ object GardenYawAndPitch { } } - @SubscribeEvent + @HandleEvent fun onGardenToolChange(event: GardenToolChangeEvent) { lastChange = SimpleTimeMark.farPast() } diff --git a/src/main/java/at/hannibal2/skyhanni/features/garden/SensitivityReducer.kt b/src/main/java/at/hannibal2/skyhanni/features/garden/SensitivityReducer.kt index 2f982e52caad..60d61a2fb09b 100644 --- a/src/main/java/at/hannibal2/skyhanni/features/garden/SensitivityReducer.kt +++ b/src/main/java/at/hannibal2/skyhanni/features/garden/SensitivityReducer.kt @@ -1,6 +1,7 @@ package at.hannibal2.skyhanni.features.garden import at.hannibal2.skyhanni.SkyHanniMod +import at.hannibal2.skyhanni.api.event.HandleEvent import at.hannibal2.skyhanni.config.features.garden.SensitivityReducerConfig import at.hannibal2.skyhanni.events.ConfigLoadEvent import at.hannibal2.skyhanni.events.DebugDataCollectEvent @@ -169,7 +170,7 @@ object SensitivityReducer { else (divisor * (input - LOCKED)) + LOCKED } - @SubscribeEvent + @HandleEvent fun onHypixelJoin(event: HypixelJoinEvent) { val divisor = config.reducingFactor.get() val expectedLoweredSensitivity = doTheMath(gameSettings.mouseSensitivity, true) diff --git a/src/main/java/at/hannibal2/skyhanni/features/garden/contest/FarmingContestAPI.kt b/src/main/java/at/hannibal2/skyhanni/features/garden/contest/FarmingContestAPI.kt index fef892f0633f..bef037e8a6fd 100644 --- a/src/main/java/at/hannibal2/skyhanni/features/garden/contest/FarmingContestAPI.kt +++ b/src/main/java/at/hannibal2/skyhanni/features/garden/contest/FarmingContestAPI.kt @@ -63,7 +63,7 @@ object FarmingContestAPI { if (!LorenzUtils.inSkyBlock) return if (internalContest && startTime.passedSince() > 20.minutes) { - FarmingContestEvent(contestCrop!!, FarmingContestPhase.STOP).postAndCatch() + FarmingContestEvent(contestCrop!!, FarmingContestPhase.STOP).post() internalContest = false } @@ -78,17 +78,17 @@ object FarmingContestAPI { if (inContest != currentContest) { if (currentContest) { - FarmingContestEvent(currentCrop!!, FarmingContestPhase.START).postAndCatch() + FarmingContestEvent(currentCrop!!, FarmingContestPhase.START).post() startTime = SimpleTimeMark.now() } else { if (startTime.passedSince() > 2.minutes) { - FarmingContestEvent(contestCrop!!, FarmingContestPhase.STOP).postAndCatch() + FarmingContestEvent(contestCrop!!, FarmingContestPhase.STOP).post() } } internalContest = currentContest } else { if (currentCrop != contestCrop && currentCrop != null) { - FarmingContestEvent(currentCrop, FarmingContestPhase.CHANGE).postAndCatch() + FarmingContestEvent(currentCrop, FarmingContestPhase.CHANGE).post() startTime = SimpleTimeMark.now() } } diff --git a/src/main/java/at/hannibal2/skyhanni/features/garden/contest/JacobContestStatsSummary.kt b/src/main/java/at/hannibal2/skyhanni/features/garden/contest/JacobContestStatsSummary.kt index 144abc0c2486..65255ff0f533 100644 --- a/src/main/java/at/hannibal2/skyhanni/features/garden/contest/JacobContestStatsSummary.kt +++ b/src/main/java/at/hannibal2/skyhanni/features/garden/contest/JacobContestStatsSummary.kt @@ -1,5 +1,6 @@ package at.hannibal2.skyhanni.features.garden.contest +import at.hannibal2.skyhanni.api.event.HandleEvent import at.hannibal2.skyhanni.data.ClickType import at.hannibal2.skyhanni.events.CropClickEvent import at.hannibal2.skyhanni.events.FarmingContestEvent @@ -10,7 +11,6 @@ import at.hannibal2.skyhanni.utils.NumberUtil.addSeparators import at.hannibal2.skyhanni.utils.NumberUtil.roundTo import at.hannibal2.skyhanni.utils.SimpleTimeMark import at.hannibal2.skyhanni.utils.TimeUtils.format -import net.minecraftforge.fml.common.eventhandler.SubscribeEvent @SkyHanniModule object JacobContestStatsSummary { @@ -19,7 +19,7 @@ object JacobContestStatsSummary { private var blocksBroken = 0 private var startTime = SimpleTimeMark.farPast() - @SubscribeEvent + @HandleEvent fun onCropClick(event: CropClickEvent) { if (!isEnabled()) return if (event.clickType != ClickType.LEFT_CLICK) return @@ -29,7 +29,7 @@ object JacobContestStatsSummary { } } - @SubscribeEvent + @HandleEvent fun onFarmingContest(event: FarmingContestEvent) { if (!isEnabled()) return diff --git a/src/main/java/at/hannibal2/skyhanni/features/garden/contest/JacobFarmingContestsInventory.kt b/src/main/java/at/hannibal2/skyhanni/features/garden/contest/JacobFarmingContestsInventory.kt index 3cbf7d4f89e8..a4fd33c6dcea 100644 --- a/src/main/java/at/hannibal2/skyhanni/features/garden/contest/JacobFarmingContestsInventory.kt +++ b/src/main/java/at/hannibal2/skyhanni/features/garden/contest/JacobFarmingContestsInventory.kt @@ -1,6 +1,7 @@ package at.hannibal2.skyhanni.features.garden.contest import at.hannibal2.skyhanni.SkyHanniMod +import at.hannibal2.skyhanni.api.event.HandleEvent import at.hannibal2.skyhanni.config.ConfigUpdaterMigrator import at.hannibal2.skyhanni.data.HypixelData import at.hannibal2.skyhanni.events.GuiContainerEvent @@ -196,7 +197,7 @@ object JacobFarmingContestsInventory { } } - @SubscribeEvent + @HandleEvent fun onRenderItemOverlayPost(event: GuiRenderItemEvent.RenderOverlayEvent.GuiRenderItemPost) { if (!LorenzUtils.inSkyBlock) return if (!config.medalIcon) return diff --git a/src/main/java/at/hannibal2/skyhanni/features/garden/farming/CropMoneyDisplay.kt b/src/main/java/at/hannibal2/skyhanni/features/garden/farming/CropMoneyDisplay.kt index 5026d7b88b8d..ae01d2dd03fe 100644 --- a/src/main/java/at/hannibal2/skyhanni/features/garden/farming/CropMoneyDisplay.kt +++ b/src/main/java/at/hannibal2/skyhanni/features/garden/farming/CropMoneyDisplay.kt @@ -1,6 +1,7 @@ package at.hannibal2.skyhanni.features.garden.farming import at.hannibal2.skyhanni.SkyHanniMod +import at.hannibal2.skyhanni.api.event.HandleEvent import at.hannibal2.skyhanni.config.ConfigUpdaterMigrator import at.hannibal2.skyhanni.config.features.garden.MoneyPerHourConfig.CustomFormatEntry import at.hannibal2.skyhanni.events.GardenToolChangeEvent @@ -78,7 +79,7 @@ object CropMoneyDisplay { } } - @SubscribeEvent + @HandleEvent fun onGardenToolChange(event: GardenToolChangeEvent) { update() } diff --git a/src/main/java/at/hannibal2/skyhanni/features/garden/farming/CropSpeedMeter.kt b/src/main/java/at/hannibal2/skyhanni/features/garden/farming/CropSpeedMeter.kt index 924ea00f7f8d..1b5fdbdda186 100644 --- a/src/main/java/at/hannibal2/skyhanni/features/garden/farming/CropSpeedMeter.kt +++ b/src/main/java/at/hannibal2/skyhanni/features/garden/farming/CropSpeedMeter.kt @@ -26,7 +26,7 @@ object CropSpeedMeter { var enabled = false private var startCrops = mapOf() - @SubscribeEvent + @HandleEvent fun onCropClick(event: CropClickEvent) { if (!isEnabled()) return if (startCrops.isEmpty()) return diff --git a/src/main/java/at/hannibal2/skyhanni/features/garden/farming/DicerRngDropTracker.kt b/src/main/java/at/hannibal2/skyhanni/features/garden/farming/DicerRngDropTracker.kt index f44e54f6710b..a1b142425667 100644 --- a/src/main/java/at/hannibal2/skyhanni/features/garden/farming/DicerRngDropTracker.kt +++ b/src/main/java/at/hannibal2/skyhanni/features/garden/farming/DicerRngDropTracker.kt @@ -1,5 +1,6 @@ package at.hannibal2.skyhanni.features.garden.farming +import at.hannibal2.skyhanni.api.event.HandleEvent import at.hannibal2.skyhanni.config.ConfigManager import at.hannibal2.skyhanni.config.ConfigUpdaterMigrator import at.hannibal2.skyhanni.events.ConfigLoadEvent @@ -151,7 +152,7 @@ object DicerRngDropTracker { private var cropInHand: CropType? = null private var toolName = "" - @SubscribeEvent + @HandleEvent fun onGardenToolChange(event: GardenToolChangeEvent) { val crop = event.crop cropInHand = if (crop == CropType.MELON || crop == CropType.PUMPKIN) crop else null diff --git a/src/main/java/at/hannibal2/skyhanni/features/garden/farming/FarmingWeightDisplay.kt b/src/main/java/at/hannibal2/skyhanni/features/garden/farming/FarmingWeightDisplay.kt index 3622ca9070dd..e8a998b2f44f 100644 --- a/src/main/java/at/hannibal2/skyhanni/features/garden/farming/FarmingWeightDisplay.kt +++ b/src/main/java/at/hannibal2/skyhanni/features/garden/farming/FarmingWeightDisplay.kt @@ -1,6 +1,7 @@ package at.hannibal2.skyhanni.features.garden.farming import at.hannibal2.skyhanni.SkyHanniMod +import at.hannibal2.skyhanni.api.event.HandleEvent import at.hannibal2.skyhanni.config.ConfigUpdaterMigrator import at.hannibal2.skyhanni.config.enums.OutsideSbFeature import at.hannibal2.skyhanni.data.HypixelData @@ -52,7 +53,7 @@ object FarmingWeightDisplay { } } - @SubscribeEvent + @HandleEvent fun onGardenToolChange(event: GardenToolChangeEvent) { // Reset speed weightPerSecond = -1.0 diff --git a/src/main/java/at/hannibal2/skyhanni/features/garden/farming/GardenCropSpeed.kt b/src/main/java/at/hannibal2/skyhanni/features/garden/farming/GardenCropSpeed.kt index 7c6cf2b80302..dce5b90d771e 100644 --- a/src/main/java/at/hannibal2/skyhanni/features/garden/farming/GardenCropSpeed.kt +++ b/src/main/java/at/hannibal2/skyhanni/features/garden/farming/GardenCropSpeed.kt @@ -1,5 +1,6 @@ package at.hannibal2.skyhanni.features.garden.farming +import at.hannibal2.skyhanni.api.event.HandleEvent import at.hannibal2.skyhanni.config.ConfigUpdaterMigrator import at.hannibal2.skyhanni.data.ClickType import at.hannibal2.skyhanni.data.GardenCropMilestones.getCounter @@ -61,7 +62,7 @@ object GardenCropSpeed { lastBrokenCrop = null } - @SubscribeEvent + @HandleEvent fun onGardenToolChange(event: GardenToolChangeEvent) { if (isEnabled()) { resetSpeed() @@ -73,7 +74,7 @@ object GardenCropSpeed { GardenCropMilestoneDisplay.update() } - @SubscribeEvent + @HandleEvent fun onCropClick(event: CropClickEvent) { if (event.clickType != ClickType.LEFT_CLICK) return diff --git a/src/main/java/at/hannibal2/skyhanni/features/garden/farming/GardenStartLocation.kt b/src/main/java/at/hannibal2/skyhanni/features/garden/farming/GardenStartLocation.kt index ba422d0f2eab..e0b53eb9a259 100644 --- a/src/main/java/at/hannibal2/skyhanni/features/garden/farming/GardenStartLocation.kt +++ b/src/main/java/at/hannibal2/skyhanni/features/garden/farming/GardenStartLocation.kt @@ -1,5 +1,6 @@ package at.hannibal2.skyhanni.features.garden.farming +import at.hannibal2.skyhanni.api.event.HandleEvent import at.hannibal2.skyhanni.config.features.garden.CropStartLocationConfig.CropLocationMode import at.hannibal2.skyhanni.data.ClickType import at.hannibal2.skyhanni.events.CropClickEvent @@ -49,7 +50,7 @@ object GardenStartLocation { ChatUtils.chat("You changed your Crop Start Location for ${crop.cropName}!") } - @SubscribeEvent + @HandleEvent fun onCropClick(event: CropClickEvent) { if (!isEnabled()) return if (event.clickType != ClickType.LEFT_CLICK || !GardenAPI.hasFarmingToolInHand()) return diff --git a/src/main/java/at/hannibal2/skyhanni/features/garden/farming/WrongFungiCutterWarning.kt b/src/main/java/at/hannibal2/skyhanni/features/garden/farming/WrongFungiCutterWarning.kt index 9bc0fc051f36..c59726870d62 100644 --- a/src/main/java/at/hannibal2/skyhanni/features/garden/farming/WrongFungiCutterWarning.kt +++ b/src/main/java/at/hannibal2/skyhanni/features/garden/farming/WrongFungiCutterWarning.kt @@ -1,5 +1,6 @@ package at.hannibal2.skyhanni.features.garden.farming +import at.hannibal2.skyhanni.api.event.HandleEvent import at.hannibal2.skyhanni.data.ClickType import at.hannibal2.skyhanni.events.CropClickEvent import at.hannibal2.skyhanni.events.GardenToolChangeEvent @@ -31,7 +32,7 @@ object WrongFungiCutterWarning { } } - @SubscribeEvent + @HandleEvent fun onCropClick(event: CropClickEvent) { if (event.clickType != ClickType.LEFT_CLICK) return if (event.crop != CropType.MUSHROOM) return @@ -55,7 +56,7 @@ object WrongFungiCutterWarning { } } - @SubscribeEvent + @HandleEvent fun onGardenToolChange(event: GardenToolChangeEvent) { if (event.crop == CropType.MUSHROOM) { readItem(event.toolItem ?: error("Tool item is null")) diff --git a/src/main/java/at/hannibal2/skyhanni/features/garden/farming/lane/FarmingLaneAPI.kt b/src/main/java/at/hannibal2/skyhanni/features/garden/farming/lane/FarmingLaneAPI.kt index b9b091e53a27..260af540aab2 100644 --- a/src/main/java/at/hannibal2/skyhanni/features/garden/farming/lane/FarmingLaneAPI.kt +++ b/src/main/java/at/hannibal2/skyhanni/features/garden/farming/lane/FarmingLaneAPI.kt @@ -1,5 +1,6 @@ package at.hannibal2.skyhanni.features.garden.farming.lane +import at.hannibal2.skyhanni.api.event.HandleEvent import at.hannibal2.skyhanni.events.CropClickEvent import at.hannibal2.skyhanni.events.GardenToolChangeEvent import at.hannibal2.skyhanni.events.garden.farming.FarmingLaneSwitchEvent @@ -9,7 +10,6 @@ import at.hannibal2.skyhanni.skyhannimodule.SkyHanniModule import at.hannibal2.skyhanni.utils.ChatUtils import at.hannibal2.skyhanni.utils.LorenzVec import at.hannibal2.skyhanni.utils.SimpleTimeMark -import net.minecraftforge.fml.common.eventhandler.SubscribeEvent import kotlin.time.Duration.Companion.seconds @SkyHanniModule @@ -20,12 +20,12 @@ object FarmingLaneAPI { var currentLane: FarmingLane? = null private var lastNoLaneWarning = SimpleTimeMark.farPast() - @SubscribeEvent + @HandleEvent fun onGardenToolChange(event: GardenToolChangeEvent) { currentLane = null } - @SubscribeEvent + @HandleEvent fun onCropClick(event: CropClickEvent) { val crop = event.crop if (!GardenAPI.hasFarmingToolInHand()) return diff --git a/src/main/java/at/hannibal2/skyhanni/features/garden/farming/lane/FarmingLaneCreator.kt b/src/main/java/at/hannibal2/skyhanni/features/garden/farming/lane/FarmingLaneCreator.kt index d9d7a53c9f65..a69ecfb4eb5d 100644 --- a/src/main/java/at/hannibal2/skyhanni/features/garden/farming/lane/FarmingLaneCreator.kt +++ b/src/main/java/at/hannibal2/skyhanni/features/garden/farming/lane/FarmingLaneCreator.kt @@ -1,5 +1,6 @@ package at.hannibal2.skyhanni.features.garden.farming.lane +import at.hannibal2.skyhanni.api.event.HandleEvent import at.hannibal2.skyhanni.events.CropClickEvent import at.hannibal2.skyhanni.events.LorenzRenderWorldEvent import at.hannibal2.skyhanni.features.garden.CropType @@ -37,7 +38,7 @@ object FarmingLaneCreator { } } - @SubscribeEvent + @HandleEvent fun onCropClick(event: CropClickEvent) { if (!isEnabled()) return diff --git a/src/main/java/at/hannibal2/skyhanni/features/garden/farming/lane/FarmingLaneFeatures.kt b/src/main/java/at/hannibal2/skyhanni/features/garden/farming/lane/FarmingLaneFeatures.kt index ce4ce6a9f8c9..c273674cb7ce 100644 --- a/src/main/java/at/hannibal2/skyhanni/features/garden/farming/lane/FarmingLaneFeatures.kt +++ b/src/main/java/at/hannibal2/skyhanni/features/garden/farming/lane/FarmingLaneFeatures.kt @@ -56,7 +56,7 @@ object FarmingLaneFeatures { display = emptyList() } - @SubscribeEvent + @HandleEvent fun onGardenToolChange(event: GardenToolChangeEvent) { display = emptyList() } diff --git a/src/main/java/at/hannibal2/skyhanni/features/garden/fortuneguide/CaptureFarmingGear.kt b/src/main/java/at/hannibal2/skyhanni/features/garden/fortuneguide/CaptureFarmingGear.kt index 89856129a579..630e0a227e85 100644 --- a/src/main/java/at/hannibal2/skyhanni/features/garden/fortuneguide/CaptureFarmingGear.kt +++ b/src/main/java/at/hannibal2/skyhanni/features/garden/fortuneguide/CaptureFarmingGear.kt @@ -1,5 +1,6 @@ package at.hannibal2.skyhanni.features.garden.fortuneguide +import at.hannibal2.skyhanni.api.event.HandleEvent import at.hannibal2.skyhanni.config.ConfigUpdaterMigrator import at.hannibal2.skyhanni.config.storage.ProfileSpecificStorage import at.hannibal2.skyhanni.data.PetAPI @@ -163,7 +164,7 @@ object CaptureFarmingGear { } } - @SubscribeEvent + @HandleEvent fun onGardenToolChange(event: GardenToolChangeEvent) { captureFarmingGear() } diff --git a/src/main/java/at/hannibal2/skyhanni/features/garden/inventory/plots/GardenPlotIcon.kt b/src/main/java/at/hannibal2/skyhanni/features/garden/inventory/plots/GardenPlotIcon.kt index a43a3a34f81d..09f73fc6d4bb 100644 --- a/src/main/java/at/hannibal2/skyhanni/features/garden/inventory/plots/GardenPlotIcon.kt +++ b/src/main/java/at/hannibal2/skyhanni/features/garden/inventory/plots/GardenPlotIcon.kt @@ -1,5 +1,6 @@ package at.hannibal2.skyhanni.features.garden.inventory.plots +import at.hannibal2.skyhanni.api.event.HandleEvent import at.hannibal2.skyhanni.events.GuiContainerEvent import at.hannibal2.skyhanni.events.InventoryCloseEvent import at.hannibal2.skyhanni.events.InventoryFullyOpenedEvent @@ -61,7 +62,7 @@ object GardenPlotIcon { editMode = 0 } - @SubscribeEvent(priority = EventPriority.HIGH) + @HandleEvent(priority = HandleEvent.HIGH) fun replaceItem(event: ReplaceItemEvent) { if (!isEnabled()) return val plotList = plotList ?: return diff --git a/src/main/java/at/hannibal2/skyhanni/features/garden/pests/PestAPI.kt b/src/main/java/at/hannibal2/skyhanni/features/garden/pests/PestAPI.kt index 136c0d5e4c5e..d83b76457fc1 100644 --- a/src/main/java/at/hannibal2/skyhanni/features/garden/pests/PestAPI.kt +++ b/src/main/java/at/hannibal2/skyhanni/features/garden/pests/PestAPI.kt @@ -278,7 +278,7 @@ object PestAPI { firstScoreboardCheck = false } - @SubscribeEvent + @HandleEvent fun onItemInHandChange(event: ItemInHandChangeEvent) { if (!GardenAPI.inGarden()) return if (event.oldItem !in vacuumVariants) return diff --git a/src/main/java/at/hannibal2/skyhanni/features/garden/pests/PestProfitTracker.kt b/src/main/java/at/hannibal2/skyhanni/features/garden/pests/PestProfitTracker.kt index 19506109ec9e..f7809f6ef5c2 100644 --- a/src/main/java/at/hannibal2/skyhanni/features/garden/pests/PestProfitTracker.kt +++ b/src/main/java/at/hannibal2/skyhanni/features/garden/pests/PestProfitTracker.kt @@ -1,6 +1,7 @@ package at.hannibal2.skyhanni.features.garden.pests import at.hannibal2.skyhanni.SkyHanniMod +import at.hannibal2.skyhanni.api.event.HandleEvent import at.hannibal2.skyhanni.data.IslandType import at.hannibal2.skyhanni.data.ItemAddManager import at.hannibal2.skyhanni.events.GuiRenderEvent @@ -79,7 +80,7 @@ object PestProfitTracker { var totalPestsKills = 0L } - @SubscribeEvent + @HandleEvent fun onItemAdd(event: ItemAddEvent) { if (!isEnabled()) return diff --git a/src/main/java/at/hannibal2/skyhanni/features/garden/visitor/GardenVisitorDropStatistics.kt b/src/main/java/at/hannibal2/skyhanni/features/garden/visitor/GardenVisitorDropStatistics.kt index 38617a5c634b..8b4735f61237 100644 --- a/src/main/java/at/hannibal2/skyhanni/features/garden/visitor/GardenVisitorDropStatistics.kt +++ b/src/main/java/at/hannibal2/skyhanni/features/garden/visitor/GardenVisitorDropStatistics.kt @@ -1,5 +1,6 @@ package at.hannibal2.skyhanni.features.garden.visitor +import at.hannibal2.skyhanni.api.event.HandleEvent import at.hannibal2.skyhanni.config.ConfigUpdaterMigrator import at.hannibal2.skyhanni.config.features.garden.visitor.DropsStatisticsConfig.DropsStatisticsTextEntry import at.hannibal2.skyhanni.config.storage.ProfileSpecificStorage @@ -117,7 +118,7 @@ object GardenVisitorDropStatistics { display = emptyList() } - @SubscribeEvent + @HandleEvent fun onVisitorAccept(event: VisitorAcceptEvent) { if (!GardenAPI.onBarnPlot) return if (!ProfileStorageData.loaded) return diff --git a/src/main/java/at/hannibal2/skyhanni/features/garden/visitor/GardenVisitorFeatures.kt b/src/main/java/at/hannibal2/skyhanni/features/garden/visitor/GardenVisitorFeatures.kt index a23705ed8c02..fd740459a958 100644 --- a/src/main/java/at/hannibal2/skyhanni/features/garden/visitor/GardenVisitorFeatures.kt +++ b/src/main/java/at/hannibal2/skyhanni/features/garden/visitor/GardenVisitorFeatures.kt @@ -129,7 +129,7 @@ object GardenVisitorFeatures { display = emptyList() } - @SubscribeEvent + @HandleEvent fun onVisitorOpen(event: VisitorOpenEvent) { val visitor = event.visitor val offerItem = visitor.offer?.offerItem ?: return @@ -356,22 +356,22 @@ object GardenVisitorFeatures { update() } - @SubscribeEvent + @HandleEvent fun onVisitorRefused(event: VisitorRefusedEvent) { update() GardenVisitorDropStatistics.deniedVisitors += 1 GardenVisitorDropStatistics.saveAndUpdate() } - @SubscribeEvent + @HandleEvent fun onVisitorAccepted(event: VisitorAcceptedEvent) { - VisitorAcceptEvent(event.visitor).postAndCatch() + VisitorAcceptEvent(event.visitor).post() update() GardenVisitorDropStatistics.coinsSpent += round(lastFullPrice).toLong() GardenVisitorDropStatistics.lastAccept = SimpleTimeMark.now() } - @SubscribeEvent + @HandleEvent fun onVisitorRender(event: VisitorRenderEvent) { val visitor = event.visitor val text = visitor.status.displayName @@ -516,7 +516,7 @@ object GardenVisitorFeatures { } } - @SubscribeEvent + @HandleEvent fun onVisitorArrival(event: VisitorArrivalEvent) { val visitor = event.visitor val name = visitor.visitorName diff --git a/src/main/java/at/hannibal2/skyhanni/features/garden/visitor/GardenVisitorSupercraft.kt b/src/main/java/at/hannibal2/skyhanni/features/garden/visitor/GardenVisitorSupercraft.kt index 86bf196a31fb..a8908e45ceb2 100644 --- a/src/main/java/at/hannibal2/skyhanni/features/garden/visitor/GardenVisitorSupercraft.kt +++ b/src/main/java/at/hannibal2/skyhanni/features/garden/visitor/GardenVisitorSupercraft.kt @@ -1,5 +1,6 @@ package at.hannibal2.skyhanni.features.garden.visitor +import at.hannibal2.skyhanni.api.event.HandleEvent import at.hannibal2.skyhanni.data.SackAPI.getAmountInSacks import at.hannibal2.skyhanni.events.GuiContainerEvent import at.hannibal2.skyhanni.events.InventoryCloseEvent @@ -50,7 +51,7 @@ object GardenVisitorSupercraft { } // needs to run later than onVisitorOpen at GardenVisitorFeatures - @SubscribeEvent(priority = EventPriority.LOW) + @HandleEvent(priority = HandleEvent.LOW) fun onVisitorOpen(event: VisitorOpenEvent) { val visitor = event.visitor visitor.offer?.offerItem ?: return @@ -92,7 +93,7 @@ object GardenVisitorSupercraft { } } - @SubscribeEvent + @HandleEvent fun replaceItem(event: ReplaceItemEvent) { if (!hasIngredients) return if (event.inventory is InventoryPlayer) return diff --git a/src/main/java/at/hannibal2/skyhanni/features/garden/visitor/GardenVisitorTimer.kt b/src/main/java/at/hannibal2/skyhanni/features/garden/visitor/GardenVisitorTimer.kt index e45500710efd..02a46585904c 100644 --- a/src/main/java/at/hannibal2/skyhanni/features/garden/visitor/GardenVisitorTimer.kt +++ b/src/main/java/at/hannibal2/skyhanni/features/garden/visitor/GardenVisitorTimer.kt @@ -1,5 +1,6 @@ package at.hannibal2.skyhanni.features.garden.visitor +import at.hannibal2.skyhanni.api.event.HandleEvent import at.hannibal2.skyhanni.config.ConfigUpdaterMigrator import at.hannibal2.skyhanni.events.CropClickEvent import at.hannibal2.skyhanni.events.GuiRenderEvent @@ -64,7 +65,7 @@ object GardenVisitorTimer { } } - @SubscribeEvent + @HandleEvent fun onVisitorArrival(event: VisitorArrivalEvent) { visitorJustArrived = true } @@ -203,7 +204,7 @@ object GardenVisitorTimer { lastMillis = sixthVisitorArrivalTime.timeUntil() } - @SubscribeEvent + @HandleEvent fun onCropClick(event: CropClickEvent) { if (!isEnabled()) return sixthVisitorArrivalTime -= 100.milliseconds diff --git a/src/main/java/at/hannibal2/skyhanni/features/garden/visitor/NPCVisitorFix.kt b/src/main/java/at/hannibal2/skyhanni/features/garden/visitor/NPCVisitorFix.kt index 06b7b3f7ffcd..71e48f635c20 100644 --- a/src/main/java/at/hannibal2/skyhanni/features/garden/visitor/NPCVisitorFix.kt +++ b/src/main/java/at/hannibal2/skyhanni/features/garden/visitor/NPCVisitorFix.kt @@ -1,5 +1,6 @@ package at.hannibal2.skyhanni.features.garden.visitor +import at.hannibal2.skyhanni.api.event.HandleEvent import at.hannibal2.skyhanni.events.InventoryOpenEvent import at.hannibal2.skyhanni.events.LorenzChatEvent import at.hannibal2.skyhanni.events.garden.visitor.VisitorOpenEvent @@ -60,7 +61,7 @@ object NPCVisitorFix { private var lastVisitorOpen = SimpleTimeMark.farPast() - @SubscribeEvent + @HandleEvent fun onVisitorOpen(event: VisitorOpenEvent) { lastVisitorOpen = SimpleTimeMark.now() } diff --git a/src/main/java/at/hannibal2/skyhanni/features/garden/visitor/VisitorAPI.kt b/src/main/java/at/hannibal2/skyhanni/features/garden/visitor/VisitorAPI.kt index f6a10e49be95..a0c5378e8613 100644 --- a/src/main/java/at/hannibal2/skyhanni/features/garden/visitor/VisitorAPI.kt +++ b/src/main/java/at/hannibal2/skyhanni/features/garden/visitor/VisitorAPI.kt @@ -70,11 +70,11 @@ object VisitorAPI { when (newStatus) { VisitorStatus.ACCEPTED -> { - VisitorAcceptedEvent(visitor).postAndCatch() + VisitorAcceptedEvent(visitor).post() } VisitorStatus.REFUSED -> { - VisitorRefusedEvent(visitor).postAndCatch() + VisitorRefusedEvent(visitor).post() } else -> {} @@ -105,7 +105,7 @@ object VisitorAPI { if (!visitors.containsKey(name)) return false val visitor = visitors[name] ?: return false visitors = visitors.editCopy { remove(name) } - VisitorLeftEvent(visitor).postAndCatch() + VisitorLeftEvent(visitor).post() return true } @@ -113,7 +113,7 @@ object VisitorAPI { if (visitors.containsKey(name)) return false val visitor = Visitor(name, status = VisitorStatus.NEW) visitors = visitors.editCopy { this[name] = visitor } - VisitorArrivalEvent(visitor).postAndCatch() + VisitorArrivalEvent(visitor).post() return true } diff --git a/src/main/java/at/hannibal2/skyhanni/features/garden/visitor/VisitorListener.kt b/src/main/java/at/hannibal2/skyhanni/features/garden/visitor/VisitorListener.kt index 5e65bc581f73..f8612c0cd7b7 100644 --- a/src/main/java/at/hannibal2/skyhanni/features/garden/visitor/VisitorListener.kt +++ b/src/main/java/at/hannibal2/skyhanni/features/garden/visitor/VisitorListener.kt @@ -118,7 +118,7 @@ object VisitorListener { visitor.offersAccepted = offersAcceptedPattern.matchMatcher(lore[3]) { group("offersAccepted").toInt() } visitor.entityId = lastClickedNpc visitor.offer = visitorOffer - VisitorOpenEvent(visitor).postAndCatch() + VisitorOpenEvent(visitor).post() } @SubscribeEvent @@ -126,7 +126,7 @@ object VisitorListener { VisitorAPI.inInventory = false } - @SubscribeEvent + @HandleEvent fun onKeybind(event: GuiKeyPressEvent) { if (!VisitorAPI.inInventory) return if (!config.acceptHotkey.isKeyHeld()) return @@ -164,7 +164,7 @@ object VisitorListener { for (visitor in VisitorAPI.getVisitors()) { visitor.getNameTagEntity()?.let { if (it.distanceToPlayer() > 15) return@let - VisitorRenderEvent(visitor, event.exactLocation(it), event).postAndCatch() + VisitorRenderEvent(visitor, event.exactLocation(it), event).post() } } } diff --git a/src/main/java/at/hannibal2/skyhanni/features/gui/customscoreboard/CustomScoreboard.kt b/src/main/java/at/hannibal2/skyhanni/features/gui/customscoreboard/CustomScoreboard.kt index e6e5c8bcc355..054da32af67b 100644 --- a/src/main/java/at/hannibal2/skyhanni/features/gui/customscoreboard/CustomScoreboard.kt +++ b/src/main/java/at/hannibal2/skyhanni/features/gui/customscoreboard/CustomScoreboard.kt @@ -10,6 +10,7 @@ package at.hannibal2.skyhanni.features.gui.customscoreboard import at.hannibal2.skyhanni.SkyHanniMod +import at.hannibal2.skyhanni.api.event.HandleEvent import at.hannibal2.skyhanni.config.enums.OutsideSbFeature import at.hannibal2.skyhanni.data.IslandType import at.hannibal2.skyhanni.data.ScoreboardData @@ -78,7 +79,7 @@ object CustomScoreboard { config.position.renderRenderable(finalRenderable, posLabel = GUI_NAME) } - @SubscribeEvent + @HandleEvent fun onGuiPositionMoved(event: GuiPositionMovedEvent) { if (event.guiName == GUI_NAME) { with(alignmentConfig) { diff --git a/src/main/java/at/hannibal2/skyhanni/features/gui/quiver/QuiverDisplay.kt b/src/main/java/at/hannibal2/skyhanni/features/gui/quiver/QuiverDisplay.kt index 9ec088723a0e..c80dfb965329 100644 --- a/src/main/java/at/hannibal2/skyhanni/features/gui/quiver/QuiverDisplay.kt +++ b/src/main/java/at/hannibal2/skyhanni/features/gui/quiver/QuiverDisplay.kt @@ -1,6 +1,7 @@ package at.hannibal2.skyhanni.features.gui.quiver import at.hannibal2.skyhanni.SkyHanniMod +import at.hannibal2.skyhanni.api.event.HandleEvent import at.hannibal2.skyhanni.config.features.combat.QuiverDisplayConfig.ShowWhen import at.hannibal2.skyhanni.data.ArrowType import at.hannibal2.skyhanni.data.QuiverAPI @@ -62,7 +63,7 @@ object QuiverDisplay { add(Renderable.string(" $rarity$arrowDisplayName")) } - @SubscribeEvent + @HandleEvent fun onQuiverUpdate(event: QuiverUpdateEvent) { arrow = event.currentArrow amount = event.currentAmount diff --git a/src/main/java/at/hannibal2/skyhanni/features/gui/quiver/QuiverWarning.kt b/src/main/java/at/hannibal2/skyhanni/features/gui/quiver/QuiverWarning.kt index 31f5d0ff06f7..ef22d79c8bae 100644 --- a/src/main/java/at/hannibal2/skyhanni/features/gui/quiver/QuiverWarning.kt +++ b/src/main/java/at/hannibal2/skyhanni/features/gui/quiver/QuiverWarning.kt @@ -1,6 +1,7 @@ package at.hannibal2.skyhanni.features.gui.quiver import at.hannibal2.skyhanni.SkyHanniMod +import at.hannibal2.skyhanni.api.event.HandleEvent import at.hannibal2.skyhanni.config.ConfigUpdaterMigrator import at.hannibal2.skyhanni.data.ArrowType import at.hannibal2.skyhanni.data.QuiverAPI @@ -32,12 +33,12 @@ object QuiverWarning { private var lastLowQuiverReminder = SimpleTimeMark.farPast() private val arrowsInInstance = mutableSetOf() - @SubscribeEvent + @HandleEvent fun onDungeonComplete(event: DungeonCompleteEvent) { onInstanceComplete() } - @SubscribeEvent + @HandleEvent fun onKuudraComplete(event: KuudraCompleteEvent) { onInstanceComplete() } @@ -71,7 +72,7 @@ object QuiverWarning { ChatUtils.chat("Low on arrows §e(${amount.addSeparators()} left)") } - @SubscribeEvent + @HandleEvent fun onQuiverUpdate(event: QuiverUpdateEvent) { val amount = event.currentAmount val arrow = event.currentArrow ?: return diff --git a/src/main/java/at/hannibal2/skyhanni/features/inventory/CarnivalShopHelper.kt b/src/main/java/at/hannibal2/skyhanni/features/inventory/CarnivalShopHelper.kt index 85434d6384a1..80ab64241696 100644 --- a/src/main/java/at/hannibal2/skyhanni/features/inventory/CarnivalShopHelper.kt +++ b/src/main/java/at/hannibal2/skyhanni/features/inventory/CarnivalShopHelper.kt @@ -1,6 +1,7 @@ package at.hannibal2.skyhanni.features.inventory import at.hannibal2.skyhanni.SkyHanniMod +import at.hannibal2.skyhanni.api.event.HandleEvent import at.hannibal2.skyhanni.data.ProfileStorageData import at.hannibal2.skyhanni.data.jsonobjects.repo.neu.NeuCarnivalTokenCostJson import at.hannibal2.skyhanni.data.jsonobjects.repo.neu.NeuMiscJson @@ -86,7 +87,7 @@ object CarnivalShopHelper { } } - @SubscribeEvent + @HandleEvent fun replaceItem(event: ReplaceItemEvent) { if (!isEnabled() || repoEventShops.isEmpty() || event.slot != CUSTOM_STACK_LOCATION) return tryReplaceShopSpecificStack(event) diff --git a/src/main/java/at/hannibal2/skyhanni/features/inventory/EssenceShopHelper.kt b/src/main/java/at/hannibal2/skyhanni/features/inventory/EssenceShopHelper.kt index ccb7d80b51d0..acd18ab6add2 100644 --- a/src/main/java/at/hannibal2/skyhanni/features/inventory/EssenceShopHelper.kt +++ b/src/main/java/at/hannibal2/skyhanni/features/inventory/EssenceShopHelper.kt @@ -1,6 +1,7 @@ package at.hannibal2.skyhanni.features.inventory import at.hannibal2.skyhanni.SkyHanniMod +import at.hannibal2.skyhanni.api.event.HandleEvent import at.hannibal2.skyhanni.data.jsonobjects.repo.neu.NeuEssenceShopJson import at.hannibal2.skyhanni.events.GuiContainerEvent import at.hannibal2.skyhanni.events.InventoryCloseEvent @@ -108,7 +109,7 @@ object EssenceShopHelper { } } - @SubscribeEvent + @HandleEvent fun replaceItem(event: ReplaceItemEvent) { if (!isEnabled() || essenceShops.isEmpty() || currentProgress == null || event.slot != CUSTOM_STACK_LOCATION) return if (!essenceShopPattern.matches(event.inventory.name)) return diff --git a/src/main/java/at/hannibal2/skyhanni/features/inventory/HarpFeatures.kt b/src/main/java/at/hannibal2/skyhanni/features/inventory/HarpFeatures.kt index 1462a6e5eeee..cbef1b8c72a0 100644 --- a/src/main/java/at/hannibal2/skyhanni/features/inventory/HarpFeatures.kt +++ b/src/main/java/at/hannibal2/skyhanni/features/inventory/HarpFeatures.kt @@ -62,7 +62,7 @@ object HarpFeatures { private fun isHarpGui(chestName: String) = inventoryTitlePattern.matches(chestName) private fun isMenuGui(chestName: String) = menuTitlePattern.matches(chestName) - @SubscribeEvent + @HandleEvent fun onGui(event: GuiKeyPressEvent) { if (!LorenzUtils.inSkyBlock) return if (!config.keybinds) return diff --git a/src/main/java/at/hannibal2/skyhanni/features/inventory/ItemPickupLog.kt b/src/main/java/at/hannibal2/skyhanni/features/inventory/ItemPickupLog.kt index db34dda6dc43..9482ae5fbc7f 100644 --- a/src/main/java/at/hannibal2/skyhanni/features/inventory/ItemPickupLog.kt +++ b/src/main/java/at/hannibal2/skyhanni/features/inventory/ItemPickupLog.kt @@ -1,6 +1,7 @@ package at.hannibal2.skyhanni.features.inventory import at.hannibal2.skyhanni.SkyHanniMod +import at.hannibal2.skyhanni.api.event.HandleEvent import at.hannibal2.skyhanni.events.GuiRenderEvent import at.hannibal2.skyhanni.events.LorenzTickEvent import at.hannibal2.skyhanni.events.LorenzWorldChangeEvent @@ -117,7 +118,7 @@ object ItemPickupLog { itemsRemovedFromInventory.clear() } - @SubscribeEvent + @HandleEvent fun onSackChange(event: SackChangeEvent) { if (!isEnabled() || !config.sack) return diff --git a/src/main/java/at/hannibal2/skyhanni/features/inventory/MinisterInCalendar.kt b/src/main/java/at/hannibal2/skyhanni/features/inventory/MinisterInCalendar.kt index 0557ffd1b7b4..6fd076b71759 100644 --- a/src/main/java/at/hannibal2/skyhanni/features/inventory/MinisterInCalendar.kt +++ b/src/main/java/at/hannibal2/skyhanni/features/inventory/MinisterInCalendar.kt @@ -1,6 +1,7 @@ package at.hannibal2.skyhanni.features.inventory import at.hannibal2.skyhanni.SkyHanniMod +import at.hannibal2.skyhanni.api.event.HandleEvent import at.hannibal2.skyhanni.data.ElectionAPI import at.hannibal2.skyhanni.data.ElectionCandidate import at.hannibal2.skyhanni.events.InventoryCloseEvent @@ -57,7 +58,7 @@ object MinisterInCalendar { ministerItemStack = null } - @SubscribeEvent + @HandleEvent fun replaceItem(event: ReplaceItemEvent) { if (!isEnabled()) return if (event.inventory !is ContainerLocalMenu || event.slot != MINISTER_SLOT) return diff --git a/src/main/java/at/hannibal2/skyhanni/features/inventory/SnakeGame.kt b/src/main/java/at/hannibal2/skyhanni/features/inventory/SnakeGame.kt index 0b71e0042824..31a9d8a52388 100644 --- a/src/main/java/at/hannibal2/skyhanni/features/inventory/SnakeGame.kt +++ b/src/main/java/at/hannibal2/skyhanni/features/inventory/SnakeGame.kt @@ -1,6 +1,7 @@ package at.hannibal2.skyhanni.features.inventory import at.hannibal2.skyhanni.SkyHanniMod +import at.hannibal2.skyhanni.api.event.HandleEvent import at.hannibal2.skyhanni.events.GuiKeyPressEvent import at.hannibal2.skyhanni.events.InventoryCloseEvent import at.hannibal2.skyhanni.events.InventoryOpenEvent @@ -34,7 +35,7 @@ object SnakeGame { ) } - @SubscribeEvent + @HandleEvent fun onGui(event: GuiKeyPressEvent) { if (!isEnabled()) return if (!inInventory) return diff --git a/src/main/java/at/hannibal2/skyhanni/features/inventory/attribute/AttributeOverlay.kt b/src/main/java/at/hannibal2/skyhanni/features/inventory/attribute/AttributeOverlay.kt index 2787c98d14c5..856b5d350408 100644 --- a/src/main/java/at/hannibal2/skyhanni/features/inventory/attribute/AttributeOverlay.kt +++ b/src/main/java/at/hannibal2/skyhanni/features/inventory/attribute/AttributeOverlay.kt @@ -1,6 +1,7 @@ package at.hannibal2.skyhanni.features.inventory.attribute import at.hannibal2.skyhanni.SkyHanniMod +import at.hannibal2.skyhanni.api.event.HandleEvent import at.hannibal2.skyhanni.events.GuiRenderItemEvent import at.hannibal2.skyhanni.features.inventory.attribute.AttributeAPI.getAttributesLevels import at.hannibal2.skyhanni.features.inventory.attribute.AttributeAPI.isGoodRoll @@ -9,7 +10,6 @@ import at.hannibal2.skyhanni.utils.ItemUtils.getInternalNameOrNull import at.hannibal2.skyhanni.utils.LorenzUtils import at.hannibal2.skyhanni.utils.RenderUtils.drawSlotText import at.hannibal2.skyhanni.utils.StringUtils.width -import net.minecraftforge.fml.common.eventhandler.SubscribeEvent @SkyHanniModule object AttributeOverlay { @@ -18,7 +18,7 @@ object AttributeOverlay { private val config get() = SkyHanniMod.feature.inventory.attributeOverlay - @SubscribeEvent + @HandleEvent fun onRenderItemOverlayPost(event: GuiRenderItemEvent.RenderOverlayEvent.GuiRenderItemPost) { if (!isEnabled()) return diff --git a/src/main/java/at/hannibal2/skyhanni/features/inventory/auctionhouse/AuctionHouseCopyUnderbidPrice.kt b/src/main/java/at/hannibal2/skyhanni/features/inventory/auctionhouse/AuctionHouseCopyUnderbidPrice.kt index d928ce3e714b..329263f0a13d 100644 --- a/src/main/java/at/hannibal2/skyhanni/features/inventory/auctionhouse/AuctionHouseCopyUnderbidPrice.kt +++ b/src/main/java/at/hannibal2/skyhanni/features/inventory/auctionhouse/AuctionHouseCopyUnderbidPrice.kt @@ -1,6 +1,7 @@ package at.hannibal2.skyhanni.features.inventory.auctionhouse import at.hannibal2.skyhanni.SkyHanniMod +import at.hannibal2.skyhanni.api.event.HandleEvent import at.hannibal2.skyhanni.config.ConfigUpdaterMigrator import at.hannibal2.skyhanni.events.GuiKeyPressEvent import at.hannibal2.skyhanni.events.InventoryUpdatedEvent @@ -57,7 +58,7 @@ object AuctionHouseCopyUnderbidPrice { ChatUtils.chat("Copied ${newPrice.addSeparators()} to clipboard. (Copy Underbid Price)") } - @SubscribeEvent + @HandleEvent fun onKeybind(event: GuiKeyPressEvent) { if (!config.copyUnderbidKeybind.isKeyHeld()) return if (!LorenzUtils.inSkyBlock) return diff --git a/src/main/java/at/hannibal2/skyhanni/features/inventory/auctionhouse/AuctionHouseOpenPriceWebsite.kt b/src/main/java/at/hannibal2/skyhanni/features/inventory/auctionhouse/AuctionHouseOpenPriceWebsite.kt index 3909e71794f1..e2d045481c42 100644 --- a/src/main/java/at/hannibal2/skyhanni/features/inventory/auctionhouse/AuctionHouseOpenPriceWebsite.kt +++ b/src/main/java/at/hannibal2/skyhanni/features/inventory/auctionhouse/AuctionHouseOpenPriceWebsite.kt @@ -1,6 +1,7 @@ package at.hannibal2.skyhanni.features.inventory.auctionhouse import at.hannibal2.skyhanni.SkyHanniMod +import at.hannibal2.skyhanni.api.event.HandleEvent import at.hannibal2.skyhanni.events.GuiContainerEvent import at.hannibal2.skyhanni.events.InventoryCloseEvent import at.hannibal2.skyhanni.events.InventoryFullyOpenedEvent @@ -66,7 +67,7 @@ object AuctionHouseOpenPriceWebsite { displayItem = null } - @SubscribeEvent + @HandleEvent fun replaceItem(event: ReplaceItemEvent) { if (!isEnabled()) return if (event.inventory is InventoryPlayer) return diff --git a/src/main/java/at/hannibal2/skyhanni/features/inventory/bazaar/BazaarApi.kt b/src/main/java/at/hannibal2/skyhanni/features/inventory/bazaar/BazaarApi.kt index 8e8bbb595bb7..aa3e6c6eec93 100644 --- a/src/main/java/at/hannibal2/skyhanni/features/inventory/bazaar/BazaarApi.kt +++ b/src/main/java/at/hannibal2/skyhanni/features/inventory/bazaar/BazaarApi.kt @@ -82,7 +82,7 @@ object BazaarApi { if (inBazaarInventory) { val openedProduct = getOpenedProduct(event.inventoryItems) ?: return currentlyOpenedProduct = openedProduct - BazaarOpenedProductEvent(openedProduct, event).postAndCatch() + BazaarOpenedProductEvent(openedProduct, event).post() } } diff --git a/src/main/java/at/hannibal2/skyhanni/features/inventory/bazaar/BazaarBestSellMethod.kt b/src/main/java/at/hannibal2/skyhanni/features/inventory/bazaar/BazaarBestSellMethod.kt index ab2dd76f58d6..393344c8ad61 100644 --- a/src/main/java/at/hannibal2/skyhanni/features/inventory/bazaar/BazaarBestSellMethod.kt +++ b/src/main/java/at/hannibal2/skyhanni/features/inventory/bazaar/BazaarBestSellMethod.kt @@ -1,6 +1,7 @@ package at.hannibal2.skyhanni.features.inventory.bazaar import at.hannibal2.skyhanni.SkyHanniMod +import at.hannibal2.skyhanni.api.event.HandleEvent import at.hannibal2.skyhanni.events.BazaarOpenedProductEvent import at.hannibal2.skyhanni.events.GuiContainerEvent import at.hannibal2.skyhanni.events.GuiRenderEvent @@ -40,7 +41,7 @@ object BazaarBestSellMethod { } } - @SubscribeEvent + @HandleEvent fun onBazaarOpenedProduct(event: BazaarOpenedProductEvent) { if (!isEnabled()) return display = updateDisplay(event.openedProduct) diff --git a/src/main/java/at/hannibal2/skyhanni/features/inventory/bazaar/BazaarOpenPriceWebsite.kt b/src/main/java/at/hannibal2/skyhanni/features/inventory/bazaar/BazaarOpenPriceWebsite.kt index 2345a61693fa..8fc62a39a02a 100644 --- a/src/main/java/at/hannibal2/skyhanni/features/inventory/bazaar/BazaarOpenPriceWebsite.kt +++ b/src/main/java/at/hannibal2/skyhanni/features/inventory/bazaar/BazaarOpenPriceWebsite.kt @@ -1,6 +1,7 @@ package at.hannibal2.skyhanni.features.inventory.bazaar import at.hannibal2.skyhanni.SkyHanniMod +import at.hannibal2.skyhanni.api.event.HandleEvent import at.hannibal2.skyhanni.events.GuiContainerEvent import at.hannibal2.skyhanni.events.render.gui.ReplaceItemEvent import at.hannibal2.skyhanni.skyhannimodule.SkyHanniModule @@ -34,7 +35,7 @@ object BazaarOpenPriceWebsite { ) } - @SubscribeEvent + @HandleEvent fun replaceItem(event: ReplaceItemEvent) { if (!isEnabled()) return BazaarApi.currentlyOpenedProduct ?: return diff --git a/src/main/java/at/hannibal2/skyhanni/features/inventory/chocolatefactory/ChocolateFactoryHitmanSlots.kt b/src/main/java/at/hannibal2/skyhanni/features/inventory/chocolatefactory/ChocolateFactoryHitmanSlots.kt index a537357687d4..ec3a88f636f6 100644 --- a/src/main/java/at/hannibal2/skyhanni/features/inventory/chocolatefactory/ChocolateFactoryHitmanSlots.kt +++ b/src/main/java/at/hannibal2/skyhanni/features/inventory/chocolatefactory/ChocolateFactoryHitmanSlots.kt @@ -78,7 +78,7 @@ object ChocolateFactoryHitmanSlots { inInventory = false } - @SubscribeEvent + @HandleEvent fun replaceItem(event: ReplaceItemEvent) { if (!config.hitmanSlotInfo) return if (!inInventory) return diff --git a/src/main/java/at/hannibal2/skyhanni/features/inventory/chocolatefactory/ChocolateFactoryKeybinds.kt b/src/main/java/at/hannibal2/skyhanni/features/inventory/chocolatefactory/ChocolateFactoryKeybinds.kt index 6e2fc83e3142..330d941f03ee 100644 --- a/src/main/java/at/hannibal2/skyhanni/features/inventory/chocolatefactory/ChocolateFactoryKeybinds.kt +++ b/src/main/java/at/hannibal2/skyhanni/features/inventory/chocolatefactory/ChocolateFactoryKeybinds.kt @@ -1,5 +1,6 @@ package at.hannibal2.skyhanni.features.inventory.chocolatefactory +import at.hannibal2.skyhanni.api.event.HandleEvent import at.hannibal2.skyhanni.events.GuiContainerEvent import at.hannibal2.skyhanni.events.GuiKeyPressEvent import at.hannibal2.skyhanni.skyhannimodule.SkyHanniModule @@ -16,7 +17,7 @@ object ChocolateFactoryKeybinds { private val config get() = ChocolateFactoryAPI.config.keybinds private var lastClick = SimpleTimeMark.farPast() - @SubscribeEvent + @HandleEvent fun onKeyPress(event: GuiKeyPressEvent) { if (!LorenzUtils.inSkyBlock) return if (!config.enabled) return diff --git a/src/main/java/at/hannibal2/skyhanni/features/inventory/chocolatefactory/ChocolateFactoryShortcut.kt b/src/main/java/at/hannibal2/skyhanni/features/inventory/chocolatefactory/ChocolateFactoryShortcut.kt index 59cb10b7afcc..2db3d8d9d597 100644 --- a/src/main/java/at/hannibal2/skyhanni/features/inventory/chocolatefactory/ChocolateFactoryShortcut.kt +++ b/src/main/java/at/hannibal2/skyhanni/features/inventory/chocolatefactory/ChocolateFactoryShortcut.kt @@ -1,5 +1,6 @@ package at.hannibal2.skyhanni.features.inventory.chocolatefactory +import at.hannibal2.skyhanni.api.event.HandleEvent import at.hannibal2.skyhanni.data.IslandType import at.hannibal2.skyhanni.events.GuiContainerEvent import at.hannibal2.skyhanni.events.InventoryCloseEvent @@ -53,7 +54,7 @@ object ChocolateFactoryShortcut { showItem = false } - @SubscribeEvent + @HandleEvent fun replaceItem(event: ReplaceItemEvent) { if (event.inventory is ContainerLocalMenu && showItem && event.slot == 15) { event.replace(item) diff --git a/src/main/java/at/hannibal2/skyhanni/features/inventory/experimentationtable/ExperimentsProfitTracker.kt b/src/main/java/at/hannibal2/skyhanni/features/inventory/experimentationtable/ExperimentsProfitTracker.kt index 989594981191..a59997b03436 100644 --- a/src/main/java/at/hannibal2/skyhanni/features/inventory/experimentationtable/ExperimentsProfitTracker.kt +++ b/src/main/java/at/hannibal2/skyhanni/features/inventory/experimentationtable/ExperimentsProfitTracker.kt @@ -99,7 +99,7 @@ object ExperimentsProfitTracker { var startCost = 0L } - @SubscribeEvent + @HandleEvent fun onItemAdd(event: ItemAddEvent) { if (!isEnabled() || event.source != ItemAddManager.Source.COMMAND) return diff --git a/src/main/java/at/hannibal2/skyhanni/features/inventory/wardrobe/CustomWardrobeKeybinds.kt b/src/main/java/at/hannibal2/skyhanni/features/inventory/wardrobe/CustomWardrobeKeybinds.kt index b2ccdfe355f6..946f5dcd90f5 100644 --- a/src/main/java/at/hannibal2/skyhanni/features/inventory/wardrobe/CustomWardrobeKeybinds.kt +++ b/src/main/java/at/hannibal2/skyhanni/features/inventory/wardrobe/CustomWardrobeKeybinds.kt @@ -1,6 +1,7 @@ package at.hannibal2.skyhanni.features.inventory.wardrobe import at.hannibal2.skyhanni.SkyHanniMod +import at.hannibal2.skyhanni.api.event.HandleEvent import at.hannibal2.skyhanni.events.GuiKeyPressEvent import at.hannibal2.skyhanni.features.inventory.wardrobe.CustomWardrobe.clickSlot import at.hannibal2.skyhanni.skyhannimodule.SkyHanniModule @@ -29,7 +30,7 @@ object CustomWardrobeKeybinds { ) var lastClick = SimpleTimeMark.farPast() - @SubscribeEvent + @HandleEvent fun onGui(event: GuiKeyPressEvent) { if (handlePress()) event.cancel() } diff --git a/src/main/java/at/hannibal2/skyhanni/features/itemabilities/abilitycooldown/ItemAbilityCooldown.kt b/src/main/java/at/hannibal2/skyhanni/features/itemabilities/abilitycooldown/ItemAbilityCooldown.kt index d1da73d25cfe..86cca44ac7ec 100644 --- a/src/main/java/at/hannibal2/skyhanni/features/itemabilities/abilitycooldown/ItemAbilityCooldown.kt +++ b/src/main/java/at/hannibal2/skyhanni/features/itemabilities/abilitycooldown/ItemAbilityCooldown.kt @@ -238,7 +238,7 @@ object ItemAbilityCooldown { } } - @SubscribeEvent + @HandleEvent fun onActionBarUpdate(event: ActionBarUpdateEvent) { if (!isEnabled()) return diff --git a/src/main/java/at/hannibal2/skyhanni/features/mining/ColdOverlay.kt b/src/main/java/at/hannibal2/skyhanni/features/mining/ColdOverlay.kt index 58ef41ce7e8b..c66760423cb1 100644 --- a/src/main/java/at/hannibal2/skyhanni/features/mining/ColdOverlay.kt +++ b/src/main/java/at/hannibal2/skyhanni/features/mining/ColdOverlay.kt @@ -1,6 +1,7 @@ package at.hannibal2.skyhanni.features.mining import at.hannibal2.skyhanni.SkyHanniMod +import at.hannibal2.skyhanni.api.event.HandleEvent import at.hannibal2.skyhanni.data.MiningAPI.inColdIsland import at.hannibal2.skyhanni.events.ColdUpdateEvent import at.hannibal2.skyhanni.events.GuiRenderEvent @@ -56,7 +57,7 @@ object ColdOverlay { return coldPercentage.coerceAtLeast(0f) * (config.maxAlpha / 100) } - @SubscribeEvent + @HandleEvent fun onColdUpdate(event: ColdUpdateEvent) { val duration = if (event.cold == 0) 1.seconds else 0.seconds DelayedRun.runDelayed(duration) { diff --git a/src/main/java/at/hannibal2/skyhanni/features/mining/DeepCavernsGuide.kt b/src/main/java/at/hannibal2/skyhanni/features/mining/DeepCavernsGuide.kt index bffd88db4210..1ab0632a59b7 100644 --- a/src/main/java/at/hannibal2/skyhanni/features/mining/DeepCavernsGuide.kt +++ b/src/main/java/at/hannibal2/skyhanni/features/mining/DeepCavernsGuide.kt @@ -1,6 +1,7 @@ package at.hannibal2.skyhanni.features.mining import at.hannibal2.skyhanni.SkyHanniMod +import at.hannibal2.skyhanni.api.event.HandleEvent import at.hannibal2.skyhanni.config.ConfigUpdaterMigrator import at.hannibal2.skyhanni.data.IslandType import at.hannibal2.skyhanni.data.jsonobjects.repo.ParkourJson @@ -142,7 +143,7 @@ object DeepCavernsGuide { showStartIcon = false } - @SubscribeEvent + @HandleEvent fun replaceItem(event: ReplaceItemEvent) { if (show) return if (event.inventory is ContainerLocalMenu && showStartIcon && event.slot == 49) { diff --git a/src/main/java/at/hannibal2/skyhanni/features/mining/FlowstateHelper.kt b/src/main/java/at/hannibal2/skyhanni/features/mining/FlowstateHelper.kt index 3ef46c5b6437..1592e06eefd3 100644 --- a/src/main/java/at/hannibal2/skyhanni/features/mining/FlowstateHelper.kt +++ b/src/main/java/at/hannibal2/skyhanni/features/mining/FlowstateHelper.kt @@ -118,7 +118,7 @@ object FlowstateHelper { } else blockBreakStreak * flowstateLevel } - @SubscribeEvent + @HandleEvent fun onChangeItem(event: ItemInHandChangeEvent) { hasFlowstate() } diff --git a/src/main/java/at/hannibal2/skyhanni/features/mining/HighlightMiningCommissionMobs.kt b/src/main/java/at/hannibal2/skyhanni/features/mining/HighlightMiningCommissionMobs.kt index 0b5b3093b04a..175eb75a2ccd 100644 --- a/src/main/java/at/hannibal2/skyhanni/features/mining/HighlightMiningCommissionMobs.kt +++ b/src/main/java/at/hannibal2/skyhanni/features/mining/HighlightMiningCommissionMobs.kt @@ -1,6 +1,7 @@ package at.hannibal2.skyhanni.features.mining import at.hannibal2.skyhanni.SkyHanniMod +import at.hannibal2.skyhanni.api.event.HandleEvent import at.hannibal2.skyhanni.config.ConfigUpdaterMigrator import at.hannibal2.skyhanni.data.IslandType import at.hannibal2.skyhanni.events.EntityMaxHealthUpdateEvent @@ -87,7 +88,7 @@ object HighlightMiningCommissionMobs { } } - @SubscribeEvent + @HandleEvent fun onEntityHealthUpdate(event: EntityMaxHealthUpdateEvent) { if (!isEnabled()) return diff --git a/src/main/java/at/hannibal2/skyhanni/features/mining/MiningNotifications.kt b/src/main/java/at/hannibal2/skyhanni/features/mining/MiningNotifications.kt index 8a86f1a2c167..43f8e97d2326 100644 --- a/src/main/java/at/hannibal2/skyhanni/features/mining/MiningNotifications.kt +++ b/src/main/java/at/hannibal2/skyhanni/features/mining/MiningNotifications.kt @@ -2,6 +2,7 @@ package at.hannibal2.skyhanni.features.mining import at.hannibal2.skyhanni.SkyHanniMod import at.hannibal2.skyhanni.api.GetFromSackAPI +import at.hannibal2.skyhanni.api.event.HandleEvent import at.hannibal2.skyhanni.data.MiningAPI import at.hannibal2.skyhanni.data.MiningAPI.inGlaciteArea import at.hannibal2.skyhanni.data.MiningAPI.lastColdReset @@ -73,7 +74,7 @@ object MiningNotifications { } } - @SubscribeEvent + @HandleEvent fun onColdUpdate(event: ColdUpdateEvent) { if (!inGlaciteArea()) return if (!config.enabled) return diff --git a/src/main/java/at/hannibal2/skyhanni/features/mining/eventtracker/MiningEventTracker.kt b/src/main/java/at/hannibal2/skyhanni/features/mining/eventtracker/MiningEventTracker.kt index c925eaa4b309..aa855d4df8f7 100644 --- a/src/main/java/at/hannibal2/skyhanni/features/mining/eventtracker/MiningEventTracker.kt +++ b/src/main/java/at/hannibal2/skyhanni/features/mining/eventtracker/MiningEventTracker.kt @@ -1,6 +1,7 @@ package at.hannibal2.skyhanni.features.mining.eventtracker import at.hannibal2.skyhanni.SkyHanniMod +import at.hannibal2.skyhanni.api.event.HandleEvent import at.hannibal2.skyhanni.config.ConfigManager import at.hannibal2.skyhanni.config.ConfigUpdaterMigrator import at.hannibal2.skyhanni.data.BossbarData @@ -85,7 +86,7 @@ object MiningEventTracker { lastSentEvent = null } - @SubscribeEvent + @HandleEvent fun onBossbarChange(event: BossbarUpdateEvent) { if (!isMiningIsland()) return if (LorenzUtils.lastWorldSwitch.passedSince() < 5.seconds) return diff --git a/src/main/java/at/hannibal2/skyhanni/features/mining/fossilexcavator/ExcavatorProfitTracker.kt b/src/main/java/at/hannibal2/skyhanni/features/mining/fossilexcavator/ExcavatorProfitTracker.kt index b5e2de6035ce..c93e725879e3 100644 --- a/src/main/java/at/hannibal2/skyhanni/features/mining/fossilexcavator/ExcavatorProfitTracker.kt +++ b/src/main/java/at/hannibal2/skyhanni/features/mining/fossilexcavator/ExcavatorProfitTracker.kt @@ -1,6 +1,7 @@ package at.hannibal2.skyhanni.features.mining.fossilexcavator import at.hannibal2.skyhanni.SkyHanniMod +import at.hannibal2.skyhanni.api.event.HandleEvent import at.hannibal2.skyhanni.data.IslandType import at.hannibal2.skyhanni.data.ItemAddManager import at.hannibal2.skyhanni.events.GuiRenderEvent @@ -158,7 +159,7 @@ object ExcavatorProfitTracker { return profit - scrapPrice } - @SubscribeEvent + @HandleEvent fun onItemAdd(event: ItemAddEvent) { if (!isEnabled()) return @@ -172,7 +173,7 @@ object ExcavatorProfitTracker { tracker.addItem(internalName, amount, command) } - @SubscribeEvent + @HandleEvent fun onFossilExcavation(event: FossilExcavationEvent) { if (!isEnabled()) return for ((name, amount) in event.loot) { diff --git a/src/main/java/at/hannibal2/skyhanni/features/mining/fossilexcavator/FossilExcavatorAPI.kt b/src/main/java/at/hannibal2/skyhanni/features/mining/fossilexcavator/FossilExcavatorAPI.kt index d28058efef46..d1dc877dfd54 100644 --- a/src/main/java/at/hannibal2/skyhanni/features/mining/fossilexcavator/FossilExcavatorAPI.kt +++ b/src/main/java/at/hannibal2/skyhanni/features/mining/fossilexcavator/FossilExcavatorAPI.kt @@ -86,7 +86,7 @@ object FossilExcavatorAPI { val message = event.message if (emptyPattern.matches(message)) { - FossilExcavationEvent(emptyList()).postAndCatch() + FossilExcavationEvent(emptyList()).post() } @@ -98,7 +98,7 @@ object FossilExcavatorAPI { if (!inLoot) return if (endPattern.matches(message)) { - FossilExcavationEvent(loot.toList()).postAndCatch() + FossilExcavationEvent(loot.toList()).post() loot.clear() inLoot = false return diff --git a/src/main/java/at/hannibal2/skyhanni/features/mining/fossilexcavator/ProfitPerExcavation.kt b/src/main/java/at/hannibal2/skyhanni/features/mining/fossilexcavator/ProfitPerExcavation.kt index 5599aa40a121..013277c3a218 100644 --- a/src/main/java/at/hannibal2/skyhanni/features/mining/fossilexcavator/ProfitPerExcavation.kt +++ b/src/main/java/at/hannibal2/skyhanni/features/mining/fossilexcavator/ProfitPerExcavation.kt @@ -1,6 +1,7 @@ package at.hannibal2.skyhanni.features.mining.fossilexcavator import at.hannibal2.skyhanni.SkyHanniMod +import at.hannibal2.skyhanni.api.event.HandleEvent import at.hannibal2.skyhanni.events.mining.FossilExcavationEvent import at.hannibal2.skyhanni.skyhannimodule.SkyHanniModule import at.hannibal2.skyhanni.utils.ChatUtils @@ -10,13 +11,12 @@ import at.hannibal2.skyhanni.utils.ItemUtils.itemName import at.hannibal2.skyhanni.utils.NEUInternalName import at.hannibal2.skyhanni.utils.NumberUtil.addSeparators import at.hannibal2.skyhanni.utils.NumberUtil.shortFormat -import net.minecraftforge.fml.common.eventhandler.SubscribeEvent @SkyHanniModule object ProfitPerExcavation { private val config get() = SkyHanniMod.feature.mining.fossilExcavator - @SubscribeEvent + @HandleEvent fun onFossilExcavation(event: FossilExcavationEvent) { if (!config.profitPerExcavation) return val loot = event.loot diff --git a/src/main/java/at/hannibal2/skyhanni/features/mining/glacitemineshaft/CorpseAPI.kt b/src/main/java/at/hannibal2/skyhanni/features/mining/glacitemineshaft/CorpseAPI.kt index c8ee81288a79..bf4175cc88e1 100644 --- a/src/main/java/at/hannibal2/skyhanni/features/mining/glacitemineshaft/CorpseAPI.kt +++ b/src/main/java/at/hannibal2/skyhanni/features/mining/glacitemineshaft/CorpseAPI.kt @@ -60,7 +60,7 @@ object CorpseAPI { if (endPattern.matches(message)) { corpseType?.let { - CorpseLootedEvent(it, loot.toList()).postAndCatch() + CorpseLootedEvent(it, loot.toList()).post() } corpseType = null loot.clear() diff --git a/src/main/java/at/hannibal2/skyhanni/features/mining/glacitemineshaft/CorpseTracker.kt b/src/main/java/at/hannibal2/skyhanni/features/mining/glacitemineshaft/CorpseTracker.kt index cb2c3cfe487f..c9cc422d9fc5 100644 --- a/src/main/java/at/hannibal2/skyhanni/features/mining/glacitemineshaft/CorpseTracker.kt +++ b/src/main/java/at/hannibal2/skyhanni/features/mining/glacitemineshaft/CorpseTracker.kt @@ -1,6 +1,7 @@ package at.hannibal2.skyhanni.features.mining.glacitemineshaft import at.hannibal2.skyhanni.SkyHanniMod +import at.hannibal2.skyhanni.api.event.HandleEvent import at.hannibal2.skyhanni.data.IslandType import at.hannibal2.skyhanni.data.MiningAPI import at.hannibal2.skyhanni.events.GuiRenderEvent @@ -69,7 +70,7 @@ object CorpseTracker { private fun addLootedCorpse(type: CorpseType) = tracker.modify { it.corpsesLooted.addOrPut(type, 1) } - @SubscribeEvent + @HandleEvent fun onCorpseLooted(event: CorpseLootedEvent) { addLootedCorpse(event.corpseType) for ((itemName, amount) in event.loot) { diff --git a/src/main/java/at/hannibal2/skyhanni/features/mining/glacitemineshaft/ProfitPerMineshaftCorpse.kt b/src/main/java/at/hannibal2/skyhanni/features/mining/glacitemineshaft/ProfitPerMineshaftCorpse.kt index 406feee560e0..b3ad4f9bdeb8 100644 --- a/src/main/java/at/hannibal2/skyhanni/features/mining/glacitemineshaft/ProfitPerMineshaftCorpse.kt +++ b/src/main/java/at/hannibal2/skyhanni/features/mining/glacitemineshaft/ProfitPerMineshaftCorpse.kt @@ -1,6 +1,7 @@ package at.hannibal2.skyhanni.features.mining.glacitemineshaft import at.hannibal2.skyhanni.SkyHanniMod +import at.hannibal2.skyhanni.api.event.HandleEvent import at.hannibal2.skyhanni.events.mining.CorpseLootedEvent import at.hannibal2.skyhanni.skyhannimodule.SkyHanniModule import at.hannibal2.skyhanni.utils.ChatUtils @@ -11,13 +12,12 @@ import at.hannibal2.skyhanni.utils.ItemUtils.itemName import at.hannibal2.skyhanni.utils.NEUInternalName import at.hannibal2.skyhanni.utils.NumberUtil.addSeparators import at.hannibal2.skyhanni.utils.NumberUtil.shortFormat -import net.minecraftforge.fml.common.eventhandler.SubscribeEvent @SkyHanniModule object ProfitPerMineshaftCorpse { private val config get() = SkyHanniMod.feature.mining.mineshaft - @SubscribeEvent + @HandleEvent fun onCorpseLooted(event: CorpseLootedEvent) { if (!config.profitPerCorpseLoot) return val loot = event.loot diff --git a/src/main/java/at/hannibal2/skyhanni/features/minion/MinionCollectLogic.kt b/src/main/java/at/hannibal2/skyhanni/features/minion/MinionCollectLogic.kt index 05eecd3b7b7a..92e0e27020ac 100644 --- a/src/main/java/at/hannibal2/skyhanni/features/minion/MinionCollectLogic.kt +++ b/src/main/java/at/hannibal2/skyhanni/features/minion/MinionCollectLogic.kt @@ -45,7 +45,7 @@ object MinionCollectLogic { val diff = amount - old if (diff > 0) { - ItemAddInInventoryEvent(internalId, diff).postAndCatch() + ItemAddInInventoryEvent(internalId, diff).post() } } diff --git a/src/main/java/at/hannibal2/skyhanni/features/misc/FixNEUHeavyPearls.kt b/src/main/java/at/hannibal2/skyhanni/features/misc/FixNEUHeavyPearls.kt index 85fc5f7cf753..6400523424e0 100644 --- a/src/main/java/at/hannibal2/skyhanni/features/misc/FixNEUHeavyPearls.kt +++ b/src/main/java/at/hannibal2/skyhanni/features/misc/FixNEUHeavyPearls.kt @@ -1,13 +1,13 @@ package at.hannibal2.skyhanni.features.misc import at.hannibal2.skyhanni.SkyHanniMod +import at.hannibal2.skyhanni.api.event.HandleEvent import at.hannibal2.skyhanni.events.ItemAddEvent import at.hannibal2.skyhanni.skyhannimodule.SkyHanniModule import at.hannibal2.skyhanni.utils.ChatUtils import at.hannibal2.skyhanni.utils.LorenzUtils import at.hannibal2.skyhanni.utils.NEUInternalName.Companion.toInternalName import io.github.moulberry.notenoughupdates.NotEnoughUpdates -import net.minecraftforge.fml.common.eventhandler.SubscribeEvent import kotlin.time.Duration.Companion.hours @SkyHanniModule(neuRequired = true) @@ -16,7 +16,7 @@ object FixNEUHeavyPearls { private val config get() = SkyHanniMod.feature.misc private val heavyPearl = "HEAVY_PEARL".toInternalName() - @SubscribeEvent + @HandleEvent fun onItemAdd(event: ItemAddEvent) { if (!isEnabled()) return diff --git a/src/main/java/at/hannibal2/skyhanni/features/misc/NoBitsWarning.kt b/src/main/java/at/hannibal2/skyhanni/features/misc/NoBitsWarning.kt index 375a2e57baaa..2fd181c8f494 100644 --- a/src/main/java/at/hannibal2/skyhanni/features/misc/NoBitsWarning.kt +++ b/src/main/java/at/hannibal2/skyhanni/features/misc/NoBitsWarning.kt @@ -1,6 +1,7 @@ package at.hannibal2.skyhanni.features.misc import at.hannibal2.skyhanni.SkyHanniMod +import at.hannibal2.skyhanni.api.event.HandleEvent import at.hannibal2.skyhanni.config.ConfigUpdaterMigrator import at.hannibal2.skyhanni.events.BitsUpdateEvent import at.hannibal2.skyhanni.skyhannimodule.SkyHanniModule @@ -18,7 +19,7 @@ object NoBitsWarning { private val config get() = SkyHanniMod.feature.misc.bits - @SubscribeEvent + @HandleEvent fun onBitsGain(event: BitsUpdateEvent.BitsGain) { if (isWarningEnabled() && event.bitsAvailable == 0) { diff --git a/src/main/java/at/hannibal2/skyhanni/features/misc/PocketSackInASackDisplay.kt b/src/main/java/at/hannibal2/skyhanni/features/misc/PocketSackInASackDisplay.kt index 2da2ce052234..d277c5797232 100644 --- a/src/main/java/at/hannibal2/skyhanni/features/misc/PocketSackInASackDisplay.kt +++ b/src/main/java/at/hannibal2/skyhanni/features/misc/PocketSackInASackDisplay.kt @@ -1,6 +1,7 @@ package at.hannibal2.skyhanni.features.misc import at.hannibal2.skyhanni.SkyHanniMod +import at.hannibal2.skyhanni.api.event.HandleEvent import at.hannibal2.skyhanni.config.ConfigUpdaterMigrator import at.hannibal2.skyhanni.events.GuiRenderItemEvent import at.hannibal2.skyhanni.events.LorenzToolTipEvent @@ -17,7 +18,7 @@ object PocketSackInASackDisplay { private val config get() = SkyHanniMod.feature.inventory.pocketSackInASack private const val MAX_STITCHES = 3 - @SubscribeEvent + @HandleEvent fun onRenderItemOverlayPost(event: GuiRenderItemEvent.RenderOverlayEvent.GuiRenderItemPost) { val stack = event.stack ?: return if (!LorenzUtils.inSkyBlock || stack.stackSize != 1) return diff --git a/src/main/java/at/hannibal2/skyhanni/features/misc/ReplaceRomanNumerals.kt b/src/main/java/at/hannibal2/skyhanni/features/misc/ReplaceRomanNumerals.kt index db0453d4900a..6d3123f61f3c 100644 --- a/src/main/java/at/hannibal2/skyhanni/features/misc/ReplaceRomanNumerals.kt +++ b/src/main/java/at/hannibal2/skyhanni/features/misc/ReplaceRomanNumerals.kt @@ -1,6 +1,7 @@ package at.hannibal2.skyhanni.features.misc import at.hannibal2.skyhanni.SkyHanniMod +import at.hannibal2.skyhanni.api.event.HandleEvent import at.hannibal2.skyhanni.data.hypixel.chat.event.SystemMessageEvent import at.hannibal2.skyhanni.events.ChatHoverEvent import at.hannibal2.skyhanni.events.LorenzToolTipEvent @@ -40,7 +41,7 @@ object ReplaceRomanNumerals { event.toolTip.replaceAll { it.transformLine() } } - @SubscribeEvent(priority = EventPriority.LOWEST) + @HandleEvent(priority = HandleEvent.LOWEST) fun onChatHover(event: ChatHoverEvent) { if (event.getHoverEvent().action != HoverEvent.Action.SHOW_TEXT) return if (!isEnabled()) return diff --git a/src/main/java/at/hannibal2/skyhanni/features/misc/UserLuckBreakdown.kt b/src/main/java/at/hannibal2/skyhanni/features/misc/UserLuckBreakdown.kt index d6823b940785..79affc11063e 100644 --- a/src/main/java/at/hannibal2/skyhanni/features/misc/UserLuckBreakdown.kt +++ b/src/main/java/at/hannibal2/skyhanni/features/misc/UserLuckBreakdown.kt @@ -1,6 +1,7 @@ package at.hannibal2.skyhanni.features.misc import at.hannibal2.skyhanni.SkyHanniMod +import at.hannibal2.skyhanni.api.event.HandleEvent import at.hannibal2.skyhanni.data.ProfileStorageData import at.hannibal2.skyhanni.events.GuiContainerEvent import at.hannibal2.skyhanni.events.InventoryCloseEvent @@ -71,7 +72,7 @@ object UserLuckBreakdown { private val skillOverflowLuck = mutableMapOf() - @SubscribeEvent + @HandleEvent fun replaceItem(event: ReplaceItemEvent) { if (!config.userluckEnabled) return if (event.inventory !is ContainerLocalMenu) return diff --git a/src/main/java/at/hannibal2/skyhanni/features/misc/items/enchants/EnchantParser.kt b/src/main/java/at/hannibal2/skyhanni/features/misc/items/enchants/EnchantParser.kt index ac25d85d4273..824f4b3c7c48 100644 --- a/src/main/java/at/hannibal2/skyhanni/features/misc/items/enchants/EnchantParser.kt +++ b/src/main/java/at/hannibal2/skyhanni/features/misc/items/enchants/EnchantParser.kt @@ -129,7 +129,7 @@ object EnchantParser { /** * For tooltips that are shown when hovering over an item from /show */ - @SubscribeEvent + @HandleEvent fun onChatHoverEvent(event: ChatHoverEvent) { if (event.getHoverEvent().action != HoverEvent.Action.SHOW_TEXT) return if (!isEnabled() || !this.enchants.hasEnchantData()) return diff --git a/src/main/java/at/hannibal2/skyhanni/features/misc/limbo/LimboPlaytime.kt b/src/main/java/at/hannibal2/skyhanni/features/misc/limbo/LimboPlaytime.kt index 75ffd6fc2752..3d2adeb15ebd 100644 --- a/src/main/java/at/hannibal2/skyhanni/features/misc/limbo/LimboPlaytime.kt +++ b/src/main/java/at/hannibal2/skyhanni/features/misc/limbo/LimboPlaytime.kt @@ -1,6 +1,7 @@ package at.hannibal2.skyhanni.features.misc.limbo import at.hannibal2.skyhanni.SkyHanniMod +import at.hannibal2.skyhanni.api.event.HandleEvent import at.hannibal2.skyhanni.data.ProfileStorageData import at.hannibal2.skyhanni.events.InventoryOpenEvent import at.hannibal2.skyhanni.events.LorenzToolTipEvent @@ -55,7 +56,7 @@ object LimboPlaytime { private lateinit var limboItem: ItemStack private var lastCreateCooldown = SimpleTimeMark.farPast() - @SubscribeEvent + @HandleEvent fun replaceItem(event: ReplaceItemEvent) { if (!enabled) return if (event.inventory !is ContainerLocalMenu) return diff --git a/src/main/java/at/hannibal2/skyhanni/features/misc/limbo/LimboTimeTracker.kt b/src/main/java/at/hannibal2/skyhanni/features/misc/limbo/LimboTimeTracker.kt index 120c53e47b82..3a825174673e 100644 --- a/src/main/java/at/hannibal2/skyhanni/features/misc/limbo/LimboTimeTracker.kt +++ b/src/main/java/at/hannibal2/skyhanni/features/misc/limbo/LimboTimeTracker.kt @@ -1,6 +1,7 @@ package at.hannibal2.skyhanni.features.misc.limbo import at.hannibal2.skyhanni.SkyHanniMod +import at.hannibal2.skyhanni.api.event.HandleEvent import at.hannibal2.skyhanni.config.ConfigUpdaterMigrator import at.hannibal2.skyhanni.data.HypixelData import at.hannibal2.skyhanni.data.ProfileStorageData @@ -188,7 +189,7 @@ object LimboTimeTracker { notMigratedPB = personalBest } - @SubscribeEvent + @HandleEvent fun onHypixelJoin(event: HypixelJoinEvent) { if (!doMigrate) return if (notMigratedPB != 0) { diff --git a/src/main/java/at/hannibal2/skyhanni/features/misc/pets/PetCandyUsedDisplay.kt b/src/main/java/at/hannibal2/skyhanni/features/misc/pets/PetCandyUsedDisplay.kt index e331e6c750ea..048864f1b4d6 100644 --- a/src/main/java/at/hannibal2/skyhanni/features/misc/pets/PetCandyUsedDisplay.kt +++ b/src/main/java/at/hannibal2/skyhanni/features/misc/pets/PetCandyUsedDisplay.kt @@ -1,6 +1,7 @@ package at.hannibal2.skyhanni.features.misc.pets import at.hannibal2.skyhanni.SkyHanniMod +import at.hannibal2.skyhanni.api.event.HandleEvent import at.hannibal2.skyhanni.config.ConfigUpdaterMigrator import at.hannibal2.skyhanni.events.GuiRenderItemEvent import at.hannibal2.skyhanni.skyhannimodule.SkyHanniModule @@ -16,7 +17,7 @@ object PetCandyUsedDisplay { private val config get() = SkyHanniMod.feature.misc.petCandy - @SubscribeEvent + @HandleEvent fun onRenderItemOverlayPost(event: GuiRenderItemEvent.RenderOverlayEvent.GuiRenderItemPost) { val stack = event.stack ?: return if (!LorenzUtils.inSkyBlock || stack.stackSize != 1) return diff --git a/src/main/java/at/hannibal2/skyhanni/features/misc/pets/PetItemDisplay.kt b/src/main/java/at/hannibal2/skyhanni/features/misc/pets/PetItemDisplay.kt index 9d3349c5b1e8..d18a498cc8bc 100644 --- a/src/main/java/at/hannibal2/skyhanni/features/misc/pets/PetItemDisplay.kt +++ b/src/main/java/at/hannibal2/skyhanni/features/misc/pets/PetItemDisplay.kt @@ -1,20 +1,20 @@ package at.hannibal2.skyhanni.features.misc.pets import at.hannibal2.skyhanni.SkyHanniMod +import at.hannibal2.skyhanni.api.event.HandleEvent import at.hannibal2.skyhanni.events.GuiRenderItemEvent import at.hannibal2.skyhanni.skyhannimodule.SkyHanniModule import at.hannibal2.skyhanni.utils.LorenzUtils import at.hannibal2.skyhanni.utils.RenderUtils.drawSlotText import at.hannibal2.skyhanni.utils.SkyBlockItemModifierUtils.getPetItem import net.minecraft.client.Minecraft -import net.minecraftforge.fml.common.eventhandler.SubscribeEvent @SkyHanniModule object PetItemDisplay { private val config get() = SkyHanniMod.feature.misc.pets - @SubscribeEvent + @HandleEvent fun onRenderItemOverlayPost(event: GuiRenderItemEvent.RenderOverlayEvent.GuiRenderItemPost) { val stack = event.stack ?: return if (!LorenzUtils.inSkyBlock || stack.stackSize != 1) return diff --git a/src/main/java/at/hannibal2/skyhanni/features/misc/visualwords/ModifyVisualWords.kt b/src/main/java/at/hannibal2/skyhanni/features/misc/visualwords/ModifyVisualWords.kt index 8f7551573665..ecf57e3f3314 100644 --- a/src/main/java/at/hannibal2/skyhanni/features/misc/visualwords/ModifyVisualWords.kt +++ b/src/main/java/at/hannibal2/skyhanni/features/misc/visualwords/ModifyVisualWords.kt @@ -1,6 +1,7 @@ package at.hannibal2.skyhanni.features.misc.visualwords import at.hannibal2.skyhanni.SkyHanniMod +import at.hannibal2.skyhanni.api.event.HandleEvent import at.hannibal2.skyhanni.config.ConfigFileType import at.hannibal2.skyhanni.config.enums.OutsideSbFeature import at.hannibal2.skyhanni.events.HypixelJoinEvent @@ -8,7 +9,6 @@ import at.hannibal2.skyhanni.skyhannimodule.SkyHanniModule import at.hannibal2.skyhanni.utils.LorenzUtils import at.hannibal2.skyhanni.utils.StringUtils.convertToFormatted import at.hannibal2.skyhanni.utils.TimeLimitedCache -import net.minecraftforge.fml.common.eventhandler.SubscribeEvent import kotlin.time.Duration.Companion.minutes @SkyHanniModule @@ -59,7 +59,7 @@ object ModifyVisualWords { } } - @SubscribeEvent + @HandleEvent fun onHypixelJoin(event: HypixelJoinEvent) { val oldModifiedWords = SkyHanniMod.feature.storage.modifiedWords if (oldModifiedWords.isNotEmpty()) { diff --git a/src/main/java/at/hannibal2/skyhanni/features/nether/kuudra/KuudraAPI.kt b/src/main/java/at/hannibal2/skyhanni/features/nether/kuudra/KuudraAPI.kt index f2b1557da326..994e6b649897 100644 --- a/src/main/java/at/hannibal2/skyhanni/features/nether/kuudra/KuudraAPI.kt +++ b/src/main/java/at/hannibal2/skyhanni/features/nether/kuudra/KuudraAPI.kt @@ -69,7 +69,7 @@ object KuudraAPI { tierPattern.matchMatcher(line) { val tier = group("tier").toInt() kuudraTier = tier - KuudraEnterEvent(tier).postAndCatch() + KuudraEnterEvent(tier).post() } } } @@ -84,7 +84,7 @@ object KuudraAPI { val message = event.message completePattern.matchMatcher(message) { val tier = kuudraTier ?: return - KuudraCompleteEvent(tier).postAndCatch() + KuudraCompleteEvent(tier).post() } } diff --git a/src/main/java/at/hannibal2/skyhanni/features/nether/reputationhelper/CrimsonIsleReputationHelper.kt b/src/main/java/at/hannibal2/skyhanni/features/nether/reputationhelper/CrimsonIsleReputationHelper.kt index b9b7248fbf6c..4566fcb560d5 100644 --- a/src/main/java/at/hannibal2/skyhanni/features/nether/reputationhelper/CrimsonIsleReputationHelper.kt +++ b/src/main/java/at/hannibal2/skyhanni/features/nether/reputationhelper/CrimsonIsleReputationHelper.kt @@ -1,6 +1,7 @@ package at.hannibal2.skyhanni.features.nether.reputationhelper import at.hannibal2.skyhanni.SkyHanniMod +import at.hannibal2.skyhanni.api.event.HandleEvent import at.hannibal2.skyhanni.config.ConfigUpdaterMigrator import at.hannibal2.skyhanni.config.features.crimsonisle.ReputationHelperConfig.ShowLocationEntry import at.hannibal2.skyhanni.data.IslandType @@ -85,7 +86,7 @@ class CrimsonIsleReputationHelper(skyHanniMod: SkyHanniMod) { } } - @SubscribeEvent + @HandleEvent fun onSackChange(event: SackChangeEvent) { dirty = true } diff --git a/src/main/java/at/hannibal2/skyhanni/features/nether/reputationhelper/kuudra/DailyKuudraBossHelper.kt b/src/main/java/at/hannibal2/skyhanni/features/nether/reputationhelper/kuudra/DailyKuudraBossHelper.kt index 5d19968cc288..4fa8dd7bc30c 100644 --- a/src/main/java/at/hannibal2/skyhanni/features/nether/reputationhelper/kuudra/DailyKuudraBossHelper.kt +++ b/src/main/java/at/hannibal2/skyhanni/features/nether/reputationhelper/kuudra/DailyKuudraBossHelper.kt @@ -1,6 +1,7 @@ package at.hannibal2.skyhanni.features.nether.reputationhelper.kuudra import at.hannibal2.skyhanni.SkyHanniMod +import at.hannibal2.skyhanni.api.event.HandleEvent import at.hannibal2.skyhanni.config.storage.ProfileSpecificStorage import at.hannibal2.skyhanni.data.IslandType import at.hannibal2.skyhanni.data.jsonobjects.repo.ReputationQuest @@ -40,7 +41,7 @@ class DailyKuudraBossHelper(private val reputationHelper: CrimsonIsleReputationH } } - @SubscribeEvent + @HandleEvent fun onKuudraDone(event: KuudraCompleteEvent) { val tier = event.kuudraTier val kuudraTier = getByTier(tier) ?: return diff --git a/src/main/java/at/hannibal2/skyhanni/features/rift/everywhere/EnigmaSoulWaypoints.kt b/src/main/java/at/hannibal2/skyhanni/features/rift/everywhere/EnigmaSoulWaypoints.kt index e1d8eebe1ef9..5ba338efb509 100644 --- a/src/main/java/at/hannibal2/skyhanni/features/rift/everywhere/EnigmaSoulWaypoints.kt +++ b/src/main/java/at/hannibal2/skyhanni/features/rift/everywhere/EnigmaSoulWaypoints.kt @@ -1,5 +1,6 @@ package at.hannibal2.skyhanni.features.rift.everywhere +import at.hannibal2.skyhanni.api.event.HandleEvent import at.hannibal2.skyhanni.data.IslandGraphs import at.hannibal2.skyhanni.data.jsonobjects.repo.EnigmaSoulsJson import at.hannibal2.skyhanni.events.GuiContainerEvent @@ -53,7 +54,7 @@ object EnigmaSoulWaypoints { ) } - @SubscribeEvent + @HandleEvent fun replaceItem(event: ReplaceItemEvent) { if (!isEnabled()) return diff --git a/src/main/java/at/hannibal2/skyhanni/features/rift/everywhere/RiftTimer.kt b/src/main/java/at/hannibal2/skyhanni/features/rift/everywhere/RiftTimer.kt index 354ccfef7066..9202f1130f07 100644 --- a/src/main/java/at/hannibal2/skyhanni/features/rift/everywhere/RiftTimer.kt +++ b/src/main/java/at/hannibal2/skyhanni/features/rift/everywhere/RiftTimer.kt @@ -1,5 +1,6 @@ package at.hannibal2.skyhanni.features.rift.everywhere +import at.hannibal2.skyhanni.api.event.HandleEvent import at.hannibal2.skyhanni.data.ActionBarStatsData import at.hannibal2.skyhanni.events.ActionBarValueUpdateEvent import at.hannibal2.skyhanni.events.ConfigLoadEvent @@ -50,7 +51,7 @@ object RiftTimer { currentTime = 0.seconds } - @SubscribeEvent + @HandleEvent fun onActionBarValueUpdate(event: ActionBarValueUpdateEvent) { if (event.updated != ActionBarStatsData.RIFT_TIME) return if (!isEnabled() || RiftAPI.inRiftRace) return @@ -130,7 +131,7 @@ object RiftTimer { config.timerPosition.renderStrings(display, posLabel = "Rift Timer") } - @SubscribeEvent + @HandleEvent fun onEntityHealthDisplay(event: EntityHealthDisplayEvent) { if (!RiftAPI.inRift() || !config.nametag) return val time = nametagPattern.matchMatcher(event.text) { diff --git a/src/main/java/at/hannibal2/skyhanni/features/skillprogress/SkillProgress.kt b/src/main/java/at/hannibal2/skyhanni/features/skillprogress/SkillProgress.kt index a7ac10d11676..d73f92fce180 100644 --- a/src/main/java/at/hannibal2/skyhanni/features/skillprogress/SkillProgress.kt +++ b/src/main/java/at/hannibal2/skyhanni/features/skillprogress/SkillProgress.kt @@ -8,6 +8,7 @@ import at.hannibal2.skyhanni.api.SkillAPI.lastUpdate import at.hannibal2.skyhanni.api.SkillAPI.oldSkillInfoMap import at.hannibal2.skyhanni.api.SkillAPI.showDisplay import at.hannibal2.skyhanni.api.SkillAPI.skillXPInfoMap +import at.hannibal2.skyhanni.api.event.HandleEvent import at.hannibal2.skyhanni.config.features.skillprogress.SkillProgressConfig import at.hannibal2.skyhanni.events.ActionBarUpdateEvent import at.hannibal2.skyhanni.events.ConfigLoadEvent @@ -38,7 +39,6 @@ import at.hannibal2.skyhanni.utils.TimeUnit import at.hannibal2.skyhanni.utils.TimeUtils.format import at.hannibal2.skyhanni.utils.renderables.Renderable import at.hannibal2.skyhanni.utils.renderables.Renderable.Companion.horizontalContainer -import net.minecraftforge.fml.common.eventhandler.EventPriority import net.minecraftforge.fml.common.eventhandler.SubscribeEvent import kotlin.math.ceil import kotlin.time.Duration.Companion.milliseconds @@ -218,10 +218,9 @@ object SkillProgress { } } - @SubscribeEvent(priority = EventPriority.LOW) + @HandleEvent(priority = HandleEvent.LOW) fun onActionBar(event: ActionBarUpdateEvent) { if (!config.hideInActionBar || !isEnabled()) return - if (event.isCanceled) return var msg = event.actionBar for (line in hideInActionBar) { msg = msg.replace(Regex("\\s*" + Regex.escape(line)), "") diff --git a/src/main/java/at/hannibal2/skyhanni/features/slayer/SlayerProfitTracker.kt b/src/main/java/at/hannibal2/skyhanni/features/slayer/SlayerProfitTracker.kt index 63c0adbc88a1..d069cf7e33bc 100644 --- a/src/main/java/at/hannibal2/skyhanni/features/slayer/SlayerProfitTracker.kt +++ b/src/main/java/at/hannibal2/skyhanni/features/slayer/SlayerProfitTracker.kt @@ -151,7 +151,7 @@ object SlayerProfitTracker { } } - @SubscribeEvent + @HandleEvent fun onItemAdd(event: ItemAddEvent) { if (!isEnabled()) return if (!SlayerAPI.isInCorrectArea) return diff --git a/src/main/java/at/hannibal2/skyhanni/features/slayer/SlayerQuestWarning.kt b/src/main/java/at/hannibal2/skyhanni/features/slayer/SlayerQuestWarning.kt index 61f76a68dc0d..bd46e416b952 100644 --- a/src/main/java/at/hannibal2/skyhanni/features/slayer/SlayerQuestWarning.kt +++ b/src/main/java/at/hannibal2/skyhanni/features/slayer/SlayerQuestWarning.kt @@ -113,7 +113,7 @@ object SlayerQuestWarning { } } - @SubscribeEvent + @HandleEvent fun onEntityHealthUpdate(event: EntityHealthUpdateEvent) { if (!LorenzUtils.inSkyBlock) return diff --git a/src/main/java/at/hannibal2/skyhanni/features/slayer/blaze/BlazeSlayerFirePitsWarning.kt b/src/main/java/at/hannibal2/skyhanni/features/slayer/blaze/BlazeSlayerFirePitsWarning.kt index 1b54e4fd2e55..76eb9a0d19ff 100644 --- a/src/main/java/at/hannibal2/skyhanni/features/slayer/blaze/BlazeSlayerFirePitsWarning.kt +++ b/src/main/java/at/hannibal2/skyhanni/features/slayer/blaze/BlazeSlayerFirePitsWarning.kt @@ -1,6 +1,7 @@ package at.hannibal2.skyhanni.features.slayer.blaze import at.hannibal2.skyhanni.SkyHanniMod +import at.hannibal2.skyhanni.api.event.HandleEvent import at.hannibal2.skyhanni.config.ConfigUpdaterMigrator import at.hannibal2.skyhanni.events.BossHealthChangeEvent import at.hannibal2.skyhanni.events.LorenzTickEvent @@ -36,7 +37,7 @@ object BlazeSlayerFirePitsWarning { } } - @SubscribeEvent + @HandleEvent fun onBossHealthChange(event: BossHealthChangeEvent) { if (!isEnabled()) return val entityData = event.entityData diff --git a/src/main/java/at/hannibal2/skyhanni/mixins/hooks/GuiContainerHook.kt b/src/main/java/at/hannibal2/skyhanni/mixins/hooks/GuiContainerHook.kt index 4ca50ac64dbf..1fd951c8bb36 100644 --- a/src/main/java/at/hannibal2/skyhanni/mixins/hooks/GuiContainerHook.kt +++ b/src/main/java/at/hannibal2/skyhanni/mixins/hooks/GuiContainerHook.kt @@ -77,7 +77,7 @@ class GuiContainerHook(guiAny: Any) { mouseY: Int, ci: CallbackInfo, ) { - if (DrawScreenAfterEvent(mouseX, mouseY, ci).postAndCatch()) ci.cancel() + if (DrawScreenAfterEvent(mouseX, mouseY, ci).post()) ci.cancel() } } diff --git a/src/main/java/at/hannibal2/skyhanni/mixins/hooks/RenderItemHook.kt b/src/main/java/at/hannibal2/skyhanni/mixins/hooks/RenderItemHook.kt index 7d776e99bb80..fc324f9bcbd5 100644 --- a/src/main/java/at/hannibal2/skyhanni/mixins/hooks/RenderItemHook.kt +++ b/src/main/java/at/hannibal2/skyhanni/mixins/hooks/RenderItemHook.kt @@ -20,7 +20,7 @@ fun renderItemOverlayPost( xPosition, yPosition, text - ).postAndCatch() + ).post() } fun renderItemReturn(stack: ItemStack, x: Int, y: Int) { diff --git a/src/main/java/at/hannibal2/skyhanni/mixins/transformers/MixinGuiChat.java b/src/main/java/at/hannibal2/skyhanni/mixins/transformers/MixinGuiChat.java index ff744b7d0677..1062479489fe 100644 --- a/src/main/java/at/hannibal2/skyhanni/mixins/transformers/MixinGuiChat.java +++ b/src/main/java/at/hannibal2/skyhanni/mixins/transformers/MixinGuiChat.java @@ -53,7 +53,7 @@ public void chatHoverEvent(int mouseX, int mouseY, float partialTicks, CallbackI // we get the original component back GuiChatHook.INSTANCE.setReplacement((ChatComponentText) component); - new ChatHoverEvent((ChatComponentText) component).postAndCatch(); + new ChatHoverEvent((ChatComponentText) component).post(); } @ModifyArg(method = "drawScreen", at = @At(value = "INVOKE", target = "Lnet/minecraft/client/gui/GuiChat;handleComponentHover(Lnet/minecraft/util/IChatComponent;II)V"), index = 0) diff --git a/src/main/java/at/hannibal2/skyhanni/mixins/transformers/MixinNEUOverlay.java b/src/main/java/at/hannibal2/skyhanni/mixins/transformers/MixinNEUOverlay.java index 1fa663c9ce29..9940f01c1469 100644 --- a/src/main/java/at/hannibal2/skyhanni/mixins/transformers/MixinNEUOverlay.java +++ b/src/main/java/at/hannibal2/skyhanni/mixins/transformers/MixinNEUOverlay.java @@ -14,9 +14,8 @@ public class MixinNEUOverlay { @Inject(method = "render", at = @At("HEAD"), cancellable = true, remap = false) private void render(boolean hoverInv, CallbackInfo ci) { - if (new NEURenderEvent().post()) { + if (NEURenderEvent.INSTANCE.post()) { ci.cancel(); } } - } diff --git a/src/main/java/at/hannibal2/skyhanni/mixins/transformers/renderer/MixinRendererLivingEntity.java b/src/main/java/at/hannibal2/skyhanni/mixins/transformers/renderer/MixinRendererLivingEntity.java index 5ef136e3f5c8..33c23bf29de8 100644 --- a/src/main/java/at/hannibal2/skyhanni/mixins/transformers/renderer/MixinRendererLivingEntity.java +++ b/src/main/java/at/hannibal2/skyhanni/mixins/transformers/renderer/MixinRendererLivingEntity.java @@ -33,7 +33,7 @@ private int changeHurtTime(EntityLivingBase entity) { @Inject(method = "renderLayers", at = @At("HEAD"), cancellable = true) private void onRenderLayersPre(T entity, float p_177093_2_, float p_177093_3_, float partialTicks, float p_177093_5_, float p_177093_6_, float p_177093_7_, float p_177093_8_, CallbackInfo ci) { - if (new EntityRenderLayersEvent.Pre<>(entity).postAndCatch()) { + if (new EntityRenderLayersEvent.Pre<>(entity).post()) { ci.cancel(); } } diff --git a/src/main/java/at/hannibal2/skyhanni/test/SkyHanniDebugsAndTests.kt b/src/main/java/at/hannibal2/skyhanni/test/SkyHanniDebugsAndTests.kt index 40ae671fd71c..fa14402b5c33 100644 --- a/src/main/java/at/hannibal2/skyhanni/test/SkyHanniDebugsAndTests.kt +++ b/src/main/java/at/hannibal2/skyhanni/test/SkyHanniDebugsAndTests.kt @@ -401,7 +401,7 @@ object SkyHanniDebugsAndTests { ChatUtils.chat(result.joinToString("\n"), prefix = false) } - @SubscribeEvent + @HandleEvent fun onKeybind(event: GuiKeyPressEvent) { if (!debugConfig.copyInternalName.isKeyHeld()) return val focussedSlot = event.guiContainer.slotUnderMouse ?: return diff --git a/src/main/java/at/hannibal2/skyhanni/test/TestExportTools.kt b/src/main/java/at/hannibal2/skyhanni/test/TestExportTools.kt index 43a615d53bf6..20c825cf2824 100644 --- a/src/main/java/at/hannibal2/skyhanni/test/TestExportTools.kt +++ b/src/main/java/at/hannibal2/skyhanni/test/TestExportTools.kt @@ -1,6 +1,7 @@ package at.hannibal2.skyhanni.test import at.hannibal2.skyhanni.SkyHanniMod +import at.hannibal2.skyhanni.api.event.HandleEvent import at.hannibal2.skyhanni.config.ConfigUpdaterMigrator import at.hannibal2.skyhanni.events.GuiKeyPressEvent import at.hannibal2.skyhanni.skyhannimodule.SkyHanniModule @@ -52,7 +53,7 @@ object TestExportTools { return gson.fromJson(serializable.data) } - @SubscribeEvent + @HandleEvent fun onKeybind(event: GuiKeyPressEvent) { if (!config.copyItemDataCompressed.isKeyHeld() && !config.copyItemData.isKeyHeld()) return val stack = event.guiContainer.slotUnderMouse?.stack ?: return diff --git a/src/main/java/at/hannibal2/skyhanni/utils/KeyboardManager.kt b/src/main/java/at/hannibal2/skyhanni/utils/KeyboardManager.kt index b6767d4e4539..9c3b8e9b466f 100644 --- a/src/main/java/at/hannibal2/skyhanni/utils/KeyboardManager.kt +++ b/src/main/java/at/hannibal2/skyhanni/utils/KeyboardManager.kt @@ -56,7 +56,7 @@ object KeyboardManager { @SubscribeEvent fun onGuiScreenKeybind(event: GuiScreenEvent.KeyboardInputEvent.Pre) { val guiScreen = event.gui as? GuiContainer ?: return - if (GuiKeyPressEvent(guiScreen).postAndCatch()) { + if (GuiKeyPressEvent(guiScreen).post()) { event.isCanceled = true } }