diff options
author | Empa <42304516+ItsEmpa@users.noreply.github.com> | 2024-10-16 20:22:57 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-10-16 20:22:57 +0200 |
commit | 28086af0aa4ade91b6e1c46f29b659230d45af57 (patch) | |
tree | 9cdcc2cf6eb58ec4f6ce00067a357c317f3a25be /src/main/java/at/hannibal2 | |
parent | e883d0c027e602348416398ba9b14d295ee6b7b4 (diff) | |
download | skyhanni-28086af0aa4ade91b6e1c46f29b659230d45af57.tar.gz skyhanni-28086af0aa4ade91b6e1c46f29b659230d45af57.tar.bz2 skyhanni-28086af0aa4ade91b6e1c46f29b659230d45af57.zip |
Backend: Event Objects (#2744)
Co-authored-by: Empa <itsempa@users.noreply.github.com>
Co-authored-by: Cal <cwolfson58@gmail.com>
Diffstat (limited to 'src/main/java/at/hannibal2')
31 files changed, 56 insertions, 39 deletions
diff --git a/src/main/java/at/hannibal2/skyhanni/SkyHanniMod.kt b/src/main/java/at/hannibal2/skyhanni/SkyHanniMod.kt index 12ad96191..2c14076a9 100644 --- a/src/main/java/at/hannibal2/skyhanni/SkyHanniMod.kt +++ b/src/main/java/at/hannibal2/skyhanni/SkyHanniMod.kt @@ -61,7 +61,7 @@ class SkyHanniMod { CommandRegistrationEvent.post() - PreInitFinishedEvent().post() + PreInitFinishedEvent.post() } @Mod.EventHandler diff --git a/src/main/java/at/hannibal2/skyhanni/api/CollectionAPI.kt b/src/main/java/at/hannibal2/skyhanni/api/CollectionAPI.kt index 1f5adacf7..2584b6616 100644 --- a/src/main/java/at/hannibal2/skyhanni/api/CollectionAPI.kt +++ b/src/main/java/at/hannibal2/skyhanni/api/CollectionAPI.kt @@ -60,7 +60,7 @@ object CollectionAPI { val internalName = incorrectCollectionNames[name] ?: NEUInternalName.fromItemName(name) collectionValue[internalName] = counter } - CollectionUpdateEvent().postAndCatch() + CollectionUpdateEvent.post() } if (inventoryName.endsWith(" Collections")) { @@ -83,7 +83,7 @@ object CollectionAPI { collectionValue[internalName] = counter } } - CollectionUpdateEvent().postAndCatch() + CollectionUpdateEvent.post() } } diff --git a/src/main/java/at/hannibal2/skyhanni/api/FmlEventApi.kt b/src/main/java/at/hannibal2/skyhanni/api/FmlEventApi.kt index c2b1571f4..0adb824a5 100644 --- a/src/main/java/at/hannibal2/skyhanni/api/FmlEventApi.kt +++ b/src/main/java/at/hannibal2/skyhanni/api/FmlEventApi.kt @@ -12,7 +12,7 @@ object FmlEventApi { @SubscribeEvent fun onDisconnect(event: FMLNetworkEvent.ClientDisconnectionFromServerEvent) { - ClientDisconnectEvent().post() + ClientDisconnectEvent.post() } @SubscribeEvent diff --git a/src/main/java/at/hannibal2/skyhanni/data/EntityMovementData.kt b/src/main/java/at/hannibal2/skyhanni/data/EntityMovementData.kt index d38b6824b..db9044ef2 100644 --- a/src/main/java/at/hannibal2/skyhanni/data/EntityMovementData.kt +++ b/src/main/java/at/hannibal2/skyhanni/data/EntityMovementData.kt @@ -4,7 +4,7 @@ import at.hannibal2.skyhanni.events.EntityMoveEvent import at.hannibal2.skyhanni.events.IslandChangeEvent import at.hannibal2.skyhanni.events.LorenzChatEvent import at.hannibal2.skyhanni.events.LorenzTickEvent -import at.hannibal2.skyhanni.events.LorenzWarpEvent +import at.hannibal2.skyhanni.events.SkyHanniWarpEvent import at.hannibal2.skyhanni.events.LorenzWorldChangeEvent import at.hannibal2.skyhanni.skyhannimodule.SkyHanniModule import at.hannibal2.skyhanni.utils.DelayedRun @@ -104,7 +104,7 @@ object EntityMovementData { if (!LorenzUtils.inSkyBlock) return if (!warpingPattern.matches(event.message)) return DelayedRun.runNextTick { - LorenzWarpEvent().postAndCatch() + SkyHanniWarpEvent.post() } } diff --git a/src/main/java/at/hannibal2/skyhanni/data/GardenCropMilestones.kt b/src/main/java/at/hannibal2/skyhanni/data/GardenCropMilestones.kt index 5e236c4c5..d8fab21f4 100644 --- a/src/main/java/at/hannibal2/skyhanni/data/GardenCropMilestones.kt +++ b/src/main/java/at/hannibal2/skyhanni/data/GardenCropMilestones.kt @@ -51,7 +51,7 @@ object GardenCropMilestones { crop.setCounter(amount) } } - CropMilestoneUpdateEvent().postAndCatch() + CropMilestoneUpdateEvent.post() GardenCropMilestonesCommunityFix.openInventory(event.inventoryItems) } diff --git a/src/main/java/at/hannibal2/skyhanni/data/GuiData.kt b/src/main/java/at/hannibal2/skyhanni/data/GuiData.kt index 5f2ca510b..688f8cc18 100644 --- a/src/main/java/at/hannibal2/skyhanni/data/GuiData.kt +++ b/src/main/java/at/hannibal2/skyhanni/data/GuiData.kt @@ -24,7 +24,7 @@ object GuiData { var preDrawEventCancelled = false - @SubscribeEvent(priority = EventPriority.HIGH) + @HandleEvent(priority = HandleEvent.HIGH) fun onNeuRenderEvent(event: NEURenderEvent) { if (preDrawEventCancelled) event.cancel() } diff --git a/src/main/java/at/hannibal2/skyhanni/data/SackAPI.kt b/src/main/java/at/hannibal2/skyhanni/data/SackAPI.kt index 24dacafbd..5235284ff 100644 --- a/src/main/java/at/hannibal2/skyhanni/data/SackAPI.kt +++ b/src/main/java/at/hannibal2/skyhanni/data/SackAPI.kt @@ -334,7 +334,7 @@ object SackAPI { ProfileStorageData.sackProfiles?.sackContents = sackData SkyHanniMod.configManager.saveConfig(ConfigFileType.SACKS, "saving-data") - SackDataUpdateEvent().postAndCatch() + SackDataUpdateEvent.post() } data class SackGemstone( diff --git a/src/main/java/at/hannibal2/skyhanni/data/SlayerAPI.kt b/src/main/java/at/hannibal2/skyhanni/data/SlayerAPI.kt index 0d91c7f62..2eb2bc293 100644 --- a/src/main/java/at/hannibal2/skyhanni/data/SlayerAPI.kt +++ b/src/main/java/at/hannibal2/skyhanni/data/SlayerAPI.kt @@ -82,7 +82,7 @@ object SlayerAPI { } if (event.message == " §r§a§lSLAYER QUEST COMPLETE!") { - SlayerQuestCompleteEvent().postAndCatch() + SlayerQuestCompleteEvent.post() } } diff --git a/src/main/java/at/hannibal2/skyhanni/events/CollectionUpdateEvent.kt b/src/main/java/at/hannibal2/skyhanni/events/CollectionUpdateEvent.kt index f4c46d0b7..2dd016e95 100644 --- a/src/main/java/at/hannibal2/skyhanni/events/CollectionUpdateEvent.kt +++ b/src/main/java/at/hannibal2/skyhanni/events/CollectionUpdateEvent.kt @@ -1,3 +1,5 @@ package at.hannibal2.skyhanni.events -class CollectionUpdateEvent : LorenzEvent() +import at.hannibal2.skyhanni.api.event.SkyHanniEvent + +object CollectionUpdateEvent : SkyHanniEvent() diff --git a/src/main/java/at/hannibal2/skyhanni/events/CropMilestoneUpdateEvent.kt b/src/main/java/at/hannibal2/skyhanni/events/CropMilestoneUpdateEvent.kt index 8da8b20f7..feebc16af 100644 --- a/src/main/java/at/hannibal2/skyhanni/events/CropMilestoneUpdateEvent.kt +++ b/src/main/java/at/hannibal2/skyhanni/events/CropMilestoneUpdateEvent.kt @@ -1,3 +1,5 @@ package at.hannibal2.skyhanni.events -class CropMilestoneUpdateEvent : LorenzEvent() +import at.hannibal2.skyhanni.api.event.SkyHanniEvent + +object CropMilestoneUpdateEvent : SkyHanniEvent() diff --git a/src/main/java/at/hannibal2/skyhanni/events/DungeonBossRoomEnterEvent.kt b/src/main/java/at/hannibal2/skyhanni/events/DungeonBossRoomEnterEvent.kt index 9f372d5c3..ec1f35412 100644 --- a/src/main/java/at/hannibal2/skyhanni/events/DungeonBossRoomEnterEvent.kt +++ b/src/main/java/at/hannibal2/skyhanni/events/DungeonBossRoomEnterEvent.kt @@ -1,3 +1,5 @@ package at.hannibal2.skyhanni.events -class DungeonBossRoomEnterEvent : LorenzEvent() +import at.hannibal2.skyhanni.api.event.SkyHanniEvent + +object DungeonBossRoomEnterEvent : SkyHanniEvent() diff --git a/src/main/java/at/hannibal2/skyhanni/events/LorenzWarpEvent.kt b/src/main/java/at/hannibal2/skyhanni/events/LorenzWarpEvent.kt deleted file mode 100644 index 170dcabe9..000000000 --- a/src/main/java/at/hannibal2/skyhanni/events/LorenzWarpEvent.kt +++ /dev/null @@ -1,3 +0,0 @@ -package at.hannibal2.skyhanni.events - -class LorenzWarpEvent : LorenzEvent() diff --git a/src/main/java/at/hannibal2/skyhanni/events/NEURenderEvent.kt b/src/main/java/at/hannibal2/skyhanni/events/NEURenderEvent.kt index c2bcc9b49..af8587178 100644 --- a/src/main/java/at/hannibal2/skyhanni/events/NEURenderEvent.kt +++ b/src/main/java/at/hannibal2/skyhanni/events/NEURenderEvent.kt @@ -1,6 +1,5 @@ package at.hannibal2.skyhanni.events -import net.minecraftforge.fml.common.eventhandler.Cancelable +import at.hannibal2.skyhanni.api.event.CancellableSkyHanniEvent -@Cancelable -class NEURenderEvent : LorenzEvent() +class NEURenderEvent : CancellableSkyHanniEvent() diff --git a/src/main/java/at/hannibal2/skyhanni/events/SackDataUpdateEvent.kt b/src/main/java/at/hannibal2/skyhanni/events/SackDataUpdateEvent.kt index f9e3831d1..f156d31fc 100644 --- a/src/main/java/at/hannibal2/skyhanni/events/SackDataUpdateEvent.kt +++ b/src/main/java/at/hannibal2/skyhanni/events/SackDataUpdateEvent.kt @@ -1,3 +1,5 @@ package at.hannibal2.skyhanni.events -class SackDataUpdateEvent : LorenzEvent() +import at.hannibal2.skyhanni.api.event.SkyHanniEvent + +object SackDataUpdateEvent : SkyHanniEvent() diff --git a/src/main/java/at/hannibal2/skyhanni/events/SkyHanniWarpEvent.kt b/src/main/java/at/hannibal2/skyhanni/events/SkyHanniWarpEvent.kt new file mode 100644 index 000000000..18560da4c --- /dev/null +++ b/src/main/java/at/hannibal2/skyhanni/events/SkyHanniWarpEvent.kt @@ -0,0 +1,5 @@ +package at.hannibal2.skyhanni.events + +import at.hannibal2.skyhanni.api.event.SkyHanniEvent + +object SkyHanniWarpEvent : SkyHanniEvent() diff --git a/src/main/java/at/hannibal2/skyhanni/events/SlayerQuestCompleteEvent.kt b/src/main/java/at/hannibal2/skyhanni/events/SlayerQuestCompleteEvent.kt index b7e0edfed..6b0185fe1 100644 --- a/src/main/java/at/hannibal2/skyhanni/events/SlayerQuestCompleteEvent.kt +++ b/src/main/java/at/hannibal2/skyhanni/events/SlayerQuestCompleteEvent.kt @@ -1,3 +1,5 @@ package at.hannibal2.skyhanni.events -class SlayerQuestCompleteEvent : LorenzEvent() +import at.hannibal2.skyhanni.api.event.SkyHanniEvent + +object SlayerQuestCompleteEvent : SkyHanniEvent() diff --git a/src/main/java/at/hannibal2/skyhanni/events/bingo/BingoCardUpdateEvent.kt b/src/main/java/at/hannibal2/skyhanni/events/bingo/BingoCardUpdateEvent.kt index de9a83214..eed37ff0a 100644 --- a/src/main/java/at/hannibal2/skyhanni/events/bingo/BingoCardUpdateEvent.kt +++ b/src/main/java/at/hannibal2/skyhanni/events/bingo/BingoCardUpdateEvent.kt @@ -2,4 +2,4 @@ package at.hannibal2.skyhanni.events.bingo import at.hannibal2.skyhanni.api.event.SkyHanniEvent -class BingoCardUpdateEvent : SkyHanniEvent() +object BingoCardUpdateEvent : SkyHanniEvent() diff --git a/src/main/java/at/hannibal2/skyhanni/events/garden/pests/PestUpdateEvent.kt b/src/main/java/at/hannibal2/skyhanni/events/garden/pests/PestUpdateEvent.kt index c4c299b13..54df3b20b 100644 --- a/src/main/java/at/hannibal2/skyhanni/events/garden/pests/PestUpdateEvent.kt +++ b/src/main/java/at/hannibal2/skyhanni/events/garden/pests/PestUpdateEvent.kt @@ -2,4 +2,4 @@ package at.hannibal2.skyhanni.events.garden.pests import at.hannibal2.skyhanni.api.event.SkyHanniEvent -class PestUpdateEvent : SkyHanniEvent() +object PestUpdateEvent : SkyHanniEvent() diff --git a/src/main/java/at/hannibal2/skyhanni/events/minecraft/ClientDisconnectEvent.kt b/src/main/java/at/hannibal2/skyhanni/events/minecraft/ClientDisconnectEvent.kt index 6c7a5e8a1..1a6b31c4c 100644 --- a/src/main/java/at/hannibal2/skyhanni/events/minecraft/ClientDisconnectEvent.kt +++ b/src/main/java/at/hannibal2/skyhanni/events/minecraft/ClientDisconnectEvent.kt @@ -2,4 +2,4 @@ package at.hannibal2.skyhanni.events.minecraft import at.hannibal2.skyhanni.api.event.SkyHanniEvent -class ClientDisconnectEvent : SkyHanniEvent() +object ClientDisconnectEvent : SkyHanniEvent() diff --git a/src/main/java/at/hannibal2/skyhanni/events/utils/PreInitFinishedEvent.kt b/src/main/java/at/hannibal2/skyhanni/events/utils/PreInitFinishedEvent.kt index 1d52761ed..e2ab833a7 100644 --- a/src/main/java/at/hannibal2/skyhanni/events/utils/PreInitFinishedEvent.kt +++ b/src/main/java/at/hannibal2/skyhanni/events/utils/PreInitFinishedEvent.kt @@ -2,4 +2,4 @@ package at.hannibal2.skyhanni.events.utils import at.hannibal2.skyhanni.api.event.SkyHanniEvent -class PreInitFinishedEvent : SkyHanniEvent() +object PreInitFinishedEvent : SkyHanniEvent() diff --git a/src/main/java/at/hannibal2/skyhanni/features/bingo/card/BingoCardReader.kt b/src/main/java/at/hannibal2/skyhanni/features/bingo/card/BingoCardReader.kt index 1afa6859d..98b266053 100644 --- a/src/main/java/at/hannibal2/skyhanni/features/bingo/card/BingoCardReader.kt +++ b/src/main/java/at/hannibal2/skyhanni/features/bingo/card/BingoCardReader.kt @@ -96,7 +96,7 @@ object BingoCardReader { } BingoAPI.lastBingoCardOpenTime = SimpleTimeMark.now() - BingoCardUpdateEvent().post() + BingoCardUpdateEvent.post() } private fun bingoGoalDifference(bingoGoal: BingoGoal, new: Double) { @@ -163,7 +163,7 @@ object BingoCardReader { val goal = BingoAPI.personalGoals.firstOrNull { it.displayName == name } ?: return goal.done = true BingoGoalReachedEvent(goal).post() - BingoCardUpdateEvent().post() + BingoCardUpdateEvent.post() } private fun BingoData.getDescriptionLine() = "§7" + note.joinToString(" ") 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 254e04dca..95c7a3f87 100644 --- a/src/main/java/at/hannibal2/skyhanni/features/dungeon/DungeonAPI.kt +++ b/src/main/java/at/hannibal2/skyhanni/features/dungeon/DungeonAPI.kt @@ -123,7 +123,7 @@ object DungeonAPI { val message = rawMessage.removeColor() val bossName = message.substringAfter("[BOSS] ").substringBefore(":").trim() if ((bossName != "The Watcher") && dungeonFloor != null && checkBossName(bossName) && !inBossRoom) { - DungeonBossRoomEnterEvent().postAndCatch() + DungeonBossRoomEnterEvent.post() inBossRoom = true } } 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 11d749b66..e4bc9b0fc 100644 --- a/src/main/java/at/hannibal2/skyhanni/features/dungeon/DungeonCopilot.kt +++ b/src/main/java/at/hannibal2/skyhanni/features/dungeon/DungeonCopilot.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.ConfigUpdaterMigrator import at.hannibal2.skyhanni.events.CheckRenderEntityEvent import at.hannibal2.skyhanni.events.DungeonBossRoomEnterEvent @@ -133,7 +134,7 @@ object DungeonCopilot { searchForKey = true } - @SubscribeEvent + @HandleEvent fun onDungeonBossRoomEnter(event: DungeonBossRoomEnterEvent) { changeNextStep("Defeat the boss! Good luck :)") } 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 9a47acaa1..924ea00f7 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 @@ -1,5 +1,6 @@ package at.hannibal2.skyhanni.features.garden.farming +import at.hannibal2.skyhanni.api.event.HandleEvent import at.hannibal2.skyhanni.data.GardenCropMilestones.getCounter import at.hannibal2.skyhanni.events.CropClickEvent import at.hannibal2.skyhanni.events.CropMilestoneUpdateEvent @@ -76,7 +77,7 @@ object CropSpeedMeter { return list } - @SubscribeEvent + @HandleEvent fun onCropMilestoneUpdate(event: CropMilestoneUpdateEvent) { if (!isEnabled()) return val counters = mutableMapOf<CropType, Long>() diff --git a/src/main/java/at/hannibal2/skyhanni/features/garden/farming/GardenCropMilestoneDisplay.kt b/src/main/java/at/hannibal2/skyhanni/features/garden/farming/GardenCropMilestoneDisplay.kt index aca1751b0..734df7630 100644 --- a/src/main/java/at/hannibal2/skyhanni/features/garden/farming/GardenCropMilestoneDisplay.kt +++ b/src/main/java/at/hannibal2/skyhanni/features/garden/farming/GardenCropMilestoneDisplay.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.config.features.garden.cropmilestones.CropMilestonesConfig.MilestoneTextEntry import at.hannibal2.skyhanni.config.features.garden.cropmilestones.CropMilestonesConfig.TimeFormatEntry @@ -99,7 +100,7 @@ object GardenCropMilestoneDisplay { } } - @SubscribeEvent + @HandleEvent fun onCropMilestoneUpdate(event: CropMilestoneUpdateEvent) { needsInventory = false GardenBestCropTime.updateTimeTillNextCrop() diff --git a/src/main/java/at/hannibal2/skyhanni/features/garden/inventory/GardenCropMilestoneInventory.kt b/src/main/java/at/hannibal2/skyhanni/features/garden/inventory/GardenCropMilestoneInventory.kt index e0cb07073..826913669 100644 --- a/src/main/java/at/hannibal2/skyhanni/features/garden/inventory/GardenCropMilestoneInventory.kt +++ b/src/main/java/at/hannibal2/skyhanni/features/garden/inventory/GardenCropMilestoneInventory.kt @@ -1,5 +1,6 @@ package at.hannibal2.skyhanni.features.garden.inventory +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 @@ -24,7 +25,7 @@ object GardenCropMilestoneInventory { private var average = -1.0 private val config get() = GardenAPI.config - @SubscribeEvent + @HandleEvent fun onCropMilestoneUpdate(event: CropMilestoneUpdateEvent) { if (!config.number.averageCropMilestone) 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 d49de324c..e239caeab 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 @@ -155,7 +155,7 @@ object PestAPI { private fun updatePests() { if (!firstScoreboardCheck) return fixPests() - PestUpdateEvent().post() + PestUpdateEvent.post() } @HandleEvent(onlyOnIsland = IslandType.GARDEN) 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 641ad717e..c9f8b22b2 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 @@ -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.VisitorConfig.HighlightMode import at.hannibal2.skyhanni.data.IslandType @@ -336,7 +337,7 @@ object GardenVisitorFeatures { } } - @SubscribeEvent + @HandleEvent fun onSackUpdate(event: SackDataUpdateEvent) { update() } diff --git a/src/main/java/at/hannibal2/skyhanni/features/mining/TunnelsMaps.kt b/src/main/java/at/hannibal2/skyhanni/features/mining/TunnelsMaps.kt index 2d7487ddc..c3d89d98e 100644 --- a/src/main/java/at/hannibal2/skyhanni/features/mining/TunnelsMaps.kt +++ b/src/main/java/at/hannibal2/skyhanni/features/mining/TunnelsMaps.kt @@ -17,7 +17,7 @@ import at.hannibal2.skyhanni.events.LorenzKeyPressEvent import at.hannibal2.skyhanni.events.LorenzRenderWorldEvent import at.hannibal2.skyhanni.events.LorenzTickEvent import at.hannibal2.skyhanni.events.LorenzToolTipEvent -import at.hannibal2.skyhanni.events.LorenzWarpEvent +import at.hannibal2.skyhanni.events.SkyHanniWarpEvent import at.hannibal2.skyhanni.events.RepositoryReloadEvent import at.hannibal2.skyhanni.skyhannimodule.SkyHanniModule import at.hannibal2.skyhanni.test.command.ErrorManager @@ -502,8 +502,8 @@ object TunnelsMaps { } } - @SubscribeEvent - fun onLorenzWarp(event: LorenzWarpEvent) { + @HandleEvent + fun onWarp(event: SkyHanniWarpEvent) { if (!isEnabled()) return if (goal != null) { DelayedRun.runNextTick { 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 defde1cf2..63c0adbc8 100644 --- a/src/main/java/at/hannibal2/skyhanni/features/slayer/SlayerProfitTracker.kt +++ b/src/main/java/at/hannibal2/skyhanni/features/slayer/SlayerProfitTracker.kt @@ -1,6 +1,7 @@ package at.hannibal2.skyhanni.features.slayer import at.hannibal2.skyhanni.SkyHanniMod +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.ItemAddManager @@ -143,7 +144,7 @@ object SlayerProfitTracker { } } - @SubscribeEvent + @HandleEvent fun onQuestComplete(event: SlayerQuestCompleteEvent) { getTracker()?.modify { it.slayerCompletedCount++ 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 9ac228f29..9f6e1bb1f 100644 --- a/src/main/java/at/hannibal2/skyhanni/mixins/transformers/MixinNEUOverlay.java +++ b/src/main/java/at/hannibal2/skyhanni/mixins/transformers/MixinNEUOverlay.java @@ -12,7 +12,7 @@ public class MixinNEUOverlay { @Inject(method = "render", at = @At("HEAD"), cancellable = true, remap = false) private void render(boolean hoverInv, CallbackInfo ci) { - if (new NEURenderEvent().postAndCatch()) { + if (new NEURenderEvent().post()) { ci.cancel(); } } |