From 983f9a8ac26cdb96cc1d722993c4c6d0cd166b44 Mon Sep 17 00:00:00 2001 From: Cal Date: Mon, 9 Dec 2024 21:44:15 +1100 Subject: [PATCH] how much more do i need? --- src/main/java/at/hannibal2/skyhanni/api/SkillAPI.kt | 4 ++-- .../{events => api/enoughupdates}/NeuEventWrappers.kt | 4 +++- src/main/java/at/hannibal2/skyhanni/data/BitsAPI.kt | 3 ++- src/main/java/at/hannibal2/skyhanni/data/BlockData.kt | 4 ++-- src/main/java/at/hannibal2/skyhanni/data/GuiData.kt | 2 +- src/main/java/at/hannibal2/skyhanni/data/HotmData.kt | 3 ++- .../java/at/hannibal2/skyhanni/data/HypixelData.kt | 2 +- src/main/java/at/hannibal2/skyhanni/data/MiningAPI.kt | 4 ++-- src/main/java/at/hannibal2/skyhanni/data/PurseAPI.kt | 5 +++-- .../java/at/hannibal2/skyhanni/data/ScoreboardData.kt | 4 ++-- src/main/java/at/hannibal2/skyhanni/data/SlayerAPI.kt | 4 ++-- src/main/java/at/hannibal2/skyhanni/data/TitleData.kt | 2 +- .../java/at/hannibal2/skyhanni/data/model/TabWidget.kt | 3 ++- .../at/hannibal2/skyhanni/events/MinionOpenEvent.kt | 7 ++++--- .../{api/enoughupdates => events}/NEURenderEvent.kt | 2 +- .../at/hannibal2/skyhanni/events/PurseChangeEvent.kt | 4 +++- .../skyhanni/events/RawScoreboardUpdateEvent.kt | 4 +++- .../skyhanni/events/RenderBlockInWorldEvent.kt | 9 --------- .../skyhanni/events/RenderGuiItemOverlayEvent.kt | 3 ++- .../skyhanni/events/RenderItemTooltipEvent.kt | 3 ++- .../hannibal2/skyhanni/events/ScoreboardUpdateEvent.kt | 4 +++- .../hannibal2/skyhanni/events/SeaCreatureFishEvent.kt | 3 ++- .../skyhanni/events/ServerBlockChangeEvent.kt | 3 ++- .../at/hannibal2/skyhanni/events/SkillExpGainEvent.kt | 3 ++- .../skyhanni/events/SkillOverflowLevelUpEvent.kt | 3 ++- .../hannibal2/skyhanni/events/SkipTabListLineEvent.kt | 5 ++--- .../at/hannibal2/skyhanni/events/SlayerChangeEvent.kt | 4 +++- .../skyhanni/events/SlayerProgressChangeEvent.kt | 4 +++- .../skyhanni/events/TabListLineRenderEvent.kt | 4 +++- .../at/hannibal2/skyhanni/events/TabListUpdateEvent.kt | 4 +++- .../skyhanni/events/TablistFooterUpdateEvent.kt | 4 +++- .../at/hannibal2/skyhanni/events/TitleReceivedEvent.kt | 5 ++--- .../features/combat/ghosttracker/GhostTracker.kt | 4 ++-- .../hannibal2/skyhanni/features/dungeon/DungeonAPI.kt | 6 +++--- .../features/dungeon/DungeonRankTabListColor.kt | 4 ++-- .../features/event/carnival/CarnivalZombieShootout.kt | 3 ++- .../event/lobby/waypoints/halloween/BasketWaypoints.kt | 3 ++- .../skyhanni/features/fishing/FishingTimer.kt | 3 ++- .../skyhanni/features/fishing/SeaCreatureFeatures.kt | 3 ++- .../skyhanni/features/fishing/SeaCreatureManager.kt | 2 +- .../features/fishing/SeaCreatureMessageShortener.kt | 4 ++-- .../skyhanni/features/fishing/SharkFishCounter.kt | 3 ++- .../features/fishing/tracker/SeaCreatureTracker.kt | 2 +- .../skyhanni/features/garden/FarmingFortuneDisplay.kt | 2 +- .../skyhanni/features/garden/GardenNextJacobContest.kt | 3 ++- .../features/garden/composter/ComposterOverlay.kt | 4 ++-- .../garden/contest/JacobContestFFNeededDisplay.kt | 3 ++- .../skyhanni/features/garden/pests/PestAPI.kt | 4 ++-- .../features/garden/pests/PestProfitTracker.kt | 2 +- .../features/gui/customscoreboard/CustomScoreboard.kt | 2 +- .../skyhanni/features/inventory/ItemPickupLog.kt | 2 +- .../abilitycooldown/ItemAbilityCooldown.kt | 2 +- .../features/mining/HighlightMiningCommissionMobs.kt | 2 +- .../features/mining/MiningCommissionsBlocksColor.kt | 3 ++- .../skyhanni/features/minion/MinionCollectLogic.kt | 3 ++- .../skyhanni/features/minion/MinionFeatures.kt | 10 +++++----- .../at/hannibal2/skyhanni/features/minion/MinionXp.kt | 7 ++++--- .../features/misc/compacttablist/TabListReader.kt | 3 ++- .../features/misc/compacttablist/TabListRenderer.kt | 5 +++-- .../skyhanni/features/misc/items/EstimatedItemValue.kt | 2 +- .../rift/area/livingcave/LivingCaveDefenseBlocks.kt | 3 ++- .../area/livingcave/LivingCaveLivingMetalHelper.kt | 4 ++-- .../features/rift/area/mirrorverse/DanceRoomHelper.kt | 2 +- .../rift/area/stillgorechateau/RiftBloodEffigies.kt | 3 ++- .../skyhanni/features/skillprogress/SkillProgress.kt | 2 +- .../skyhanni/features/slayer/SlayerBossSpawnSoon.kt | 4 ++-- .../skyhanni/features/slayer/SlayerProfitTracker.kt | 4 ++-- .../skyhanni/features/slayer/SlayerQuestWarning.kt | 3 +-- .../skyhanni/features/slayer/SlayerRngMeterDisplay.kt | 3 ++- .../features/slayer/blaze/BlazeSlayerDaggerHelper.kt | 7 +++---- .../features/slayer/enderman/EndermanSlayerFeatures.kt | 2 +- .../skyhanni/mixins/hooks/GuiPlayerTabOverlayHook.kt | 2 +- .../hannibal2/skyhanni/mixins/hooks/GuiScreenHook.kt | 2 +- .../hannibal2/skyhanni/mixins/hooks/RenderItemHook.kt | 2 +- .../skyhanni/mixins/transformers/MixinNEUOverlay.java | 2 +- .../java/at/hannibal2/skyhanni/utils/TabListData.kt | 6 +++--- 76 files changed, 150 insertions(+), 119 deletions(-) rename src/main/java/at/hannibal2/skyhanni/{events => api/enoughupdates}/NeuEventWrappers.kt (94%) rename src/main/java/at/hannibal2/skyhanni/{api/enoughupdates => events}/NEURenderEvent.kt (70%) delete mode 100644 src/main/java/at/hannibal2/skyhanni/events/RenderBlockInWorldEvent.kt diff --git a/src/main/java/at/hannibal2/skyhanni/api/SkillAPI.kt b/src/main/java/at/hannibal2/skyhanni/api/SkillAPI.kt index 4c7d1ad89d97..691ebba712de 100644 --- a/src/main/java/at/hannibal2/skyhanni/api/SkillAPI.kt +++ b/src/main/java/at/hannibal2/skyhanni/api/SkillAPI.kt @@ -126,7 +126,7 @@ object SkillAPI { skillMultiplierPattern -> handleSkillPatternMultiplier(matcher, skillType, skillInfo) } - SkillExpGainEvent(skillType, matcher.group("gained").formatDouble()).postAndCatch() + SkillExpGainEvent(skillType, matcher.group("gained").formatDouble()).post() showDisplay = true lastUpdate = SimpleTimeMark.now() @@ -274,7 +274,7 @@ object SkillAPI { calculateSkillLevel(totalXp, cap) if (skillInfo.overflowLevel > 60 && levelOverflow == skillInfo.overflowLevel + 1) - SkillOverflowLevelUpEvent(skillType, skillInfo.overflowLevel, levelOverflow).postAndCatch() + SkillOverflowLevelUpEvent(skillType, skillInfo.overflowLevel, levelOverflow).post() skillInfo.apply { this.level = level diff --git a/src/main/java/at/hannibal2/skyhanni/events/NeuEventWrappers.kt b/src/main/java/at/hannibal2/skyhanni/api/enoughupdates/NeuEventWrappers.kt similarity index 94% rename from src/main/java/at/hannibal2/skyhanni/events/NeuEventWrappers.kt rename to src/main/java/at/hannibal2/skyhanni/api/enoughupdates/NeuEventWrappers.kt index dc59e0b7aef4..319a2f0cbade 100644 --- a/src/main/java/at/hannibal2/skyhanni/events/NeuEventWrappers.kt +++ b/src/main/java/at/hannibal2/skyhanni/api/enoughupdates/NeuEventWrappers.kt @@ -1,7 +1,9 @@ -package at.hannibal2.skyhanni.events +package at.hannibal2.skyhanni.api.enoughupdates import at.hannibal2.skyhanni.data.jsonobjects.other.HypixelApiTrophyFish import at.hannibal2.skyhanni.data.jsonobjects.other.HypixelPlayerApiJson +import at.hannibal2.skyhanni.events.NeuProfileDataLoadedEvent +import at.hannibal2.skyhanni.events.NeuRepositoryReloadEvent import at.hannibal2.skyhanni.skyhannimodule.SkyHanniModule import at.hannibal2.skyhanni.test.command.ErrorManager import at.hannibal2.skyhanni.utils.NumberUtil.isInt diff --git a/src/main/java/at/hannibal2/skyhanni/data/BitsAPI.kt b/src/main/java/at/hannibal2/skyhanni/data/BitsAPI.kt index a2646d6925dc..06f28d89ce28 100644 --- a/src/main/java/at/hannibal2/skyhanni/data/BitsAPI.kt +++ b/src/main/java/at/hannibal2/skyhanni/data/BitsAPI.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.ConfigUpdaterMigrator import at.hannibal2.skyhanni.data.FameRanks.getFameRankByNameOrNull import at.hannibal2.skyhanni.events.BitsUpdateEvent @@ -187,7 +188,7 @@ object BitsAPI { "^§aCommunity Shop|§eFame Rank$", ) - @SubscribeEvent + @HandleEvent fun onScoreboardChange(event: ScoreboardUpdateEvent) { if (!isEnabled()) return for (line in event.added) { diff --git a/src/main/java/at/hannibal2/skyhanni/data/BlockData.kt b/src/main/java/at/hannibal2/skyhanni/data/BlockData.kt index 0dcc1714e1a1..ec135d96b187 100644 --- a/src/main/java/at/hannibal2/skyhanni/data/BlockData.kt +++ b/src/main/java/at/hannibal2/skyhanni/data/BlockData.kt @@ -15,10 +15,10 @@ object BlockData { if (event.packet is S23PacketBlockChange) { val blockPos = event.packet.blockPosition ?: return val blockState = event.packet.blockState ?: return - ServerBlockChangeEvent(blockPos, blockState).postAndCatch() + ServerBlockChangeEvent(blockPos, blockState).post() } else if (event.packet is S22PacketMultiBlockChange) { for (block in event.packet.changedBlocks) { - ServerBlockChangeEvent(block.pos, block.blockState).postAndCatch() + ServerBlockChangeEvent(block.pos, block.blockState).post() } } } diff --git a/src/main/java/at/hannibal2/skyhanni/data/GuiData.kt b/src/main/java/at/hannibal2/skyhanni/data/GuiData.kt index 7023cddc27b5..457b6c42648f 100644 --- a/src/main/java/at/hannibal2/skyhanni/data/GuiData.kt +++ b/src/main/java/at/hannibal2/skyhanni/data/GuiData.kt @@ -1,10 +1,10 @@ package at.hannibal2.skyhanni.data -import at.hannibal2.skyhanni.api.enoughupdates.NEURenderEvent import at.hannibal2.skyhanni.api.event.HandleEvent import at.hannibal2.skyhanni.events.GuiContainerEvent import at.hannibal2.skyhanni.events.InventoryCloseEvent import at.hannibal2.skyhanni.events.LorenzWorldChangeEvent +import at.hannibal2.skyhanni.events.NEURenderEvent import at.hannibal2.skyhanni.events.minecraft.ClientDisconnectEvent import at.hannibal2.skyhanni.features.inventory.wardrobe.CustomWardrobeKeybinds import at.hannibal2.skyhanni.skyhannimodule.SkyHanniModule diff --git a/src/main/java/at/hannibal2/skyhanni/data/HotmData.kt b/src/main/java/at/hannibal2/skyhanni/data/HotmData.kt index 5ee38ccae8e8..fbd4fee0bf10 100644 --- a/src/main/java/at/hannibal2/skyhanni/data/HotmData.kt +++ b/src/main/java/at/hannibal2/skyhanni/data/HotmData.kt @@ -3,6 +3,7 @@ package at.hannibal2.skyhanni.data import at.hannibal2.skyhanni.api.HotmAPI import at.hannibal2.skyhanni.api.HotmAPI.MayhemPerk import at.hannibal2.skyhanni.api.HotmAPI.SkymallPerk +import at.hannibal2.skyhanni.api.event.HandleEvent import at.hannibal2.skyhanni.config.storage.ProfileSpecificStorage import at.hannibal2.skyhanni.data.jsonobjects.local.HotmTree import at.hannibal2.skyhanni.data.model.TabWidget @@ -690,7 +691,7 @@ enum class HotmData( } } - @SubscribeEvent + @HandleEvent fun onScoreboardUpdate(event: ScoreboardUpdateEvent) { if (!LorenzUtils.inSkyBlock) return diff --git a/src/main/java/at/hannibal2/skyhanni/data/HypixelData.kt b/src/main/java/at/hannibal2/skyhanni/data/HypixelData.kt index b243fe9be355..434bfee78668 100644 --- a/src/main/java/at/hannibal2/skyhanni/data/HypixelData.kt +++ b/src/main/java/at/hannibal2/skyhanni/data/HypixelData.kt @@ -355,7 +355,7 @@ object HypixelData { hasScoreboardUpdated = false } - @SubscribeEvent + @HandleEvent fun onScoreboardUpdate(event: ScoreboardUpdateEvent) { hasScoreboardUpdated = true } diff --git a/src/main/java/at/hannibal2/skyhanni/data/MiningAPI.kt b/src/main/java/at/hannibal2/skyhanni/data/MiningAPI.kt index 575c2af4040e..945fedb9c8bf 100644 --- a/src/main/java/at/hannibal2/skyhanni/data/MiningAPI.kt +++ b/src/main/java/at/hannibal2/skyhanni/data/MiningAPI.kt @@ -190,7 +190,7 @@ object MiningAPI { fun inColdIsland() = inAnyIsland(IslandType.DWARVEN_MINES, IslandType.MINESHAFT) - @SubscribeEvent + @HandleEvent fun onScoreboardChange(event: ScoreboardUpdateEvent) { if (!inCustomMiningIsland()) return @@ -300,7 +300,7 @@ object MiningAPI { } } - @SubscribeEvent + @HandleEvent fun onBlockChange(event: ServerBlockChangeEvent) { if (!inCustomMiningIsland()) return val oldState = event.oldState diff --git a/src/main/java/at/hannibal2/skyhanni/data/PurseAPI.kt b/src/main/java/at/hannibal2/skyhanni/data/PurseAPI.kt index 4a355319ddf6..ef2494837c3a 100644 --- a/src/main/java/at/hannibal2/skyhanni/data/PurseAPI.kt +++ b/src/main/java/at/hannibal2/skyhanni/data/PurseAPI.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.PurseChangeCause import at.hannibal2.skyhanni.events.PurseChangeEvent @@ -44,7 +45,7 @@ object PurseAPI { inventoryCloseTime = SimpleTimeMark.now() } - @SubscribeEvent + @HandleEvent fun onScoreboardChange(event: ScoreboardUpdateEvent) { coinsPattern.firstMatcher(event.added) { val newPurse = group("coins").formatDouble() @@ -52,7 +53,7 @@ object PurseAPI { if (diff == 0.0) return currentPurse = newPurse - PurseChangeEvent(diff, currentPurse, getCause(diff)).postAndCatch() + PurseChangeEvent(diff, currentPurse, getCause(diff)).post() } } diff --git a/src/main/java/at/hannibal2/skyhanni/data/ScoreboardData.kt b/src/main/java/at/hannibal2/skyhanni/data/ScoreboardData.kt index cf2e93a9d5bc..02bf5c93e7e3 100644 --- a/src/main/java/at/hannibal2/skyhanni/data/ScoreboardData.kt +++ b/src/main/java/at/hannibal2/skyhanni/data/ScoreboardData.kt @@ -111,7 +111,7 @@ object ScoreboardData { val semiFormatted = list.map { cleanSB(it) } if (semiFormatted != sidebarLines) { sidebarLines = semiFormatted - RawScoreboardUpdateEvent(semiFormatted).postAndCatch() + RawScoreboardUpdateEvent(semiFormatted).post() } sidebarLinesRaw = list @@ -119,7 +119,7 @@ object ScoreboardData { if (new != sidebarLinesFormatted) { val old = sidebarLinesFormatted sidebarLinesFormatted = new - ScoreboardUpdateEvent(new, old).postAndCatch() + ScoreboardUpdateEvent(new, old).post() } } diff --git a/src/main/java/at/hannibal2/skyhanni/data/SlayerAPI.kt b/src/main/java/at/hannibal2/skyhanni/data/SlayerAPI.kt index 35d53834ea61..168ac433add0 100644 --- a/src/main/java/at/hannibal2/skyhanni/data/SlayerAPI.kt +++ b/src/main/java/at/hannibal2/skyhanni/data/SlayerAPI.kt @@ -112,12 +112,12 @@ object SlayerAPI { if (slayerQuest != latestSlayerCategory) { val old = latestSlayerCategory latestSlayerCategory = slayerQuest - SlayerChangeEvent(old, latestSlayerCategory).postAndCatch() + SlayerChangeEvent(old, latestSlayerCategory).post() } val slayerProgress = ScoreboardData.sidebarLinesFormatted.nextAfter("Slayer Quest", 2).orEmpty() if (latestSlayerProgress != slayerProgress) { - SlayerProgressChangeEvent(latestSlayerProgress, slayerProgress).postAndCatch() + SlayerProgressChangeEvent(latestSlayerProgress, slayerProgress).post() latestSlayerProgress = slayerProgress } diff --git a/src/main/java/at/hannibal2/skyhanni/data/TitleData.kt b/src/main/java/at/hannibal2/skyhanni/data/TitleData.kt index f8ad4f652fc3..a58e00a16a78 100644 --- a/src/main/java/at/hannibal2/skyhanni/data/TitleData.kt +++ b/src/main/java/at/hannibal2/skyhanni/data/TitleData.kt @@ -16,7 +16,7 @@ object TitleData { if (packet !is S45PacketTitle) return val message = packet.message ?: return val formattedText = message.formattedText - if (TitleReceivedEvent(formattedText).postAndCatch()) { + if (TitleReceivedEvent(formattedText).post()) { event.cancel() } } diff --git a/src/main/java/at/hannibal2/skyhanni/data/model/TabWidget.kt b/src/main/java/at/hannibal2/skyhanni/data/model/TabWidget.kt index d93053d73fec..f0ee75af599f 100644 --- a/src/main/java/at/hannibal2/skyhanni/data/model/TabWidget.kt +++ b/src/main/java/at/hannibal2/skyhanni/data/model/TabWidget.kt @@ -1,5 +1,6 @@ package at.hannibal2.skyhanni.data.model +import at.hannibal2.skyhanni.api.event.HandleEvent import at.hannibal2.skyhanni.events.LorenzWorldChangeEvent import at.hannibal2.skyhanni.events.RepositoryReloadEvent import at.hannibal2.skyhanni.events.SecondPassedEvent @@ -398,7 +399,7 @@ enum class TabWidget( ChatUtils.debug("Forcefully Updated Widgets") } - @SubscribeEvent(priority = EventPriority.HIGH) + @HandleEvent(priority = HandleEvent.HIGH) fun onTabListUpdate(event: TabListUpdateEvent) { if (!LorenzUtils.inSkyBlock) { if (separatorIndexes.isNotEmpty()) { diff --git a/src/main/java/at/hannibal2/skyhanni/events/MinionOpenEvent.kt b/src/main/java/at/hannibal2/skyhanni/events/MinionOpenEvent.kt index bfe8649ba97c..571bb70c7f90 100644 --- a/src/main/java/at/hannibal2/skyhanni/events/MinionOpenEvent.kt +++ b/src/main/java/at/hannibal2/skyhanni/events/MinionOpenEvent.kt @@ -1,8 +1,9 @@ package at.hannibal2.skyhanni.events +import at.hannibal2.skyhanni.api.event.SkyHanniEvent import at.hannibal2.skyhanni.utils.LorenzVec import net.minecraft.item.ItemStack -class MinionOpenEvent(val inventoryName: String, val inventoryItems: Map) : LorenzEvent() -class MinionCloseEvent : LorenzEvent() -class MinionStorageOpenEvent(val position: LorenzVec?, val inventoryItems: Map) : LorenzEvent() +class MinionOpenEvent(val inventoryName: String, val inventoryItems: Map) : SkyHanniEvent() +class MinionCloseEvent : SkyHanniEvent() +class MinionStorageOpenEvent(val position: LorenzVec?, val inventoryItems: Map) : SkyHanniEvent() diff --git a/src/main/java/at/hannibal2/skyhanni/api/enoughupdates/NEURenderEvent.kt b/src/main/java/at/hannibal2/skyhanni/events/NEURenderEvent.kt similarity index 70% rename from src/main/java/at/hannibal2/skyhanni/api/enoughupdates/NEURenderEvent.kt rename to src/main/java/at/hannibal2/skyhanni/events/NEURenderEvent.kt index 91dda4f67bfd..c92944c31fc0 100644 --- a/src/main/java/at/hannibal2/skyhanni/api/enoughupdates/NEURenderEvent.kt +++ b/src/main/java/at/hannibal2/skyhanni/events/NEURenderEvent.kt @@ -1,4 +1,4 @@ -package at.hannibal2.skyhanni.api.enoughupdates +package at.hannibal2.skyhanni.events import at.hannibal2.skyhanni.api.event.CancellableSkyHanniEvent diff --git a/src/main/java/at/hannibal2/skyhanni/events/PurseChangeEvent.kt b/src/main/java/at/hannibal2/skyhanni/events/PurseChangeEvent.kt index 776a226d63e9..21a219b29342 100644 --- a/src/main/java/at/hannibal2/skyhanni/events/PurseChangeEvent.kt +++ b/src/main/java/at/hannibal2/skyhanni/events/PurseChangeEvent.kt @@ -1,6 +1,8 @@ package at.hannibal2.skyhanni.events -class PurseChangeEvent(val coins: Double, val purse: Double, val reason: PurseChangeCause) : LorenzEvent() +import at.hannibal2.skyhanni.api.event.SkyHanniEvent + +class PurseChangeEvent(val coins: Double, val purse: Double, val reason: PurseChangeCause) : SkyHanniEvent() enum class PurseChangeCause { GAIN_MOB_KILL, diff --git a/src/main/java/at/hannibal2/skyhanni/events/RawScoreboardUpdateEvent.kt b/src/main/java/at/hannibal2/skyhanni/events/RawScoreboardUpdateEvent.kt index ac11a5bcb153..45cc13659ac7 100644 --- a/src/main/java/at/hannibal2/skyhanni/events/RawScoreboardUpdateEvent.kt +++ b/src/main/java/at/hannibal2/skyhanni/events/RawScoreboardUpdateEvent.kt @@ -1,3 +1,5 @@ package at.hannibal2.skyhanni.events -class RawScoreboardUpdateEvent(val rawScoreboard: List) : LorenzEvent() +import at.hannibal2.skyhanni.api.event.SkyHanniEvent + +class RawScoreboardUpdateEvent(val rawScoreboard: List) : SkyHanniEvent() diff --git a/src/main/java/at/hannibal2/skyhanni/events/RenderBlockInWorldEvent.kt b/src/main/java/at/hannibal2/skyhanni/events/RenderBlockInWorldEvent.kt deleted file mode 100644 index 395d1be2db0c..000000000000 --- a/src/main/java/at/hannibal2/skyhanni/events/RenderBlockInWorldEvent.kt +++ /dev/null @@ -1,9 +0,0 @@ -package at.hannibal2.skyhanni.events - -import net.minecraft.block.state.IBlockState -import net.minecraft.util.BlockPos -import net.minecraft.world.IBlockAccess -import net.minecraftforge.fml.common.eventhandler.Cancelable - -@Cancelable -data class RenderBlockInWorldEvent(@JvmField var state: IBlockState?, var world: IBlockAccess, var pos: BlockPos?) : LorenzEvent() diff --git a/src/main/java/at/hannibal2/skyhanni/events/RenderGuiItemOverlayEvent.kt b/src/main/java/at/hannibal2/skyhanni/events/RenderGuiItemOverlayEvent.kt index 0db2e4e1466a..2034b09fbbd0 100644 --- a/src/main/java/at/hannibal2/skyhanni/events/RenderGuiItemOverlayEvent.kt +++ b/src/main/java/at/hannibal2/skyhanni/events/RenderGuiItemOverlayEvent.kt @@ -1,9 +1,10 @@ package at.hannibal2.skyhanni.events +import at.hannibal2.skyhanni.api.event.SkyHanniEvent import net.minecraft.item.ItemStack class RenderGuiItemOverlayEvent( val stack: ItemStack?, val x: Int, val y: Int, -) : LorenzEvent() +) : SkyHanniEvent() diff --git a/src/main/java/at/hannibal2/skyhanni/events/RenderItemTooltipEvent.kt b/src/main/java/at/hannibal2/skyhanni/events/RenderItemTooltipEvent.kt index f8cb98802b1c..ea1283a52d58 100644 --- a/src/main/java/at/hannibal2/skyhanni/events/RenderItemTooltipEvent.kt +++ b/src/main/java/at/hannibal2/skyhanni/events/RenderItemTooltipEvent.kt @@ -1,5 +1,6 @@ package at.hannibal2.skyhanni.events +import at.hannibal2.skyhanni.api.event.SkyHanniEvent import net.minecraft.item.ItemStack -class RenderItemTooltipEvent(val stack: ItemStack) : LorenzEvent() +class RenderItemTooltipEvent(val stack: ItemStack) : SkyHanniEvent() diff --git a/src/main/java/at/hannibal2/skyhanni/events/ScoreboardUpdateEvent.kt b/src/main/java/at/hannibal2/skyhanni/events/ScoreboardUpdateEvent.kt index e2efcbaf2675..cb13423bcbd7 100644 --- a/src/main/java/at/hannibal2/skyhanni/events/ScoreboardUpdateEvent.kt +++ b/src/main/java/at/hannibal2/skyhanni/events/ScoreboardUpdateEvent.kt @@ -1,9 +1,11 @@ package at.hannibal2.skyhanni.events +import at.hannibal2.skyhanni.api.event.SkyHanniEvent + class ScoreboardUpdateEvent( val full: List, val old: List, -) : LorenzEvent() { +) : SkyHanniEvent() { val added: List = full - old.toSet() val removed: List = old - full.toSet() diff --git a/src/main/java/at/hannibal2/skyhanni/events/SeaCreatureFishEvent.kt b/src/main/java/at/hannibal2/skyhanni/events/SeaCreatureFishEvent.kt index 0c0c4f62780a..158fc47c2c7a 100644 --- a/src/main/java/at/hannibal2/skyhanni/events/SeaCreatureFishEvent.kt +++ b/src/main/java/at/hannibal2/skyhanni/events/SeaCreatureFishEvent.kt @@ -1,9 +1,10 @@ package at.hannibal2.skyhanni.events +import at.hannibal2.skyhanni.api.event.SkyHanniEvent import at.hannibal2.skyhanni.features.fishing.SeaCreature class SeaCreatureFishEvent( val seaCreature: SeaCreature, val chatEvent: LorenzChatEvent, val doubleHook: Boolean, -) : LorenzEvent() +) : SkyHanniEvent() diff --git a/src/main/java/at/hannibal2/skyhanni/events/ServerBlockChangeEvent.kt b/src/main/java/at/hannibal2/skyhanni/events/ServerBlockChangeEvent.kt index 106ee2821cb3..ed0ef4ac9311 100644 --- a/src/main/java/at/hannibal2/skyhanni/events/ServerBlockChangeEvent.kt +++ b/src/main/java/at/hannibal2/skyhanni/events/ServerBlockChangeEvent.kt @@ -1,5 +1,6 @@ package at.hannibal2.skyhanni.events +import at.hannibal2.skyhanni.api.event.SkyHanniEvent import at.hannibal2.skyhanni.utils.BlockUtils.getBlockAt import at.hannibal2.skyhanni.utils.BlockUtils.getBlockStateAt import at.hannibal2.skyhanni.utils.RegexUtils.matchMatcher @@ -7,7 +8,7 @@ import at.hannibal2.skyhanni.utils.toLorenzVec import net.minecraft.block.state.IBlockState import net.minecraft.util.BlockPos -class ServerBlockChangeEvent(blockPos: BlockPos, blockState: IBlockState) : LorenzEvent() { +class ServerBlockChangeEvent(blockPos: BlockPos, blockState: IBlockState) : SkyHanniEvent() { val location by lazy { blockPos.toLorenzVec() } val old by lazy { location.getBlockAt().toString().getName() } diff --git a/src/main/java/at/hannibal2/skyhanni/events/SkillExpGainEvent.kt b/src/main/java/at/hannibal2/skyhanni/events/SkillExpGainEvent.kt index 09365a7baa9c..a0a6a771f69d 100644 --- a/src/main/java/at/hannibal2/skyhanni/events/SkillExpGainEvent.kt +++ b/src/main/java/at/hannibal2/skyhanni/events/SkillExpGainEvent.kt @@ -1,6 +1,7 @@ package at.hannibal2.skyhanni.events +import at.hannibal2.skyhanni.api.event.SkyHanniEvent import at.hannibal2.skyhanni.features.skillprogress.SkillType // does not know how much exp is there, also gets called multiple times -class SkillExpGainEvent(val skill: SkillType, val gained: Double) : LorenzEvent() +class SkillExpGainEvent(val skill: SkillType, val gained: Double) : SkyHanniEvent() diff --git a/src/main/java/at/hannibal2/skyhanni/events/SkillOverflowLevelUpEvent.kt b/src/main/java/at/hannibal2/skyhanni/events/SkillOverflowLevelUpEvent.kt index d3f356da7f7d..cd50caa5ea66 100644 --- a/src/main/java/at/hannibal2/skyhanni/events/SkillOverflowLevelUpEvent.kt +++ b/src/main/java/at/hannibal2/skyhanni/events/SkillOverflowLevelUpEvent.kt @@ -1,5 +1,6 @@ package at.hannibal2.skyhanni.events +import at.hannibal2.skyhanni.api.event.SkyHanniEvent import at.hannibal2.skyhanni.features.skillprogress.SkillType -class SkillOverflowLevelUpEvent(val skill: SkillType, val oldLevel: Int, val newLevel: Int) : LorenzEvent() +class SkillOverflowLevelUpEvent(val skill: SkillType, val oldLevel: Int, val newLevel: Int) : SkyHanniEvent() diff --git a/src/main/java/at/hannibal2/skyhanni/events/SkipTabListLineEvent.kt b/src/main/java/at/hannibal2/skyhanni/events/SkipTabListLineEvent.kt index 0250b821f1f5..30d8f42fb6b3 100644 --- a/src/main/java/at/hannibal2/skyhanni/events/SkipTabListLineEvent.kt +++ b/src/main/java/at/hannibal2/skyhanni/events/SkipTabListLineEvent.kt @@ -1,11 +1,10 @@ package at.hannibal2.skyhanni.events +import at.hannibal2.skyhanni.api.event.CancellableSkyHanniEvent import at.hannibal2.skyhanni.features.misc.compacttablist.TabLine -import net.minecraftforge.fml.common.eventhandler.Cancelable -@Cancelable data class SkipTabListLineEvent( val line: TabLine, val lastSubTitle: TabLine?, val lastTitle: TabLine?, -) : LorenzEvent() +) : CancellableSkyHanniEvent() diff --git a/src/main/java/at/hannibal2/skyhanni/events/SlayerChangeEvent.kt b/src/main/java/at/hannibal2/skyhanni/events/SlayerChangeEvent.kt index c7da7f7bd7d3..05d2a357e3dc 100644 --- a/src/main/java/at/hannibal2/skyhanni/events/SlayerChangeEvent.kt +++ b/src/main/java/at/hannibal2/skyhanni/events/SlayerChangeEvent.kt @@ -1,3 +1,5 @@ package at.hannibal2.skyhanni.events -class SlayerChangeEvent(val oldSlayer: String, val newSlayer: String) : LorenzEvent() +import at.hannibal2.skyhanni.api.event.SkyHanniEvent + +class SlayerChangeEvent(val oldSlayer: String, val newSlayer: String) : SkyHanniEvent() diff --git a/src/main/java/at/hannibal2/skyhanni/events/SlayerProgressChangeEvent.kt b/src/main/java/at/hannibal2/skyhanni/events/SlayerProgressChangeEvent.kt index b87a854e1922..78a68c5d492f 100644 --- a/src/main/java/at/hannibal2/skyhanni/events/SlayerProgressChangeEvent.kt +++ b/src/main/java/at/hannibal2/skyhanni/events/SlayerProgressChangeEvent.kt @@ -1,3 +1,5 @@ package at.hannibal2.skyhanni.events -class SlayerProgressChangeEvent(val oldProgress: String, val newProgress: String) : LorenzEvent() +import at.hannibal2.skyhanni.api.event.SkyHanniEvent + +class SlayerProgressChangeEvent(val oldProgress: String, val newProgress: String) : SkyHanniEvent() diff --git a/src/main/java/at/hannibal2/skyhanni/events/TabListLineRenderEvent.kt b/src/main/java/at/hannibal2/skyhanni/events/TabListLineRenderEvent.kt index 47478959291d..7a863a8e9635 100644 --- a/src/main/java/at/hannibal2/skyhanni/events/TabListLineRenderEvent.kt +++ b/src/main/java/at/hannibal2/skyhanni/events/TabListLineRenderEvent.kt @@ -1,3 +1,5 @@ package at.hannibal2.skyhanni.events -class TabListLineRenderEvent(var text: String) : LorenzEvent() +import at.hannibal2.skyhanni.api.event.SkyHanniEvent + +class TabListLineRenderEvent(var text: String) : SkyHanniEvent() diff --git a/src/main/java/at/hannibal2/skyhanni/events/TabListUpdateEvent.kt b/src/main/java/at/hannibal2/skyhanni/events/TabListUpdateEvent.kt index a1b36a667fb3..c4e44624ab11 100644 --- a/src/main/java/at/hannibal2/skyhanni/events/TabListUpdateEvent.kt +++ b/src/main/java/at/hannibal2/skyhanni/events/TabListUpdateEvent.kt @@ -1,3 +1,5 @@ package at.hannibal2.skyhanni.events -class TabListUpdateEvent(val tabList: List) : LorenzEvent() +import at.hannibal2.skyhanni.api.event.SkyHanniEvent + +class TabListUpdateEvent(val tabList: List) : SkyHanniEvent() diff --git a/src/main/java/at/hannibal2/skyhanni/events/TablistFooterUpdateEvent.kt b/src/main/java/at/hannibal2/skyhanni/events/TablistFooterUpdateEvent.kt index 6f12e99bc47e..ffca3d846259 100644 --- a/src/main/java/at/hannibal2/skyhanni/events/TablistFooterUpdateEvent.kt +++ b/src/main/java/at/hannibal2/skyhanni/events/TablistFooterUpdateEvent.kt @@ -1,3 +1,5 @@ package at.hannibal2.skyhanni.events -class TablistFooterUpdateEvent(val footer: String) : LorenzEvent() +import at.hannibal2.skyhanni.api.event.SkyHanniEvent + +class TablistFooterUpdateEvent(val footer: String) : SkyHanniEvent() diff --git a/src/main/java/at/hannibal2/skyhanni/events/TitleReceivedEvent.kt b/src/main/java/at/hannibal2/skyhanni/events/TitleReceivedEvent.kt index 912a4d8d6564..82f261e7614b 100644 --- a/src/main/java/at/hannibal2/skyhanni/events/TitleReceivedEvent.kt +++ b/src/main/java/at/hannibal2/skyhanni/events/TitleReceivedEvent.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 TitleReceivedEvent(val title: String) : LorenzEvent() +class TitleReceivedEvent(val title: String) : CancellableSkyHanniEvent() diff --git a/src/main/java/at/hannibal2/skyhanni/features/combat/ghosttracker/GhostTracker.kt b/src/main/java/at/hannibal2/skyhanni/features/combat/ghosttracker/GhostTracker.kt index 99a5eb34b7a2..a58a8dfa1dde 100644 --- a/src/main/java/at/hannibal2/skyhanni/features/combat/ghosttracker/GhostTracker.kt +++ b/src/main/java/at/hannibal2/skyhanni/features/combat/ghosttracker/GhostTracker.kt @@ -176,7 +176,7 @@ object GhostTracker { add(tracker.addTotalProfit(profit, data.kills, "kill")) } - @SubscribeEvent + @HandleEvent fun onSkillExp(event: SkillExpGainEvent) { if (!isEnabled()) return if (event.gained > 10_000) return @@ -208,7 +208,7 @@ object GhostTracker { } } - @SubscribeEvent + @HandleEvent fun onPurseChange(event: PurseChangeEvent) { if (!isEnabled()) return if (event.reason != PurseChangeCause.GAIN_MOB_KILL) return 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 c00a74f0f463..c1f52600b273 100644 --- a/src/main/java/at/hannibal2/skyhanni/features/dungeon/DungeonAPI.kt +++ b/src/main/java/at/hannibal2/skyhanni/features/dungeon/DungeonAPI.kt @@ -183,7 +183,7 @@ object DungeonAPI { else -> "§7" } - @SubscribeEvent + @HandleEvent fun onScoreboardUpdate(event: ScoreboardUpdateEvent) { // TODO: move this under inDungeon check when we use Hypixel's ModAPI for island detection floorPattern.firstMatcher(event.added) { @@ -204,7 +204,7 @@ object DungeonAPI { } } - @SubscribeEvent + @HandleEvent fun onTablistChange(event: TabListUpdateEvent) { if (!inDungeon()) return if (dungeonFloor == null || playerClass != null) return @@ -220,7 +220,7 @@ object DungeonAPI { } } - @SubscribeEvent + @HandleEvent fun onTabUpdate(event: TablistFooterUpdateEvent) { if (!inDungeon()) return for (line in event.footer.split("\n")) { diff --git a/src/main/java/at/hannibal2/skyhanni/features/dungeon/DungeonRankTabListColor.kt b/src/main/java/at/hannibal2/skyhanni/features/dungeon/DungeonRankTabListColor.kt index df33ee6f6c14..a07b9b490da3 100644 --- a/src/main/java/at/hannibal2/skyhanni/features/dungeon/DungeonRankTabListColor.kt +++ b/src/main/java/at/hannibal2/skyhanni/features/dungeon/DungeonRankTabListColor.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.TabListLineRenderEvent import at.hannibal2.skyhanni.skyhannimodule.SkyHanniModule import at.hannibal2.skyhanni.utils.NumberUtil.romanToDecimalIfNecessary @@ -9,7 +10,6 @@ import at.hannibal2.skyhanni.utils.RegexUtils.matchMatcher import at.hannibal2.skyhanni.utils.StringUtils.cleanPlayerName import at.hannibal2.skyhanni.utils.StringUtils.stripHypixelMessage import at.hannibal2.skyhanni.utils.repopatterns.RepoPattern -import net.minecraftforge.fml.common.eventhandler.SubscribeEvent @SkyHanniModule object DungeonRankTabListColor { @@ -27,7 +27,7 @@ object DungeonRankTabListColor { "^(?:§.)*(?\\[(?:§.)*\\d+(?:§.)*]) (?(?:§.)*\\[(?:§.)*[^]]+(?:§.)*])? ?(?\\S+) (?[^(]*)\\((?:§.)*(?\\S+) (?[CLXVI]+)(?:§.)*\\)(?:§.)*$" ) - @SubscribeEvent + @HandleEvent fun onTabListText(event: TabListLineRenderEvent) { if (!isEnabled()) return diff --git a/src/main/java/at/hannibal2/skyhanni/features/event/carnival/CarnivalZombieShootout.kt b/src/main/java/at/hannibal2/skyhanni/features/event/carnival/CarnivalZombieShootout.kt index 75fba6369210..afd6e3cc5e24 100644 --- a/src/main/java/at/hannibal2/skyhanni/features/event/carnival/CarnivalZombieShootout.kt +++ b/src/main/java/at/hannibal2/skyhanni/features/event/carnival/CarnivalZombieShootout.kt @@ -1,6 +1,7 @@ package at.hannibal2.skyhanni.features.event.carnival import at.hannibal2.skyhanni.SkyHanniMod +import at.hannibal2.skyhanni.api.event.HandleEvent import at.hannibal2.skyhanni.events.GuiRenderEvent import at.hannibal2.skyhanni.events.LorenzChatEvent import at.hannibal2.skyhanni.events.LorenzRenderWorldEvent @@ -143,7 +144,7 @@ object CarnivalZombieShootout { config.lampPosition.renderRenderable(content, posLabel = "Lantern Timer") } - @SubscribeEvent + @HandleEvent fun onBlockChange(event: ServerBlockChangeEvent) { if (!isEnabled() || !started) return diff --git a/src/main/java/at/hannibal2/skyhanni/features/event/lobby/waypoints/halloween/BasketWaypoints.kt b/src/main/java/at/hannibal2/skyhanni/features/event/lobby/waypoints/halloween/BasketWaypoints.kt index b2e76eb03b38..254fea75bc58 100644 --- a/src/main/java/at/hannibal2/skyhanni/features/event/lobby/waypoints/halloween/BasketWaypoints.kt +++ b/src/main/java/at/hannibal2/skyhanni/features/event/lobby/waypoints/halloween/BasketWaypoints.kt @@ -1,6 +1,7 @@ package at.hannibal2.skyhanni.features.event.lobby.waypoints.halloween 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.IslandGraphs @@ -114,7 +115,7 @@ object BasketWaypoints { event.drawDynamicText(position, "§dBasket", 1.0) } - @SubscribeEvent + @HandleEvent fun onScoreboardChange(event: ScoreboardUpdateEvent) { if (LorenzUtils.inSkyBlock) { isActive = false diff --git a/src/main/java/at/hannibal2/skyhanni/features/fishing/FishingTimer.kt b/src/main/java/at/hannibal2/skyhanni/features/fishing/FishingTimer.kt index f23c3aefbf8c..0b7058db1572 100644 --- a/src/main/java/at/hannibal2/skyhanni/features/fishing/FishingTimer.kt +++ b/src/main/java/at/hannibal2/skyhanni/features/fishing/FishingTimer.kt @@ -1,6 +1,7 @@ package at.hannibal2.skyhanni.features.fishing 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.mob.Mob @@ -116,7 +117,7 @@ object FishingTimer { updateInfo() } - @SubscribeEvent + @HandleEvent fun onSeaCreatureFish(event: SeaCreatureFishEvent) { if (!isEnabled()) return if (!rightLocation) return diff --git a/src/main/java/at/hannibal2/skyhanni/features/fishing/SeaCreatureFeatures.kt b/src/main/java/at/hannibal2/skyhanni/features/fishing/SeaCreatureFeatures.kt index 9c6de0e32459..06c68482af53 100644 --- a/src/main/java/at/hannibal2/skyhanni/features/fishing/SeaCreatureFeatures.kt +++ b/src/main/java/at/hannibal2/skyhanni/features/fishing/SeaCreatureFeatures.kt @@ -1,6 +1,7 @@ package at.hannibal2.skyhanni.features.fishing 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.damageindicator.DamageIndicatorConfig import at.hannibal2.skyhanni.data.mob.Mob @@ -73,7 +74,7 @@ object SeaCreatureFeatures { rareSeaCreatures.remove(event.mob) } - @SubscribeEvent + @HandleEvent fun onSeaCreatureFish(event: SeaCreatureFishEvent) { if (!LorenzUtils.inSkyBlock) return if (!config.alertOwnCatches) return diff --git a/src/main/java/at/hannibal2/skyhanni/features/fishing/SeaCreatureManager.kt b/src/main/java/at/hannibal2/skyhanni/features/fishing/SeaCreatureManager.kt index 504b3ae212bb..2914863f1848 100644 --- a/src/main/java/at/hannibal2/skyhanni/features/fishing/SeaCreatureManager.kt +++ b/src/main/java/at/hannibal2/skyhanni/features/fishing/SeaCreatureManager.kt @@ -50,7 +50,7 @@ object SeaCreatureManager { } else if (!doubleHook || !thunderBottleChargedPattern.matches(event.message)) { val seaCreature = getSeaCreatureFromMessage(event.message) if (seaCreature != null) { - SeaCreatureFishEvent(seaCreature, event, doubleHook).postAndCatch() + SeaCreatureFishEvent(seaCreature, event, doubleHook).post() } doubleHook = false } diff --git a/src/main/java/at/hannibal2/skyhanni/features/fishing/SeaCreatureMessageShortener.kt b/src/main/java/at/hannibal2/skyhanni/features/fishing/SeaCreatureMessageShortener.kt index ebb8879647af..ee6a29aadcbe 100644 --- a/src/main/java/at/hannibal2/skyhanni/features/fishing/SeaCreatureMessageShortener.kt +++ b/src/main/java/at/hannibal2/skyhanni/features/fishing/SeaCreatureMessageShortener.kt @@ -1,18 +1,18 @@ package at.hannibal2.skyhanni.features.fishing import at.hannibal2.skyhanni.SkyHanniMod +import at.hannibal2.skyhanni.api.event.HandleEvent import at.hannibal2.skyhanni.events.SeaCreatureFishEvent import at.hannibal2.skyhanni.skyhannimodule.SkyHanniModule import at.hannibal2.skyhanni.utils.LorenzUtils import net.minecraft.util.ChatComponentText -import net.minecraftforge.fml.common.eventhandler.SubscribeEvent @SkyHanniModule object SeaCreatureMessageShortener { private val config get() = SkyHanniMod.feature.fishing - @SubscribeEvent + @HandleEvent fun onSeaCreatureFish(event: SeaCreatureFishEvent) { if (!LorenzUtils.inSkyBlock) return diff --git a/src/main/java/at/hannibal2/skyhanni/features/fishing/SharkFishCounter.kt b/src/main/java/at/hannibal2/skyhanni/features/fishing/SharkFishCounter.kt index 5904e1d7f61d..f13230446109 100644 --- a/src/main/java/at/hannibal2/skyhanni/features/fishing/SharkFishCounter.kt +++ b/src/main/java/at/hannibal2/skyhanni/features/fishing/SharkFishCounter.kt @@ -1,6 +1,7 @@ package at.hannibal2.skyhanni.features.fishing import at.hannibal2.skyhanni.SkyHanniMod +import at.hannibal2.skyhanni.api.event.HandleEvent import at.hannibal2.skyhanni.events.GuiRenderEvent import at.hannibal2.skyhanni.events.LorenzChatEvent import at.hannibal2.skyhanni.events.LorenzTickEvent @@ -19,7 +20,7 @@ object SharkFishCounter { private var display = "" private var hasWaterRodInHand = false - @SubscribeEvent + @HandleEvent fun onSeaCreatureFish(event: SeaCreatureFishEvent) { if (!SkyHanniMod.feature.fishing.sharkFishCounter) return 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 0b8e2c3559e8..20bc983b6ab0 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 @@ -46,7 +46,7 @@ object SeaCreatureTracker { var amount: MutableMap = mutableMapOf() } - @SubscribeEvent + @HandleEvent fun onSeaCreatureFish(event: SeaCreatureFishEvent) { if (!isEnabled()) 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 9f4adefdd98f..8c8dcdd18fd0 100644 --- a/src/main/java/at/hannibal2/skyhanni/features/garden/FarmingFortuneDisplay.kt +++ b/src/main/java/at/hannibal2/skyhanni/features/garden/FarmingFortuneDisplay.kt @@ -105,7 +105,7 @@ object FarmingFortuneDisplay { private val ZORROS_CAPE by lazy { "ZORROS_CAPE".toInternalName() } - @SubscribeEvent + @HandleEvent fun onTabListUpdate(event: TabListUpdateEvent) { if (!GardenAPI.inGarden()) return event.tabList.firstNotNullOfOrNull { diff --git a/src/main/java/at/hannibal2/skyhanni/features/garden/GardenNextJacobContest.kt b/src/main/java/at/hannibal2/skyhanni/features/garden/GardenNextJacobContest.kt index 81ad4f2fe1f0..40162217e051 100644 --- a/src/main/java/at/hannibal2/skyhanni/features/garden/GardenNextJacobContest.kt +++ b/src/main/java/at/hannibal2/skyhanni/features/garden/GardenNextJacobContest.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.ConfigFileType import at.hannibal2.skyhanni.config.ConfigUpdaterMigrator import at.hannibal2.skyhanni.config.enums.OutsideSbFeature @@ -136,7 +137,7 @@ object GardenNextJacobContest { } } - @SubscribeEvent + @HandleEvent fun onTabListUpdate(event: TabListUpdateEvent) { var next = false val newList = mutableListOf() diff --git a/src/main/java/at/hannibal2/skyhanni/features/garden/composter/ComposterOverlay.kt b/src/main/java/at/hannibal2/skyhanni/features/garden/composter/ComposterOverlay.kt index e354dcd7d565..7388c5b6655c 100644 --- a/src/main/java/at/hannibal2/skyhanni/features/garden/composter/ComposterOverlay.kt +++ b/src/main/java/at/hannibal2/skyhanni/features/garden/composter/ComposterOverlay.kt @@ -1,5 +1,6 @@ package at.hannibal2.skyhanni.features.garden.composter +import at.hannibal2.skyhanni.api.event.HandleEvent import at.hannibal2.skyhanni.config.ConfigUpdaterMigrator import at.hannibal2.skyhanni.config.features.garden.composter.ComposterConfig import at.hannibal2.skyhanni.config.features.garden.composter.ComposterConfig.RetrieveFromEntry @@ -48,7 +49,6 @@ import at.hannibal2.skyhanni.utils.SoundUtils import at.hannibal2.skyhanni.utils.StringUtils.removeColor import at.hannibal2.skyhanni.utils.TimeUtils.format import at.hannibal2.skyhanni.utils.renderables.Renderable -import net.minecraftforge.fml.common.eventhandler.EventPriority import net.minecraftforge.fml.common.eventhandler.SubscribeEvent import java.util.Collections import kotlin.math.ceil @@ -115,7 +115,7 @@ object ComposterOverlay { inInventory = false } - @SubscribeEvent(priority = EventPriority.LOW) + @HandleEvent(priority = HandleEvent.LOW) fun onTabListUpdate(event: TabListUpdateEvent) { if (!inInventory) return diff --git a/src/main/java/at/hannibal2/skyhanni/features/garden/contest/JacobContestFFNeededDisplay.kt b/src/main/java/at/hannibal2/skyhanni/features/garden/contest/JacobContestFFNeededDisplay.kt index 5d9b7f92f34e..9c1c99a8aaef 100644 --- a/src/main/java/at/hannibal2/skyhanni/features/garden/contest/JacobContestFFNeededDisplay.kt +++ b/src/main/java/at/hannibal2/skyhanni/features/garden/contest/JacobContestFFNeededDisplay.kt @@ -1,5 +1,6 @@ package at.hannibal2.skyhanni.features.garden.contest +import at.hannibal2.skyhanni.api.event.HandleEvent import at.hannibal2.skyhanni.events.GuiRenderEvent import at.hannibal2.skyhanni.events.InventoryCloseEvent import at.hannibal2.skyhanni.events.RenderItemTooltipEvent @@ -29,7 +30,7 @@ object JacobContestFFNeededDisplay { private var lastToolTipTime = SimpleTimeMark.farPast() private val cache = mutableMapOf>>() - @SubscribeEvent + @HandleEvent fun onRenderItemTooltip(event: RenderItemTooltipEvent) { if (!isEnabled()) 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 effa6ba14dfb..129ec78e28f5 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 @@ -219,7 +219,7 @@ object PestAPI { updatePests() } - @SubscribeEvent + @HandleEvent fun onTabListUpdate(event: TabListUpdateEvent) { if (!GardenAPI.inGarden()) return for (line in event.tabList) { @@ -242,7 +242,7 @@ object PestAPI { } } - @SubscribeEvent + @HandleEvent fun onScoreboardChange(event: ScoreboardUpdateEvent) { if (!GardenAPI.inGarden()) return if (!firstScoreboardCheck) 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 f7809f6ef5c2..102f499f9ec8 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 @@ -145,7 +145,7 @@ object PestProfitTracker { tracker.renderDisplay(config.position) } - @SubscribeEvent + @HandleEvent fun onPurseChange(event: PurseChangeEvent) { if (!isEnabled()) return val coins = event.coins 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 054da32af67b..d834b8902467 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 @@ -120,7 +120,7 @@ object CustomScoreboard { if (LorenzUtils.inSkyBlock && displayConfig.useCustomLines) UnknownLinesHandler.handleUnknownLines() } - @SubscribeEvent + @HandleEvent fun onScoreboardChange(event: ScoreboardUpdateEvent) { dirty = true } 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 9482ae5fbc7f..e4622f8767b2 100644 --- a/src/main/java/at/hannibal2/skyhanni/features/inventory/ItemPickupLog.kt +++ b/src/main/java/at/hannibal2/skyhanni/features/inventory/ItemPickupLog.kt @@ -130,7 +130,7 @@ object ItemPickupLog { } } - @SubscribeEvent + @HandleEvent fun onPurseChange(event: PurseChangeEvent) { if (!isEnabled() || !config.coins || !worldChangeCooldown()) return 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 86cca44ac7ec..301c56c25997 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 @@ -357,7 +357,7 @@ object ItemAbilityCooldown { } } - @SubscribeEvent + @HandleEvent fun onRenderItem(event: RenderGuiItemOverlayEvent) { if (!isEnabled()) return if (!config.itemAbilityCooldownBackground) return 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 175eb75a2ccd..36027a17acf7 100644 --- a/src/main/java/at/hannibal2/skyhanni/features/mining/HighlightMiningCommissionMobs.kt +++ b/src/main/java/at/hannibal2/skyhanni/features/mining/HighlightMiningCommissionMobs.kt @@ -72,7 +72,7 @@ object HighlightMiningCommissionMobs { } } - @SubscribeEvent + @HandleEvent fun onTabListUpdate(event: TabListUpdateEvent) { if (!isEnabled()) return diff --git a/src/main/java/at/hannibal2/skyhanni/features/mining/MiningCommissionsBlocksColor.kt b/src/main/java/at/hannibal2/skyhanni/features/mining/MiningCommissionsBlocksColor.kt index 16dedd8d35e5..4e3b6ed7e45a 100644 --- a/src/main/java/at/hannibal2/skyhanni/features/mining/MiningCommissionsBlocksColor.kt +++ b/src/main/java/at/hannibal2/skyhanni/features/mining/MiningCommissionsBlocksColor.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.inCrystalHollows import at.hannibal2.skyhanni.data.MiningAPI.inDwarvenMines import at.hannibal2.skyhanni.data.MiningAPI.inGlacite @@ -66,7 +67,7 @@ object MiningCommissionsBlocksColor { private var replaceBlocksMapCache = mutableMapOf() // TODO Commission API - @SubscribeEvent + @HandleEvent fun onTabListUpdate(event: TabListUpdateEvent) { for (block in CommissionBlock.entries) { val tabList = " §r§f${block.commissionName}: " 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 92e0e27020ac..142836480352 100644 --- a/src/main/java/at/hannibal2/skyhanni/features/minion/MinionCollectLogic.kt +++ b/src/main/java/at/hannibal2/skyhanni/features/minion/MinionCollectLogic.kt @@ -1,5 +1,6 @@ package at.hannibal2.skyhanni.features.minion +import at.hannibal2.skyhanni.api.event.HandleEvent import at.hannibal2.skyhanni.events.InventoryCloseEvent import at.hannibal2.skyhanni.events.MinionOpenEvent import at.hannibal2.skyhanni.events.entity.ItemAddInInventoryEvent @@ -15,7 +16,7 @@ object MinionCollectLogic { private var oldMap = mapOf() - @SubscribeEvent + @HandleEvent fun onMinionOpen(event: MinionOpenEvent) { if (oldMap.isNotEmpty()) return oldMap = count() diff --git a/src/main/java/at/hannibal2/skyhanni/features/minion/MinionFeatures.kt b/src/main/java/at/hannibal2/skyhanni/features/minion/MinionFeatures.kt index d413f89b1ddb..15220a6515d5 100644 --- a/src/main/java/at/hannibal2/skyhanni/features/minion/MinionFeatures.kt +++ b/src/main/java/at/hannibal2/skyhanni/features/minion/MinionFeatures.kt @@ -181,12 +181,12 @@ object MinionFeatures { event.inventoryItems[48]?.let { if (minionCollectItemPattern.matches(it.name)) { - MinionOpenEvent(event.inventoryName, event.inventoryItems).postAndCatch() + MinionOpenEvent(event.inventoryName, event.inventoryItems).post() return } } - MinionStorageOpenEvent(lastStorage, event.inventoryItems).postAndCatch() + MinionStorageOpenEvent(lastStorage, event.inventoryItems).post() minionStorageInventoryOpen = true } @@ -194,11 +194,11 @@ object MinionFeatures { fun onInventoryUpdated(event: InventoryUpdatedEvent) { if (!enableWithHub()) return if (minionInventoryOpen) { - MinionOpenEvent(event.inventoryName, event.inventoryItems).postAndCatch() + MinionOpenEvent(event.inventoryName, event.inventoryItems).post() } } - @SubscribeEvent + @HandleEvent fun onMinionOpen(event: MinionOpenEvent) { removeBuggedMinions() val minions = minions ?: return @@ -274,7 +274,7 @@ object MinionFeatures { minions[location]?.lastClicked = 0 } } - MinionCloseEvent().postAndCatch() + MinionCloseEvent().post() } @SubscribeEvent diff --git a/src/main/java/at/hannibal2/skyhanni/features/minion/MinionXp.kt b/src/main/java/at/hannibal2/skyhanni/features/minion/MinionXp.kt index f756b8ac8125..086dc7d8122e 100644 --- a/src/main/java/at/hannibal2/skyhanni/features/minion/MinionXp.kt +++ b/src/main/java/at/hannibal2/skyhanni/features/minion/MinionXp.kt @@ -1,6 +1,7 @@ package at.hannibal2.skyhanni.features.minion import at.hannibal2.skyhanni.SkyHanniMod +import at.hannibal2.skyhanni.api.event.HandleEvent import at.hannibal2.skyhanni.data.Perk import at.hannibal2.skyhanni.data.jsonobjects.repo.MinionXPJson import at.hannibal2.skyhanni.events.IslandChangeEvent @@ -50,7 +51,7 @@ object MinionXp { private fun toPrimitiveItemStack(itemStack: ItemStack) = PrimitiveItemStack(itemStack.getInternalName(), itemStack.stackSize) - @SubscribeEvent + @HandleEvent fun onMinionOpen(event: MinionOpenEvent) { if (!config.xpDisplay) return @@ -117,7 +118,7 @@ object MinionXp { return xpTotal } - @SubscribeEvent + @HandleEvent fun onMinionStorageOpen(event: MinionStorageOpenEvent) { if (!config.xpDisplay) return @@ -178,7 +179,7 @@ object MinionXp { collectItemXpList.clear() } - @SubscribeEvent + @HandleEvent fun onMinionClose(event: MinionCloseEvent) { xpItemMap.clear() collectItemXpList.clear() diff --git a/src/main/java/at/hannibal2/skyhanni/features/misc/compacttablist/TabListReader.kt b/src/main/java/at/hannibal2/skyhanni/features/misc/compacttablist/TabListReader.kt index fb2054f25126..816bb7699d79 100644 --- a/src/main/java/at/hannibal2/skyhanni/features/misc/compacttablist/TabListReader.kt +++ b/src/main/java/at/hannibal2/skyhanni/features/misc/compacttablist/TabListReader.kt @@ -1,6 +1,7 @@ package at.hannibal2.skyhanni.features.misc.compacttablist import at.hannibal2.skyhanni.SkyHanniMod +import at.hannibal2.skyhanni.api.event.HandleEvent import at.hannibal2.skyhanni.events.ConfigLoadEvent import at.hannibal2.skyhanni.events.TabListUpdateEvent import at.hannibal2.skyhanni.skyhannimodule.SkyHanniModule @@ -105,7 +106,7 @@ object TabListReader { combineColumnsToRender(columns, renderColumn) } - @SubscribeEvent + @HandleEvent fun onTabListUpdate(event: TabListUpdateEvent) { updateTablistData(event.tabList) } diff --git a/src/main/java/at/hannibal2/skyhanni/features/misc/compacttablist/TabListRenderer.kt b/src/main/java/at/hannibal2/skyhanni/features/misc/compacttablist/TabListRenderer.kt index 6fa91f7bf7f0..4d9ae1762704 100644 --- a/src/main/java/at/hannibal2/skyhanni/features/misc/compacttablist/TabListRenderer.kt +++ b/src/main/java/at/hannibal2/skyhanni/features/misc/compacttablist/TabListRenderer.kt @@ -1,6 +1,7 @@ package at.hannibal2.skyhanni.features.misc.compacttablist import at.hannibal2.skyhanni.SkyHanniMod +import at.hannibal2.skyhanni.api.event.HandleEvent import at.hannibal2.skyhanni.config.ConfigUpdaterMigrator import at.hannibal2.skyhanni.events.GuiRenderEvent import at.hannibal2.skyhanni.events.SkipTabListLineEvent @@ -139,7 +140,7 @@ object TabListRenderer { if (tabLine.type == TabStringType.SUB_TITLE) { lastSubTitle = tabLine } - !SkipTabListLineEvent(tabLine, lastSubTitle, lastTitle).postAndCatch() + !SkipTabListLineEvent(tabLine, lastSubTitle, lastTitle).post() }.let(::RenderColumn) Gui.drawRect( @@ -212,7 +213,7 @@ object TabListRenderer { "§.§lFire Sales: §r§f\\([0-9]+\\)" ) - @SubscribeEvent + @HandleEvent fun onSkipTablistLine(event: SkipTabListLineEvent) { if (config.hideFiresales && event.lastSubTitle != null && fireSalePattern.matches(event.lastSubTitle.text)) { event.cancel() diff --git a/src/main/java/at/hannibal2/skyhanni/features/misc/items/EstimatedItemValue.kt b/src/main/java/at/hannibal2/skyhanni/features/misc/items/EstimatedItemValue.kt index 7fae6ea1e80b..1085548713d5 100644 --- a/src/main/java/at/hannibal2/skyhanni/features/misc/items/EstimatedItemValue.kt +++ b/src/main/java/at/hannibal2/skyhanni/features/misc/items/EstimatedItemValue.kt @@ -155,7 +155,7 @@ object EstimatedItemValue { } } - @SubscribeEvent + @HandleEvent fun onRenderItemTooltip(event: RenderItemTooltipEvent) { if (!LorenzUtils.inSkyBlock) return if (!config.enabled) return diff --git a/src/main/java/at/hannibal2/skyhanni/features/rift/area/livingcave/LivingCaveDefenseBlocks.kt b/src/main/java/at/hannibal2/skyhanni/features/rift/area/livingcave/LivingCaveDefenseBlocks.kt index 1913a8fbcf4d..311aa0b20ab3 100644 --- a/src/main/java/at/hannibal2/skyhanni/features/rift/area/livingcave/LivingCaveDefenseBlocks.kt +++ b/src/main/java/at/hannibal2/skyhanni/features/rift/area/livingcave/LivingCaveDefenseBlocks.kt @@ -1,5 +1,6 @@ package at.hannibal2.skyhanni.features.rift.area.livingcave +import at.hannibal2.skyhanni.api.event.HandleEvent import at.hannibal2.skyhanni.config.ConfigUpdaterMigrator import at.hannibal2.skyhanni.events.LorenzRenderWorldEvent import at.hannibal2.skyhanni.events.ReceiveParticleEvent @@ -104,7 +105,7 @@ object LivingCaveDefenseBlocks { else -> false } - @SubscribeEvent + @HandleEvent fun onBlockChange(event: ServerBlockChangeEvent) { if (!isEnabled()) return val location = event.location diff --git a/src/main/java/at/hannibal2/skyhanni/features/rift/area/livingcave/LivingCaveLivingMetalHelper.kt b/src/main/java/at/hannibal2/skyhanni/features/rift/area/livingcave/LivingCaveLivingMetalHelper.kt index 3aeb4af3d04f..e4f251d7b739 100644 --- a/src/main/java/at/hannibal2/skyhanni/features/rift/area/livingcave/LivingCaveLivingMetalHelper.kt +++ b/src/main/java/at/hannibal2/skyhanni/features/rift/area/livingcave/LivingCaveLivingMetalHelper.kt @@ -35,7 +35,7 @@ object LivingCaveLivingMetalHelper { } } - @SubscribeEvent + @HandleEvent fun onBlockChange(event: ServerBlockChangeEvent) { if (!isEnabled()) return val location = event.location @@ -91,7 +91,7 @@ object LivingCaveLivingMetalHelper { } } - @SubscribeEvent + @HandleEvent fun onTitleReceived(event: TitleReceivedEvent) { if (!isEnabled()) return if (event.title.contains("Living Metal")) { diff --git a/src/main/java/at/hannibal2/skyhanni/features/rift/area/mirrorverse/DanceRoomHelper.kt b/src/main/java/at/hannibal2/skyhanni/features/rift/area/mirrorverse/DanceRoomHelper.kt index f571d2b42630..cd99becedb47 100644 --- a/src/main/java/at/hannibal2/skyhanni/features/rift/area/mirrorverse/DanceRoomHelper.kt +++ b/src/main/java/at/hannibal2/skyhanni/features/rift/area/mirrorverse/DanceRoomHelper.kt @@ -132,7 +132,7 @@ object DanceRoomHelper { } } - @SubscribeEvent + @HandleEvent fun onTitleReceived(event: TitleReceivedEvent) { if (!isEnabled()) return if (config.hideOriginalTitle && inRoom) event.cancel() diff --git a/src/main/java/at/hannibal2/skyhanni/features/rift/area/stillgorechateau/RiftBloodEffigies.kt b/src/main/java/at/hannibal2/skyhanni/features/rift/area/stillgorechateau/RiftBloodEffigies.kt index 3cab8d831b23..dc1ee79ac35c 100644 --- a/src/main/java/at/hannibal2/skyhanni/features/rift/area/stillgorechateau/RiftBloodEffigies.kt +++ b/src/main/java/at/hannibal2/skyhanni/features/rift/area/stillgorechateau/RiftBloodEffigies.kt @@ -1,5 +1,6 @@ package at.hannibal2.skyhanni.features.rift.area.stillgorechateau +import at.hannibal2.skyhanni.api.event.HandleEvent import at.hannibal2.skyhanni.config.ConfigUpdaterMigrator import at.hannibal2.skyhanni.data.jsonobjects.repo.RiftEffigiesJson import at.hannibal2.skyhanni.events.DebugDataCollectEvent @@ -79,7 +80,7 @@ object RiftBloodEffigies { locations = newLocations } - @SubscribeEvent + @HandleEvent fun onScoreboardChange(event: RawScoreboardUpdateEvent) { if (!isEnabled()) return 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 d73f92fce180..7112f59dc6e1 100644 --- a/src/main/java/at/hannibal2/skyhanni/features/skillprogress/SkillProgress.kt +++ b/src/main/java/at/hannibal2/skyhanni/features/skillprogress/SkillProgress.kt @@ -157,7 +157,7 @@ object SkillProgress { } } - @SubscribeEvent + @HandleEvent fun onLevelUp(event: SkillOverflowLevelUpEvent) { if (!isEnabled()) return if (!config.overflowConfig.enableInChat) return diff --git a/src/main/java/at/hannibal2/skyhanni/features/slayer/SlayerBossSpawnSoon.kt b/src/main/java/at/hannibal2/skyhanni/features/slayer/SlayerBossSpawnSoon.kt index 2d949c6e4787..a75126fe4aa1 100644 --- a/src/main/java/at/hannibal2/skyhanni/features/slayer/SlayerBossSpawnSoon.kt +++ b/src/main/java/at/hannibal2/skyhanni/features/slayer/SlayerBossSpawnSoon.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.data.SlayerAPI import at.hannibal2.skyhanni.events.SlayerProgressChangeEvent import at.hannibal2.skyhanni.skyhannimodule.SkyHanniModule @@ -10,7 +11,6 @@ import at.hannibal2.skyhanni.utils.RegexUtils.matchMatcher import at.hannibal2.skyhanni.utils.SoundUtils import at.hannibal2.skyhanni.utils.StringUtils.removeColor import at.hannibal2.skyhanni.utils.repopatterns.RepoPattern -import net.minecraftforge.fml.common.eventhandler.SubscribeEvent import kotlin.time.Duration.Companion.seconds @SkyHanniModule @@ -26,7 +26,7 @@ object SlayerBossSpawnSoon { private var lastCompletion = 0.0 private var warned = false - @SubscribeEvent + @HandleEvent fun onSlayerProgressChange(event: SlayerProgressChangeEvent) { if (!isEnabled()) return if (!SlayerAPI.isInCorrectArea) return 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 d069cf7e33bc..5e3eae25fbd9 100644 --- a/src/main/java/at/hannibal2/skyhanni/features/slayer/SlayerProfitTracker.kt +++ b/src/main/java/at/hannibal2/skyhanni/features/slayer/SlayerProfitTracker.kt @@ -103,7 +103,7 @@ object SlayerProfitTracker { allowedItems = event.getConstant("SlayerProfitTrackerItems").slayers } - @SubscribeEvent + @HandleEvent fun onPurseChange(event: PurseChangeEvent) { if (!isEnabled()) return val coins = event.coins @@ -123,7 +123,7 @@ object SlayerProfitTracker { } } - @SubscribeEvent + @HandleEvent fun onSlayerChange(event: SlayerChangeEvent) { val newSlayer = event.newSlayer itemLogCategory = newSlayer.removeColor() 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 bd46e416b952..daf9a9259610 100644 --- a/src/main/java/at/hannibal2/skyhanni/features/slayer/SlayerQuestWarning.kt +++ b/src/main/java/at/hannibal2/skyhanni/features/slayer/SlayerQuestWarning.kt @@ -21,7 +21,6 @@ import at.hannibal2.skyhanni.utils.SimpleTimeMark import at.hannibal2.skyhanni.utils.StringUtils.removeColor import at.hannibal2.skyhanni.utils.getLorenzVec import net.minecraft.entity.EntityLivingBase -import net.minecraftforge.fml.common.eventhandler.SubscribeEvent import kotlin.time.Duration.Companion.milliseconds import kotlin.time.Duration.Companion.seconds @@ -42,7 +41,7 @@ object SlayerQuestWarning { var lastSlayerType: SlayerType? = null } - @SubscribeEvent + @HandleEvent fun onScoreboardChange(event: ScoreboardUpdateEvent) { val slayerType = event.full.nextAfter("Slayer Quest") val slayerProgress = event.full.nextAfter("Slayer Quest", skip = 2) ?: "no slayer" diff --git a/src/main/java/at/hannibal2/skyhanni/features/slayer/SlayerRngMeterDisplay.kt b/src/main/java/at/hannibal2/skyhanni/features/slayer/SlayerRngMeterDisplay.kt index cd6e7b2dbf5b..d88e3e178971 100644 --- a/src/main/java/at/hannibal2/skyhanni/features/slayer/SlayerRngMeterDisplay.kt +++ b/src/main/java/at/hannibal2/skyhanni/features/slayer/SlayerRngMeterDisplay.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.storage.ProfileSpecificStorage import at.hannibal2.skyhanni.data.ProfileStorageData import at.hannibal2.skyhanni.data.SlayerAPI @@ -80,7 +81,7 @@ object SlayerRngMeterDisplay { } } - @SubscribeEvent + @HandleEvent fun onSlayerChange(event: SlayerChangeEvent) { update() } diff --git a/src/main/java/at/hannibal2/skyhanni/features/slayer/blaze/BlazeSlayerDaggerHelper.kt b/src/main/java/at/hannibal2/skyhanni/features/slayer/blaze/BlazeSlayerDaggerHelper.kt index 6957e02b2a03..b32cc19ec1e8 100644 --- a/src/main/java/at/hannibal2/skyhanni/features/slayer/blaze/BlazeSlayerDaggerHelper.kt +++ b/src/main/java/at/hannibal2/skyhanni/features/slayer/blaze/BlazeSlayerDaggerHelper.kt @@ -179,11 +179,10 @@ object BlazeSlayerDaggerHelper { return null } - @SubscribeEvent + @HandleEvent fun onTitleReceived(event: TitleReceivedEvent) { if (!isEnabled()) return - for (shield in HellionShield.entries) { if (shield.formattedName + "§r" == event.title) { for (dagger in Dagger.entries.filter { shield in it.shields }) { @@ -218,12 +217,12 @@ object BlazeSlayerDaggerHelper { TWILIGHT( listOf("Twilight Dagger", "Mawdredge Dagger", "Deathripper Dagger"), HellionShield.SPIRIT, - HellionShield.CRYSTAL + HellionShield.CRYSTAL, ), FIREDUST( listOf("Firedust Dagger", "Kindlebane Dagger", "Pyrochaos Dagger"), HellionShield.ASHEN, - HellionShield.AURIC + HellionShield.AURIC, ), ; diff --git a/src/main/java/at/hannibal2/skyhanni/features/slayer/enderman/EndermanSlayerFeatures.kt b/src/main/java/at/hannibal2/skyhanni/features/slayer/enderman/EndermanSlayerFeatures.kt index 7cae7db35eda..f5bf6d707522 100644 --- a/src/main/java/at/hannibal2/skyhanni/features/slayer/enderman/EndermanSlayerFeatures.kt +++ b/src/main/java/at/hannibal2/skyhanni/features/slayer/enderman/EndermanSlayerFeatures.kt @@ -212,7 +212,7 @@ object EndermanSlayerFeatures { } } - @SubscribeEvent + @HandleEvent fun onBlockChange(event: ServerBlockChangeEvent) { if (!IslandType.THE_END.isInIsland()) return if (!showBeacon()) return diff --git a/src/main/java/at/hannibal2/skyhanni/mixins/hooks/GuiPlayerTabOverlayHook.kt b/src/main/java/at/hannibal2/skyhanni/mixins/hooks/GuiPlayerTabOverlayHook.kt index 3496441fe089..d9dc6aacb027 100644 --- a/src/main/java/at/hannibal2/skyhanni/mixins/hooks/GuiPlayerTabOverlayHook.kt +++ b/src/main/java/at/hannibal2/skyhanni/mixins/hooks/GuiPlayerTabOverlayHook.kt @@ -22,7 +22,7 @@ fun getPlayerName(original: String, cir: CallbackInfoReturnable) { if (tabListGuard) return val event = TabListLineRenderEvent(original) - event.postAndCatch() + event.post() val newText = event.text if (original != newText) { cir.returnValue = newText diff --git a/src/main/java/at/hannibal2/skyhanni/mixins/hooks/GuiScreenHook.kt b/src/main/java/at/hannibal2/skyhanni/mixins/hooks/GuiScreenHook.kt index 3c3c7fd70507..e30a98a05b70 100644 --- a/src/main/java/at/hannibal2/skyhanni/mixins/hooks/GuiScreenHook.kt +++ b/src/main/java/at/hannibal2/skyhanni/mixins/hooks/GuiScreenHook.kt @@ -4,5 +4,5 @@ import at.hannibal2.skyhanni.events.RenderItemTooltipEvent import net.minecraft.item.ItemStack fun renderToolTip(stack: ItemStack) { - RenderItemTooltipEvent(stack).postAndCatch() + RenderItemTooltipEvent(stack).post() } 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 fc324f9bcbd5..9ce3b2896403 100644 --- a/src/main/java/at/hannibal2/skyhanni/mixins/hooks/RenderItemHook.kt +++ b/src/main/java/at/hannibal2/skyhanni/mixins/hooks/RenderItemHook.kt @@ -25,5 +25,5 @@ fun renderItemOverlayPost( fun renderItemReturn(stack: ItemStack, x: Int, y: Int) { if (!SkyHanniDebugsAndTests.globalRender) return - RenderGuiItemOverlayEvent(stack, x, y).postAndCatch() + RenderGuiItemOverlayEvent(stack, x, y).post() } 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 6caac98ad067..9940f01c1469 100644 --- a/src/main/java/at/hannibal2/skyhanni/mixins/transformers/MixinNEUOverlay.java +++ b/src/main/java/at/hannibal2/skyhanni/mixins/transformers/MixinNEUOverlay.java @@ -1,6 +1,6 @@ package at.hannibal2.skyhanni.mixins.transformers; -import at.hannibal2.skyhanni.api.enoughupdates.NEURenderEvent; +import at.hannibal2.skyhanni.events.NEURenderEvent; import io.github.moulberry.notenoughupdates.NEUOverlay; import org.spongepowered.asm.mixin.Mixin; import org.spongepowered.asm.mixin.Pseudo; diff --git a/src/main/java/at/hannibal2/skyhanni/utils/TabListData.kt b/src/main/java/at/hannibal2/skyhanni/utils/TabListData.kt index a9f12c78c664..accc7168fcf8 100644 --- a/src/main/java/at/hannibal2/skyhanni/utils/TabListData.kt +++ b/src/main/java/at/hannibal2/skyhanni/utils/TabListData.kt @@ -147,7 +147,7 @@ object TabListData { val tabList = readTabList() ?: return if (tablistCache != tabList) { tablistCache = tabList - TabListUpdateEvent(getTabList()).postAndCatch() + TabListUpdateEvent(getTabList()).post() if (!LorenzUtils.onHypixel) { workaroundDelayedTabListUpdateAgain() } @@ -158,7 +158,7 @@ object TabListData { val tabFooter = tabListOverlay.footer_skyhanni?.formattedText.orEmpty() if (tabFooter != footer && tabFooter != "") { - TablistFooterUpdateEvent(tabFooter).postAndCatch() + TablistFooterUpdateEvent(tabFooter).post() } footer = tabFooter } @@ -167,7 +167,7 @@ object TabListData { DelayedRun.runDelayed(2.seconds) { if (LorenzUtils.onHypixel) { println("workaroundDelayedTabListUpdateAgain") - TabListUpdateEvent(getTabList()).postAndCatch() + TabListUpdateEvent(getTabList()).post() } } }