From c9df51273aac96a27226194354705ce8fd010985 Mon Sep 17 00:00:00 2001 From: CalMWolfs <94038482+CalMWolfs@users.noreply.github.com> Date: Sat, 14 Dec 2024 11:32:26 +1100 Subject: [PATCH] Backend: Migrate to skyhanni events #3 (#3058) --- .../java/at/hannibal2/skyhanni/api/SkillAPI.kt | 4 ++-- .../skyhanni/api/event/SkyHanniEvents.kt | 2 +- .../skyhanni/config/ConfigUpdaterMigrator.kt | 6 +++--- .../java/at/hannibal2/skyhanni/data/BitsAPI.kt | 2 +- .../at/hannibal2/skyhanni/data/ElectionAPI.kt | 9 +++++---- .../at/hannibal2/skyhanni/data/GuiEditManager.kt | 7 ++++--- .../java/at/hannibal2/skyhanni/data/HotmData.kt | 2 +- .../at/hannibal2/skyhanni/data/HypixelData.kt | 4 ++-- .../java/at/hannibal2/skyhanni/data/MiningAPI.kt | 4 ++-- .../skyhanni/data/NotificationManager.kt | 6 +++--- .../hannibal2/skyhanni/data/ProfileStorageData.kt | 8 ++++---- .../java/at/hannibal2/skyhanni/data/RenderData.kt | 3 ++- .../java/at/hannibal2/skyhanni/data/SlayerAPI.kt | 5 +++-- .../at/hannibal2/skyhanni/data/TrackerManager.kt | 3 ++- .../skyhanni/data/bazaar/HypixelBazaarFetcher.kt | 5 +++-- .../data/hypixel/chat/PlayerNameFormatter.kt | 3 +-- .../hannibal2/skyhanni/data/mob/MobDetection.kt | 4 ++-- .../hannibal2/skyhanni/data/model/SkyblockStat.kt | 2 +- .../hannibal2/skyhanni/events/ConfigLoadEvent.kt | 4 +++- .../skyhanni/events/DebugDataCollectEvent.kt | 3 ++- .../skyhanni/events/LorenzKeyPressEvent.kt | 3 --- .../skyhanni/events/minecraft/KeyPressEvent.kt | 5 +++++ .../hannibal2/skyhanni/features/bingo/BingoAPI.kt | 5 +++-- .../skyhanni/features/bingo/MinionCraftHelper.kt | 3 ++- .../features/bingo/card/BingoCardDisplay.kt | 4 ++-- .../skyhanni/features/chat/ChatFilter.kt | 3 ++- .../skyhanni/features/chat/WatchdogHider.kt | 3 ++- .../chat/playerchat/PlayerChatModifier.kt | 3 +-- .../features/chat/translation/Translator.kt | 7 ++++--- .../skyhanni/features/chroma/ChromaManager.kt | 4 ++-- .../skyhanni/features/combat/BestiaryData.kt | 3 ++- .../skyhanni/features/combat/HideDamageSplash.kt | 3 ++- .../damageindicator/DamageIndicatorManager.kt | 2 +- .../combat/endernodetracker/EnderNodeTracker.kt | 4 ++-- .../features/combat/ghosttracker/GhostTracker.kt | 4 ++-- .../skyhanni/features/commands/PartyCommands.kt | 2 +- .../skyhanni/features/commands/WikiManager.kt | 3 +-- .../commands/tabcomplete/PlayerTabComplete.kt | 3 ++- .../features/cosmetics/CosmeticFollowingLine.kt | 3 ++- .../skyhanni/features/dungeon/DungeonAPI.kt | 4 ++-- .../skyhanni/features/dungeon/DungeonCleanEnd.kt | 2 +- .../skyhanni/features/dungeon/DungeonCopilot.kt | 2 +- .../features/dungeon/DungeonFinderFeatures.kt | 2 +- .../skyhanni/features/dungeon/DungeonHideItems.kt | 2 +- .../dungeon/DungeonHighlightClickedBlocks.kt | 2 +- .../features/dungeon/DungeonMobManager.kt | 3 ++- .../features/dungeon/DungeonsRaceGuide.kt | 2 +- .../features/event/diana/BurrowWarpHelper.kt | 11 ++++++----- .../features/event/diana/GriffinBurrowHelper.kt | 6 +++--- .../event/diana/GriffinBurrowParticleFinder.kt | 4 ++-- .../event/diana/InquisitorWaypointShare.kt | 6 +++--- .../event/diana/MythologicalCreatureTracker.kt | 3 ++- .../features/event/hoppity/HoppityCallWarning.kt | 8 ++++---- .../event/hoppity/HoppityCollectionStats.kt | 2 +- .../features/event/hoppity/HoppityEggLocator.kt | 4 ++-- .../features/event/hoppity/HoppityEggsManager.kt | 2 +- .../features/event/hoppity/HoppityEventSummary.kt | 10 +++++----- .../jerry/frozentreasure/FrozenTreasureTracker.kt | 3 ++- .../lobby/waypoints/halloween/BasketWaypoints.kt | 4 ++-- .../features/event/spook/TheGreatSpook.kt | 4 ++-- .../skyhanni/features/fame/CityProjectFeatures.kt | 3 ++- .../skyhanni/features/fame/UpgradeReminder.kt | 3 ++- .../skyhanni/features/fishing/ChumBucketHider.kt | 2 +- .../skyhanni/features/fishing/FishingTimer.kt | 10 +++++----- .../skyhanni/features/fishing/LavaReplacement.kt | 5 ++--- .../features/fishing/SeaCreatureFeatures.kt | 2 +- .../features/fishing/ThunderSparksHighlight.kt | 3 ++- .../features/fishing/TotemOfCorruption.kt | 3 ++- .../fishing/tracker/SeaCreatureTracker.kt | 2 +- .../features/fishing/trophy/GoldenFishTimer.kt | 4 ++-- .../features/fishing/trophy/OdgerWaypoint.kt | 3 ++- .../features/fishing/trophy/TrophyFishDisplay.kt | 4 ++-- .../features/fishing/trophy/TrophyFishFillet.kt | 3 ++- .../features/fishing/trophy/TrophyFishMessages.kt | 3 ++- .../skyhanni/features/garden/AnitaMedalProfit.kt | 3 ++- .../features/garden/FarmingFortuneDisplay.kt | 2 +- .../skyhanni/features/garden/GardenAPI.kt | 2 +- .../features/garden/GardenLevelDisplay.kt | 4 ++-- .../features/garden/GardenNextJacobContest.kt | 8 ++++---- .../features/garden/GardenOptimalSpeed.kt | 4 ++-- .../skyhanni/features/garden/GardenPlotBorders.kt | 7 ++++--- .../features/garden/GardenWarpCommands.kt | 7 +++---- .../skyhanni/features/garden/GardenYawAndPitch.kt | 2 +- .../features/garden/SensitivityReducer.kt | 6 +++--- .../skyhanni/features/garden/ToolTooltipTweaks.kt | 3 ++- .../features/garden/composter/ComposterDisplay.kt | 2 +- .../garden/composter/ComposterInventoryNumbers.kt | 3 +-- .../features/garden/composter/ComposterOverlay.kt | 6 +++--- .../composter/GardenComposterInventoryFeatures.kt | 3 ++- .../garden/contest/FarmingPersonalBestGain.kt | 3 ++- .../contest/JacobFarmingContestsInventory.kt | 2 +- .../features/garden/farming/ArmorDropTracker.kt | 2 +- .../features/garden/farming/CropMoneyDisplay.kt | 2 +- .../garden/farming/DicerRngDropTracker.kt | 4 ++-- .../garden/farming/FarmingWeightDisplay.kt | 2 +- .../features/garden/farming/GardenBestCropTime.kt | 4 ++-- .../garden/farming/GardenCropMilestoneDisplay.kt | 4 ++-- .../features/garden/farming/GardenCropSpeed.kt | 2 +- .../garden/farming/GardenCustomKeybinds.kt | 5 +++-- .../garden/fortuneguide/CaptureFarmingGear.kt | 4 ++-- .../garden/inventory/AnitaExtraFarmingFortune.kt | 3 ++- .../inventory/GardenCropMilestoneInventory.kt | 2 +- .../garden/inventory/GardenInventoryNumbers.kt | 3 +-- .../garden/inventory/SkyMartCopperPrice.kt | 3 ++- .../skyhanni/features/garden/pests/PestAPI.kt | 4 ++-- .../skyhanni/features/garden/pests/PestFinder.kt | 6 +++--- .../skyhanni/features/garden/pests/PestSpawn.kt | 3 ++- .../features/garden/pests/StereoHarmonyDisplay.kt | 3 ++- .../garden/visitor/GardenVisitorDropStatistics.kt | 4 ++-- .../garden/visitor/GardenVisitorFeatures.kt | 6 +++--- .../features/garden/visitor/GardenVisitorTimer.kt | 2 +- .../gui/customscoreboard/CustomScoreboard.kt | 6 +++--- .../customscoreboard/CustomScoreboardConfigFix.kt | 4 ++-- .../skyhanni/features/gui/quiver/QuiverDisplay.kt | 2 +- .../skyhanni/features/gui/quiver/QuiverWarning.kt | 2 +- .../features/inventory/AuctionsHighlighter.kt | 3 ++- .../skyhanni/features/inventory/ChestValue.kt | 3 ++- .../skyhanni/features/inventory/HarpFeatures.kt | 2 +- .../features/inventory/HideNotClickableItems.kt | 3 ++- .../features/inventory/HighlightBonzoMasks.kt | 3 ++- .../inventory/ItemDisplayOverlayFeatures.kt | 3 +-- .../features/inventory/RngMeterInventory.kt | 2 +- .../skyhanni/features/inventory/SackDisplay.kt | 3 ++- .../skyhanni/features/inventory/StatsTuning.kt | 2 +- .../auctionhouse/AuctionHouseCopyUnderbidPrice.kt | 2 +- .../features/inventory/bazaar/BazaarApi.kt | 3 ++- .../features/inventory/caketracker/CakeTracker.kt | 2 +- .../chocolatefactory/ChocolateFactoryAPI.kt | 3 ++- .../ChocolateFactoryDataLoader.kt | 5 +++-- .../chocolatefactory/ChocolateFactoryStats.kt | 3 ++- .../ChocolateFactoryStrayTracker.kt | 2 +- .../experimentationtable/GuardianReminder.kt | 3 ++- .../experimentationtable/SuperpairsClicksAlert.kt | 3 ++- .../experimentationtable/UltraRareBookAlert.kt | 3 ++- .../features/inventory/tiarelay/TiaRelayHelper.kt | 2 +- .../features/inventory/wardrobe/CustomWardrobe.kt | 5 +++-- .../inventory/wardrobe/EstimatedWardrobePrice.kt | 3 ++- .../features/inventory/wardrobe/WardrobeAPI.kt | 5 +++-- .../features/itemabilities/ChickenHeadTimer.kt | 3 ++- .../itemabilities/FireVeilWandParticles.kt | 2 +- .../abilitycooldown/ItemAbilityCooldown.kt | 2 +- .../skyhanni/features/mining/DeepCavernsGuide.kt | 4 ++-- .../mining/HighlightMiningCommissionMobs.kt | 2 +- .../mining/MiningCommissionsBlocksColor.kt | 8 ++++---- .../features/mining/MiningNotifications.kt | 2 +- .../skyhanni/features/mining/TunnelsMaps.kt | 12 ++++++------ .../mining/eventtracker/MiningEventDisplay.kt | 3 ++- .../mining/eventtracker/MiningEventTracker.kt | 2 +- .../fossilexcavator/solver/FossilSolverDisplay.kt | 2 +- .../mining/glacitemineshaft/MineshaftWaypoints.kt | 6 +++--- .../mining/powdertracker/PowderTracker.kt | 4 ++-- .../skyhanni/features/minion/MinionFeatures.kt | 2 +- .../features/misc/AuctionHousePriceComparison.kt | 3 ++- .../skyhanni/features/misc/BetterSignEditing.kt | 3 ++- .../skyhanni/features/misc/BetterWikiFromMenus.kt | 3 ++- .../skyhanni/features/misc/ButtonOnPause.kt | 3 ++- .../skyhanni/features/misc/CustomTextBox.kt | 5 +++-- .../hannibal2/skyhanni/features/misc/HideArmor.kt | 3 ++- .../skyhanni/features/misc/IslandAreas.kt | 2 +- .../skyhanni/features/misc/LockMouseLook.kt | 5 +++-- .../skyhanni/features/misc/MarkedPlayerManager.kt | 5 +++-- .../skyhanni/features/misc/MiscFeatures.kt | 3 ++- .../skyhanni/features/misc/NoBitsWarning.kt | 3 +-- .../features/misc/NonGodPotEffectDisplay.kt | 2 +- .../skyhanni/features/misc/ParticleHider.kt | 3 ++- .../features/misc/PatcherSendCoordinates.kt | 3 ++- .../features/misc/PocketSackInASackDisplay.kt | 2 +- .../skyhanni/features/misc/QuickModMenuSwitch.kt | 3 ++- .../skyhanni/features/misc/TimeFeatures.kt | 3 ++- .../skyhanni/features/misc/TpsCounter.kt | 2 +- .../misc/compacttablist/AdvancedPlayerList.kt | 4 ++-- .../features/misc/compacttablist/TabListReader.kt | 3 +-- .../misc/compacttablist/TabListRenderer.kt | 2 +- .../features/misc/discordrpc/DiscordRPCManager.kt | 10 +++++----- .../features/misc/items/EstimatedItemValue.kt | 4 ++-- .../features/misc/items/enchants/EnchantParser.kt | 2 +- .../features/misc/limbo/LimboTimeTracker.kt | 6 +++--- .../features/misc/pets/CurrentPetDisplay.kt | 3 ++- .../features/misc/pets/PetCandyUsedDisplay.kt | 3 +-- .../skyhanni/features/misc/pets/PetExpTooltip.kt | 3 ++- .../features/misc/trevor/TrevorFeatures.kt | 8 ++++---- .../features/misc/update/UpdateManager.kt | 3 ++- .../nether/CrimsonMinibossRespawnTimer.kt | 3 ++- .../skyhanni/features/nether/SulphurSkitterBox.kt | 3 ++- .../nether/ashfang/AshfangFreezeCooldown.kt | 3 ++- .../features/nether/ashfang/AshfangHider.kt | 2 +- .../features/nether/ashfang/AshfangHighlights.kt | 2 +- .../features/nether/ashfang/AshfangManager.kt | 3 ++- .../nether/ashfang/AshfangNextResetCooldown.kt | 3 ++- .../CrimsonIsleReputationHelper.kt | 15 ++++++--------- .../dailyquest/DailyQuestHelper.kt | 2 +- .../rift/area/colosseum/BlobbercystsHighlight.kt | 3 ++- .../rift/area/dreadfarm/RiftAgaricusCap.kt | 2 +- .../area/dreadfarm/RiftWiltedBerberisHelper.kt | 2 +- .../area/livingcave/LivingCaveDefenseBlocks.kt | 2 +- .../rift/area/mirrorverse/DanceRoomHelper.kt | 2 +- .../rift/area/mirrorverse/RiftLavaMazeParkour.kt | 2 +- .../area/mirrorverse/RiftUpsideDownParkour.kt | 2 +- .../rift/area/mirrorverse/TubulatorParkour.kt | 2 +- .../area/stillgorechateau/RiftBloodEffigies.kt | 6 +++--- .../rift/area/westvillage/RiftGunthersRace.kt | 2 +- .../rift/area/westvillage/VerminHighlighter.kt | 3 ++- .../rift/area/westvillage/kloon/KloonHacking.kt | 3 ++- .../rift/area/wyldwoods/ShyCruxWarnings.kt | 3 ++- .../rift/everywhere/CruxTalismanDisplay.kt | 3 ++- .../rift/everywhere/PunchcardHighlight.kt | 4 ++-- .../features/rift/everywhere/RiftTimer.kt | 2 +- .../rift/everywhere/motes/RiftMotesOrb.kt | 3 ++- .../everywhere/motes/ShowMotesNpcSellPrice.kt | 3 ++- .../features/skillprogress/SkillProgress.kt | 2 +- .../features/slayer/SlayerProfitTracker.kt | 2 +- .../features/slayer/VampireSlayerFeatures.kt | 2 +- .../features/slayer/blaze/BlazeSlayerClearView.kt | 2 +- .../slayer/blaze/BlazeSlayerDaggerHelper.kt | 2 +- .../slayer/blaze/BlazeSlayerFirePitsWarning.kt | 2 +- .../features/slayer/blaze/HellionShieldHelper.kt | 3 ++- .../slayer/enderman/EndermanSlayerFeatures.kt | 2 +- .../enderman/EndermanSlayerHideParticles.kt | 3 ++- .../features/stranded/HighlightPlaceableNpcs.kt | 3 ++- .../features/summonings/SummoningMobManager.kt | 3 ++- .../at/hannibal2/skyhanni/test/DebugCommand.kt | 2 +- .../skyhanni/test/HighlightMissingRepoItems.kt | 3 ++- .../skyhanni/test/ParkourWaypointSaver.kt | 7 ++++--- .../at/hannibal2/skyhanni/test/ShowItemUuid.kt | 3 ++- .../skyhanni/test/SkyHanniDebugsAndTests.kt | 2 +- .../skyhanni/test/TestCopyBestiaryValues.kt | 3 ++- .../skyhanni/test/TestCopyRngMeterValues.kt | 3 ++- .../at/hannibal2/skyhanni/test/TestExportTools.kt | 3 +-- .../hannibal2/skyhanni/utils/ComputerEnvDebug.kt | 6 +++--- .../skyhanni/utils/ComputerTimeOffset.kt | 5 ++--- .../java/at/hannibal2/skyhanni/utils/ItemUtils.kt | 6 +++--- .../hannibal2/skyhanni/utils/KeyboardManager.kt | 10 +++++----- .../skyhanni/utils/MinecraftConsoleFilter.kt | 4 ++-- .../utils/repopatterns/RepoPatternManager.kt | 2 +- 234 files changed, 458 insertions(+), 379 deletions(-) delete mode 100644 src/main/java/at/hannibal2/skyhanni/events/LorenzKeyPressEvent.kt create mode 100644 src/main/java/at/hannibal2/skyhanni/events/minecraft/KeyPressEvent.kt diff --git a/src/main/java/at/hannibal2/skyhanni/api/SkillAPI.kt b/src/main/java/at/hannibal2/skyhanni/api/SkillAPI.kt index 34a394d9dfa1..887b3e1144b2 100644 --- a/src/main/java/at/hannibal2/skyhanni/api/SkillAPI.kt +++ b/src/main/java/at/hannibal2/skyhanni/api/SkillAPI.kt @@ -215,8 +215,8 @@ object SkillAPI { } } - @SubscribeEvent - fun onDebugDataCollect(event: DebugDataCollectEvent) { + @HandleEvent + fun onDebug(event: DebugDataCollectEvent) { event.title("Skills") val storage = storage if (storage == null) { diff --git a/src/main/java/at/hannibal2/skyhanni/api/event/SkyHanniEvents.kt b/src/main/java/at/hannibal2/skyhanni/api/event/SkyHanniEvents.kt index 97fcbf3c6f62..dd7d60f3c9c1 100644 --- a/src/main/java/at/hannibal2/skyhanni/api/event/SkyHanniEvents.kt +++ b/src/main/java/at/hannibal2/skyhanni/api/event/SkyHanniEvents.kt @@ -53,7 +53,7 @@ object SkyHanniEvents { disabledHandlerInvokers = data.disabledInvokers } - @SubscribeEvent + @HandleEvent fun onDebug(event: DebugDataCollectEvent) { event.title("Events") event.addIrrelevant { diff --git a/src/main/java/at/hannibal2/skyhanni/config/ConfigUpdaterMigrator.kt b/src/main/java/at/hannibal2/skyhanni/config/ConfigUpdaterMigrator.kt index adbd98073ba3..69ed7f8d8ca2 100644 --- a/src/main/java/at/hannibal2/skyhanni/config/ConfigUpdaterMigrator.kt +++ b/src/main/java/at/hannibal2/skyhanni/config/ConfigUpdaterMigrator.kt @@ -1,6 +1,6 @@ package at.hannibal2.skyhanni.config -import at.hannibal2.skyhanni.events.LorenzEvent +import at.hannibal2.skyhanni.api.event.SkyHanniEvent import at.hannibal2.skyhanni.features.misc.limbo.LimboTimeTracker import at.hannibal2.skyhanni.utils.LorenzLogger import at.hannibal2.skyhanni.utils.LorenzUtils.asIntOrNull @@ -30,7 +30,7 @@ object ConfigUpdaterMigrator { val oldVersion: Int, var movesPerformed: Int, val dynamicPrefix: Map>, - ) : LorenzEvent() { + ) : SkyHanniEvent() { init { dynamicPrefix.entries @@ -141,7 +141,7 @@ object ConfigUpdaterMigrator { it.add("lastVersion", JsonPrimitive(i + 1)) }, i, 0, dynamicPrefix - ).also { it.postAndCatch() } + ).also { it.post() } logger.log("Transformations scheduled: ${migration.new}") val mergesPerformed = merge(migration.old, migration.new) logger.log("Migration done with $mergesPerformed merges and ${migration.movesPerformed} moves performed") diff --git a/src/main/java/at/hannibal2/skyhanni/data/BitsAPI.kt b/src/main/java/at/hannibal2/skyhanni/data/BitsAPI.kt index 06f28d89ce28..1fec9965be8b 100644 --- a/src/main/java/at/hannibal2/skyhanni/data/BitsAPI.kt +++ b/src/main/java/at/hannibal2/skyhanni/data/BitsAPI.kt @@ -391,7 +391,7 @@ object BitsAPI { fun isEnabled() = LorenzUtils.inSkyBlock && !LorenzUtils.isOnAlphaServer && profileStorage != null - @SubscribeEvent + @HandleEvent fun onConfigFix(event: ConfigUpdaterMigrator.ConfigFixEvent) { event.move(35, "#profile.bits.bitsToClaim", "#profile.bits.bitsAvailable") } diff --git a/src/main/java/at/hannibal2/skyhanni/data/ElectionAPI.kt b/src/main/java/at/hannibal2/skyhanni/data/ElectionAPI.kt index baedbd16cee5..e61d03af83d9 100644 --- a/src/main/java/at/hannibal2/skyhanni/data/ElectionAPI.kt +++ b/src/main/java/at/hannibal2/skyhanni/data/ElectionAPI.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.ConfigManager import at.hannibal2.skyhanni.data.ElectionCandidate.Companion.getMayorFromPerk import at.hannibal2.skyhanni.data.ElectionCandidate.Companion.setAssumeMayorJson @@ -242,8 +243,8 @@ object ElectionAPI { private fun List.bestCandidate() = maxBy { it.votes } - @SubscribeEvent - fun onConfigReload(event: ConfigLoadEvent) { + @HandleEvent + fun onConfigLoad(event: ConfigLoadEvent) { val config = SkyHanniMod.feature.dev.debug.assumeMayor config.onToggle { val mayor = config.get() @@ -257,8 +258,8 @@ object ElectionAPI { } } - @SubscribeEvent - fun onDebugDataCollect(event: DebugDataCollectEvent) { + @HandleEvent + fun onDebug(event: DebugDataCollectEvent) { event.title("Mayor") event.addIrrelevant { add("Current Mayor: ${currentMayor?.name ?: "Unknown"}") diff --git a/src/main/java/at/hannibal2/skyhanni/data/GuiEditManager.kt b/src/main/java/at/hannibal2/skyhanni/data/GuiEditManager.kt index dbcd84af3ff1..ce611b7e2799 100644 --- a/src/main/java/at/hannibal2/skyhanni/data/GuiEditManager.kt +++ b/src/main/java/at/hannibal2/skyhanni/data/GuiEditManager.kt @@ -1,12 +1,13 @@ package at.hannibal2.skyhanni.data import at.hannibal2.skyhanni.SkyHanniMod +import at.hannibal2.skyhanni.api.event.HandleEvent import at.hannibal2.skyhanni.config.core.config.Position import at.hannibal2.skyhanni.config.core.config.gui.GuiPositionEditor import at.hannibal2.skyhanni.events.GuiPositionMovedEvent import at.hannibal2.skyhanni.events.GuiRenderEvent -import at.hannibal2.skyhanni.events.LorenzKeyPressEvent import at.hannibal2.skyhanni.events.LorenzTickEvent +import at.hannibal2.skyhanni.events.minecraft.KeyPressEvent import at.hannibal2.skyhanni.skyhannimodule.SkyHanniModule import at.hannibal2.skyhanni.test.SkyHanniDebugsAndTests import at.hannibal2.skyhanni.utils.ChatUtils @@ -38,8 +39,8 @@ object GuiEditManager { private val currentBorderSize = mutableMapOf>() private var lastMovedGui: String? = null - @SubscribeEvent - fun onKeyClick(event: LorenzKeyPressEvent) { + @HandleEvent + fun onKeyPress(event: KeyPressEvent) { if (event.keyCode != SkyHanniMod.feature.gui.keyBindOpen) return if (event.keyCode == Keyboard.KEY_RETURN) { ChatUtils.chat("You can't use Enter as a keybind to open the gui editor!") diff --git a/src/main/java/at/hannibal2/skyhanni/data/HotmData.kt b/src/main/java/at/hannibal2/skyhanni/data/HotmData.kt index a87255a6b5ab..39bc5b948665 100644 --- a/src/main/java/at/hannibal2/skyhanni/data/HotmData.kt +++ b/src/main/java/at/hannibal2/skyhanni/data/HotmData.kt @@ -800,7 +800,7 @@ enum class HotmData( } } - @SubscribeEvent + @HandleEvent fun onDebug(event: DebugDataCollectEvent) { event.title("HotM") event.addIrrelevant { diff --git a/src/main/java/at/hannibal2/skyhanni/data/HypixelData.kt b/src/main/java/at/hannibal2/skyhanni/data/HypixelData.kt index 1cfb6b9e6436..9214bf7ec5cf 100644 --- a/src/main/java/at/hannibal2/skyhanni/data/HypixelData.kt +++ b/src/main/java/at/hannibal2/skyhanni/data/HypixelData.kt @@ -229,8 +229,8 @@ object HypixelData { ) } - @SubscribeEvent - fun onDebugDataCollect(event: DebugDataCollectEvent) { + @HandleEvent + fun onDebug(event: DebugDataCollectEvent) { event.title("Server ID") if (!LorenzUtils.inSkyBlock) { event.addIrrelevant("not in sb") diff --git a/src/main/java/at/hannibal2/skyhanni/data/MiningAPI.kt b/src/main/java/at/hannibal2/skyhanni/data/MiningAPI.kt index 1b4f36b22f3e..7f04a2952b95 100644 --- a/src/main/java/at/hannibal2/skyhanni/data/MiningAPI.kt +++ b/src/main/java/at/hannibal2/skyhanni/data/MiningAPI.kt @@ -436,8 +436,8 @@ object MiningAPI { pickobulusWaitingForBlock = false } - @SubscribeEvent - fun onDebugDataCollect(event: DebugDataCollectEvent) { + @HandleEvent + fun onDebug(event: DebugDataCollectEvent) { event.title("Mining API") if (!inCustomMiningIsland()) { event.addIrrelevant("not in a mining island") diff --git a/src/main/java/at/hannibal2/skyhanni/data/NotificationManager.kt b/src/main/java/at/hannibal2/skyhanni/data/NotificationManager.kt index 748e46892865..301215e58169 100644 --- a/src/main/java/at/hannibal2/skyhanni/data/NotificationManager.kt +++ b/src/main/java/at/hannibal2/skyhanni/data/NotificationManager.kt @@ -4,7 +4,7 @@ import at.hannibal2.skyhanni.api.event.HandleEvent import at.hannibal2.skyhanni.config.commands.CommandCategory import at.hannibal2.skyhanni.config.commands.CommandRegistrationEvent import at.hannibal2.skyhanni.events.GuiRenderEvent -import at.hannibal2.skyhanni.events.LorenzKeyPressEvent +import at.hannibal2.skyhanni.events.minecraft.KeyPressEvent import at.hannibal2.skyhanni.skyhannimodule.SkyHanniModule import at.hannibal2.skyhanni.utils.GuiRenderUtils import at.hannibal2.skyhanni.utils.InventoryUtils @@ -28,8 +28,8 @@ object NotificationManager { private const val CLOSE_TEXT = "§c[X] Close" - @SubscribeEvent - fun onKeyClick(event: LorenzKeyPressEvent) { + @HandleEvent + fun onKeyPress(event: KeyPressEvent) { currentNotification ?: return if (lastNotificationClosed.passedSince() < 200.milliseconds) return if (event.keyCode != Keyboard.KEY_X) return diff --git a/src/main/java/at/hannibal2/skyhanni/data/ProfileStorageData.kt b/src/main/java/at/hannibal2/skyhanni/data/ProfileStorageData.kt index 4c6a74be92d4..770dcd15eaee 100644 --- a/src/main/java/at/hannibal2/skyhanni/data/ProfileStorageData.kt +++ b/src/main/java/at/hannibal2/skyhanni/data/ProfileStorageData.kt @@ -51,7 +51,7 @@ object ProfileStorageData { } loadProfileSpecific(playerSpecific, sackPlayers, profileName) - ConfigLoadEvent().postAndCatch() + ConfigLoadEvent.post() } private fun workaroundIn10SecondsProfileStorage(profileName: String) { @@ -72,7 +72,7 @@ object ProfileStorageData { ErrorManager.skyHanniError("sackPlayers is null in ProfileJoinEvent!") } loadProfileSpecific(playerSpecific, sackPlayers, profileName) - ConfigLoadEvent().postAndCatch() + ConfigLoadEvent.post() } @HandleEvent @@ -122,7 +122,7 @@ object ProfileStorageData { profileSpecific = playerSpecific.profiles.getOrPut(profileName) { ProfileSpecificStorage() } sackProfiles = sackProfile.profiles.getOrPut(profileName) { SackData.ProfileSpecific() } loaded = true - ConfigLoadEvent().postAndCatch() + ConfigLoadEvent.post() } @HandleEvent @@ -130,7 +130,7 @@ object ProfileStorageData { val playerUuid = LorenzUtils.getRawPlayerUuid() playerSpecific = SkyHanniMod.feature.storage.players.getOrPut(playerUuid) { PlayerSpecificStorage() } sackPlayers = SkyHanniMod.sackData.players.getOrPut(playerUuid) { SackData.PlayerSpecific() } - ConfigLoadEvent().postAndCatch() + ConfigLoadEvent.post() } @SubscribeEvent diff --git a/src/main/java/at/hannibal2/skyhanni/data/RenderData.kt b/src/main/java/at/hannibal2/skyhanni/data/RenderData.kt index 0aae783575b8..e8671efafe4d 100644 --- a/src/main/java/at/hannibal2/skyhanni/data/RenderData.kt +++ b/src/main/java/at/hannibal2/skyhanni/data/RenderData.kt @@ -1,5 +1,6 @@ package at.hannibal2.skyhanni.data +import at.hannibal2.skyhanni.api.event.HandleEvent import at.hannibal2.skyhanni.config.ConfigUpdaterMigrator import at.hannibal2.skyhanni.config.features.chroma.ChromaConfig import at.hannibal2.skyhanni.events.GuiRenderEvent @@ -63,7 +64,7 @@ object RenderData { } // TODO find better spot for this - @SubscribeEvent + @HandleEvent fun onConfigFix(event: ConfigUpdaterMigrator.ConfigFixEvent) { event.transform(17, "chroma.chromaDirection") { element -> ConfigUtils.migrateIntToEnum(element, ChromaConfig.Direction::class.java) diff --git a/src/main/java/at/hannibal2/skyhanni/data/SlayerAPI.kt b/src/main/java/at/hannibal2/skyhanni/data/SlayerAPI.kt index 168ac433add0..e9f0d2a8e115 100644 --- a/src/main/java/at/hannibal2/skyhanni/data/SlayerAPI.kt +++ b/src/main/java/at/hannibal2/skyhanni/data/SlayerAPI.kt @@ -1,5 +1,6 @@ package at.hannibal2.skyhanni.data +import at.hannibal2.skyhanni.api.event.HandleEvent import at.hannibal2.skyhanni.events.DebugDataCollectEvent import at.hannibal2.skyhanni.events.LorenzChatEvent import at.hannibal2.skyhanni.events.LorenzTickEvent @@ -57,8 +58,8 @@ object SlayerAPI { } } - @SubscribeEvent - fun onDebugDataCollect(event: DebugDataCollectEvent) { + @HandleEvent + fun onDebug(event: DebugDataCollectEvent) { event.title("Slayer") if (!hasActiveSlayerQuest()) { diff --git a/src/main/java/at/hannibal2/skyhanni/data/TrackerManager.kt b/src/main/java/at/hannibal2/skyhanni/data/TrackerManager.kt index f2bce67b3617..fd46495cf347 100644 --- a/src/main/java/at/hannibal2/skyhanni/data/TrackerManager.kt +++ b/src/main/java/at/hannibal2/skyhanni/data/TrackerManager.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.events.ConfigLoadEvent import at.hannibal2.skyhanni.events.GuiRenderEvent import at.hannibal2.skyhanni.events.ItemAddEvent @@ -19,7 +20,7 @@ object TrackerManager { var dirty = false var commandEditTrackerSuccess = false - @SubscribeEvent + @HandleEvent fun onConfigLoad(event: ConfigLoadEvent) { val config = SkyHanniMod.feature.misc.tracker.hideCheapItems ConditionalUtils.onToggle(config.alwaysShowBest, config.minPrice, config.enabled) { diff --git a/src/main/java/at/hannibal2/skyhanni/data/bazaar/HypixelBazaarFetcher.kt b/src/main/java/at/hannibal2/skyhanni/data/bazaar/HypixelBazaarFetcher.kt index 06f84343411c..54648c445ac7 100644 --- a/src/main/java/at/hannibal2/skyhanni/data/bazaar/HypixelBazaarFetcher.kt +++ b/src/main/java/at/hannibal2/skyhanni/data/bazaar/HypixelBazaarFetcher.kt @@ -1,6 +1,7 @@ package at.hannibal2.skyhanni.data.bazaar import at.hannibal2.skyhanni.SkyHanniMod +import at.hannibal2.skyhanni.api.event.HandleEvent import at.hannibal2.skyhanni.config.ConfigManager import at.hannibal2.skyhanni.events.DebugDataCollectEvent import at.hannibal2.skyhanni.events.LorenzTickEvent @@ -35,8 +36,8 @@ object HypixelBazaarFetcher { private var failedAttempts = 0 private var nextFetchIsManual = false - @SubscribeEvent - fun onDebugDataCollect(event: DebugDataCollectEvent) { + @HandleEvent + fun onDebug(event: DebugDataCollectEvent) { event.title("Bazaar Data Fetcher from API") val data = listOf( diff --git a/src/main/java/at/hannibal2/skyhanni/data/hypixel/chat/PlayerNameFormatter.kt b/src/main/java/at/hannibal2/skyhanni/data/hypixel/chat/PlayerNameFormatter.kt index e7d83a1bddf1..175e1502b2ad 100644 --- a/src/main/java/at/hannibal2/skyhanni/data/hypixel/chat/PlayerNameFormatter.kt +++ b/src/main/java/at/hannibal2/skyhanni/data/hypixel/chat/PlayerNameFormatter.kt @@ -35,7 +35,6 @@ import net.minecraft.client.gui.FontRenderer import net.minecraft.util.ChatComponentText import net.minecraft.util.EnumChatFormatting import net.minecraft.util.IChatComponent -import net.minecraftforge.fml.common.eventhandler.SubscribeEvent /** * Listening to the player chat events, and applying custom chat options to them. @@ -280,7 +279,7 @@ object PlayerNameFormatter { fun isEnabled() = LorenzUtils.inSkyBlock && config.enable - @SubscribeEvent + @HandleEvent fun onConfigFix(event: ConfigUpdaterMigrator.ConfigFixEvent) { event.transform(41, "chat.PlayerMessagesConfig.partsOrder") { element -> val newList = JsonArray() 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 2a0300ad19ae..5619c8773602 100644 --- a/src/main/java/at/hannibal2/skyhanni/data/mob/MobDetection.kt +++ b/src/main/java/at/hannibal2/skyhanni/data/mob/MobDetection.kt @@ -377,8 +377,8 @@ object MobDetection { shouldClear.set(true) } - @SubscribeEvent - fun onDebugDataCollect(event: DebugDataCollectEvent) { + @HandleEvent + fun onDebug(event: DebugDataCollectEvent) { event.title("Mob Detection") if (forceReset) { event.addData("Mob Detection is manually disabled!") diff --git a/src/main/java/at/hannibal2/skyhanni/data/model/SkyblockStat.kt b/src/main/java/at/hannibal2/skyhanni/data/model/SkyblockStat.kt index 9ca7dc9ce6cf..999d21c10a30 100644 --- a/src/main/java/at/hannibal2/skyhanni/data/model/SkyblockStat.kt +++ b/src/main/java/at/hannibal2/skyhanni/data/model/SkyblockStat.kt @@ -174,7 +174,7 @@ enum class SkyblockStat( } } - @SubscribeEvent + @HandleEvent fun onConfigFix(event: ConfigUpdaterMigrator.ConfigFixEvent) { event.move(69, "#profile.stats.TRUE_DEFENCE", "#profile.stats.TRUE_DEFENSE") } diff --git a/src/main/java/at/hannibal2/skyhanni/events/ConfigLoadEvent.kt b/src/main/java/at/hannibal2/skyhanni/events/ConfigLoadEvent.kt index 4f1efeb9c246..72d0db796d68 100644 --- a/src/main/java/at/hannibal2/skyhanni/events/ConfigLoadEvent.kt +++ b/src/main/java/at/hannibal2/skyhanni/events/ConfigLoadEvent.kt @@ -1,3 +1,5 @@ package at.hannibal2.skyhanni.events -class ConfigLoadEvent : LorenzEvent() +import at.hannibal2.skyhanni.api.event.SkyHanniEvent + +object ConfigLoadEvent : SkyHanniEvent() diff --git a/src/main/java/at/hannibal2/skyhanni/events/DebugDataCollectEvent.kt b/src/main/java/at/hannibal2/skyhanni/events/DebugDataCollectEvent.kt index 3b8a884a9e8f..011fbfb11bdd 100644 --- a/src/main/java/at/hannibal2/skyhanni/events/DebugDataCollectEvent.kt +++ b/src/main/java/at/hannibal2/skyhanni/events/DebugDataCollectEvent.kt @@ -1,8 +1,9 @@ package at.hannibal2.skyhanni.events +import at.hannibal2.skyhanni.api.event.SkyHanniEvent import at.hannibal2.skyhanni.utils.StringUtils.equalsIgnoreColor -class DebugDataCollectEvent(private val list: MutableList, private val search: String) : LorenzEvent() { +class DebugDataCollectEvent(private val list: MutableList, private val search: String) : SkyHanniEvent() { var empty = true private var currentTitle = "" diff --git a/src/main/java/at/hannibal2/skyhanni/events/LorenzKeyPressEvent.kt b/src/main/java/at/hannibal2/skyhanni/events/LorenzKeyPressEvent.kt deleted file mode 100644 index e5af23d22ab6..000000000000 --- a/src/main/java/at/hannibal2/skyhanni/events/LorenzKeyPressEvent.kt +++ /dev/null @@ -1,3 +0,0 @@ -package at.hannibal2.skyhanni.events - -class LorenzKeyPressEvent(val keyCode: Int) : LorenzEvent() diff --git a/src/main/java/at/hannibal2/skyhanni/events/minecraft/KeyPressEvent.kt b/src/main/java/at/hannibal2/skyhanni/events/minecraft/KeyPressEvent.kt new file mode 100644 index 000000000000..fd13d45365b4 --- /dev/null +++ b/src/main/java/at/hannibal2/skyhanni/events/minecraft/KeyPressEvent.kt @@ -0,0 +1,5 @@ +package at.hannibal2.skyhanni.events.minecraft + +import at.hannibal2.skyhanni.api.event.SkyHanniEvent + +class KeyPressEvent(val keyCode: Int) : SkyHanniEvent() diff --git a/src/main/java/at/hannibal2/skyhanni/features/bingo/BingoAPI.kt b/src/main/java/at/hannibal2/skyhanni/features/bingo/BingoAPI.kt index b4ba01d58f0a..06a6745082ab 100644 --- a/src/main/java/at/hannibal2/skyhanni/features/bingo/BingoAPI.kt +++ b/src/main/java/at/hannibal2/skyhanni/features/bingo/BingoAPI.kt @@ -1,5 +1,6 @@ package at.hannibal2.skyhanni.features.bingo +import at.hannibal2.skyhanni.api.event.HandleEvent import at.hannibal2.skyhanni.config.storage.PlayerSpecificStorage.BingoSession import at.hannibal2.skyhanni.data.ProfileStorageData import at.hannibal2.skyhanni.data.jsonobjects.repo.BingoData @@ -36,8 +37,8 @@ object BingoAPI { " §.Ⓑ §.Bingo" ) - @SubscribeEvent - fun onDebugDataCollect(event: DebugDataCollectEvent) { + @HandleEvent + fun onDebug(event: DebugDataCollectEvent) { event.title("Bingo Card") if (!LorenzUtils.isBingoProfile) { diff --git a/src/main/java/at/hannibal2/skyhanni/features/bingo/MinionCraftHelper.kt b/src/main/java/at/hannibal2/skyhanni/features/bingo/MinionCraftHelper.kt index ae7d98e5569b..05ab00ed1cc7 100644 --- a/src/main/java/at/hannibal2/skyhanni/features/bingo/MinionCraftHelper.kt +++ b/src/main/java/at/hannibal2/skyhanni/features/bingo/MinionCraftHelper.kt @@ -1,6 +1,7 @@ package at.hannibal2.skyhanni.features.bingo 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.InventoryFullyOpenedEvent @@ -276,7 +277,7 @@ object MinionCraftHelper { } } - @SubscribeEvent + @HandleEvent fun onConfigFix(event: ConfigUpdaterMigrator.ConfigFixEvent) { event.transform(26, "#player.bingoSessions") { element -> for ((_, data) in element.asJsonObject.entrySet()) { diff --git a/src/main/java/at/hannibal2/skyhanni/features/bingo/card/BingoCardDisplay.kt b/src/main/java/at/hannibal2/skyhanni/features/bingo/card/BingoCardDisplay.kt index b04133b2abcc..470ca328b8c0 100644 --- a/src/main/java/at/hannibal2/skyhanni/features/bingo/card/BingoCardDisplay.kt +++ b/src/main/java/at/hannibal2/skyhanni/features/bingo/card/BingoCardDisplay.kt @@ -256,14 +256,14 @@ object BingoCardDisplay { update() } - @SubscribeEvent + @HandleEvent fun onConfigLoad(event: ConfigLoadEvent) { config.hideCommunityGoals.onToggle { update() } config.nextTipDuration.onToggle { update() } update() } - @SubscribeEvent + @HandleEvent fun onConfigFix(event: ConfigUpdaterMigrator.ConfigFixEvent) { event.move(2, "bingo", "event.bingo") } diff --git a/src/main/java/at/hannibal2/skyhanni/features/chat/ChatFilter.kt b/src/main/java/at/hannibal2/skyhanni/features/chat/ChatFilter.kt index 9bfc80f4a0ab..6f596c20fa26 100644 --- a/src/main/java/at/hannibal2/skyhanni/features/chat/ChatFilter.kt +++ b/src/main/java/at/hannibal2/skyhanni/features/chat/ChatFilter.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.config.ConfigUpdaterMigrator import at.hannibal2.skyhanni.data.HypixelData import at.hannibal2.skyhanni.events.LorenzChatEvent @@ -628,7 +629,7 @@ object ChatFilter { (messagesContainsMap[key].orEmpty()).any { this.contains(it) } || (messagesStartsWithMap[key].orEmpty()).any { this.startsWith(it) } - @SubscribeEvent + @HandleEvent fun onConfigFix(event: ConfigUpdaterMigrator.ConfigFixEvent) { event.move(3, "chat.hypixelHub", "chat.filterType.hypixelHub") event.move(3, "chat.empty", "chat.filterType.empty") diff --git a/src/main/java/at/hannibal2/skyhanni/features/chat/WatchdogHider.kt b/src/main/java/at/hannibal2/skyhanni/features/chat/WatchdogHider.kt index 6e1b005040ee..44fc2db2b78a 100644 --- a/src/main/java/at/hannibal2/skyhanni/features/chat/WatchdogHider.kt +++ b/src/main/java/at/hannibal2/skyhanni/features/chat/WatchdogHider.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.config.ConfigUpdaterMigrator import at.hannibal2.skyhanni.data.ChatManager import at.hannibal2.skyhanni.events.LorenzChatEvent @@ -52,7 +53,7 @@ object WatchdogHider { } } - @SubscribeEvent + @HandleEvent fun onConfigFix(event: ConfigUpdaterMigrator.ConfigFixEvent) { event.move(3, "chat.watchDog", "chat.filterType.watchDog") } diff --git a/src/main/java/at/hannibal2/skyhanni/features/chat/playerchat/PlayerChatModifier.kt b/src/main/java/at/hannibal2/skyhanni/features/chat/playerchat/PlayerChatModifier.kt index facd5efb70f6..6eb968c80606 100644 --- a/src/main/java/at/hannibal2/skyhanni/features/chat/playerchat/PlayerChatModifier.kt +++ b/src/main/java/at/hannibal2/skyhanni/features/chat/playerchat/PlayerChatModifier.kt @@ -10,7 +10,6 @@ import at.hannibal2.skyhanni.utils.StringUtils.applyIfPossible import net.minecraft.event.ClickEvent import net.minecraft.event.HoverEvent import net.minecraft.util.IChatComponent -import net.minecraftforge.fml.common.eventhandler.SubscribeEvent @SkyHanniModule object PlayerChatModifier { @@ -64,7 +63,7 @@ object PlayerChatModifier { return string } - @SubscribeEvent + @HandleEvent fun onConfigFix(event: ConfigUpdaterMigrator.ConfigFixEvent) { event.move(3, "chat.playerRankHider", "chat.playerMessage.playerRankHider") event.move(3, "chat.chatFilter", "chat.playerMessage.chatFilter") diff --git a/src/main/java/at/hannibal2/skyhanni/features/chat/translation/Translator.kt b/src/main/java/at/hannibal2/skyhanni/features/chat/translation/Translator.kt index ae2962da9727..0eece4eeebf5 100644 --- a/src/main/java/at/hannibal2/skyhanni/features/chat/translation/Translator.kt +++ b/src/main/java/at/hannibal2/skyhanni/features/chat/translation/Translator.kt @@ -2,6 +2,7 @@ package at.hannibal2.skyhanni.features.chat.translation import at.hannibal2.skyhanni.SkyHanniMod import at.hannibal2.skyhanni.SkyHanniMod.Companion.coroutineScope +import at.hannibal2.skyhanni.api.event.HandleEvent import at.hannibal2.skyhanni.config.ConfigUpdaterMigrator import at.hannibal2.skyhanni.events.ConfigLoadEvent import at.hannibal2.skyhanni.events.LorenzChatEvent @@ -49,15 +50,15 @@ object Translator { editedComponent.setChatStyle(clickStyle) } - @SubscribeEvent + @HandleEvent fun onConfigFix(event: ConfigUpdaterMigrator.ConfigFixEvent) { event.move(55, "chat.translator", "chat.translator.translateOnClick") } var lastUserChange = SimpleTimeMark.farPast() - @SubscribeEvent - fun onConfigReload(event: ConfigLoadEvent) { + @HandleEvent + fun onConfigLoad(event: ConfigLoadEvent) { config.languageCode.onToggle { if (lastUserChange.passedSince() < 50.milliseconds) return@onToggle lastUserChange = SimpleTimeMark.now() diff --git a/src/main/java/at/hannibal2/skyhanni/features/chroma/ChromaManager.kt b/src/main/java/at/hannibal2/skyhanni/features/chroma/ChromaManager.kt index 052cea4e45f6..188b3edef0f2 100644 --- a/src/main/java/at/hannibal2/skyhanni/features/chroma/ChromaManager.kt +++ b/src/main/java/at/hannibal2/skyhanni/features/chroma/ChromaManager.kt @@ -1,10 +1,10 @@ package at.hannibal2.skyhanni.features.chroma import at.hannibal2.skyhanni.SkyHanniMod +import at.hannibal2.skyhanni.api.event.HandleEvent import at.hannibal2.skyhanni.config.ConfigUpdaterMigrator import at.hannibal2.skyhanni.config.features.chroma.ChromaConfig import at.hannibal2.skyhanni.skyhannimodule.SkyHanniModule -import net.minecraftforge.fml.common.eventhandler.SubscribeEvent @SkyHanniModule object ChromaManager { @@ -23,7 +23,7 @@ object ChromaManager { } } - @SubscribeEvent + @HandleEvent fun onConfigFix(event: ConfigUpdaterMigrator.ConfigFixEvent) { event.move(31, "chroma", "gui.chroma") } diff --git a/src/main/java/at/hannibal2/skyhanni/features/combat/BestiaryData.kt b/src/main/java/at/hannibal2/skyhanni/features/combat/BestiaryData.kt index 660c2f303960..512a994d2c71 100644 --- a/src/main/java/at/hannibal2/skyhanni/features/combat/BestiaryData.kt +++ b/src/main/java/at/hannibal2/skyhanni/features/combat/BestiaryData.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.config.ConfigUpdaterMigrator import at.hannibal2.skyhanni.config.features.combat.BestiaryConfig import at.hannibal2.skyhanni.config.features.combat.BestiaryConfig.DisplayTypeEntry @@ -140,7 +141,7 @@ object BestiaryData { inInventory = false } - @SubscribeEvent + @HandleEvent fun onConfigFix(event: ConfigUpdaterMigrator.ConfigFixEvent) { event.move(2, "misc.bestiaryData", "combat.bestiary") diff --git a/src/main/java/at/hannibal2/skyhanni/features/combat/HideDamageSplash.kt b/src/main/java/at/hannibal2/skyhanni/features/combat/HideDamageSplash.kt index 215d4a0a3897..ef78e8f5ab5d 100644 --- a/src/main/java/at/hannibal2/skyhanni/features/combat/HideDamageSplash.kt +++ b/src/main/java/at/hannibal2/skyhanni/features/combat/HideDamageSplash.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.config.ConfigUpdaterMigrator import at.hannibal2.skyhanni.events.SkyHanniRenderEntityEvent import at.hannibal2.skyhanni.features.combat.damageindicator.DamageIndicatorManager @@ -23,7 +24,7 @@ object HideDamageSplash { } } - @SubscribeEvent + @HandleEvent fun onConfigFix(event: ConfigUpdaterMigrator.ConfigFixEvent) { event.move(2, "misc.hideDamageSplash", "combat.hideDamageSplash") } 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 1ff880e3e15b..19c5933f9f1a 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 @@ -909,7 +909,7 @@ object DamageIndicatorManager { } } - @SubscribeEvent + @HandleEvent fun onConfigFix(event: ConfigUpdaterMigrator.ConfigFixEvent) { event.move(2, "damageIndicator", "combat.damageIndicator") event.move(3, "slayer.endermanPhaseDisplay", "slayer.endermen.phaseDisplay") 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 7c1ec18e679a..29ee260c9c9a 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 @@ -182,7 +182,7 @@ object EnderNodeTracker { tracker.renderDisplay(config.position) } - @SubscribeEvent + @HandleEvent fun onConfigLoad(event: ConfigLoadEvent) { config.textFormat.afterChange { tracker.update() @@ -190,7 +190,7 @@ object EnderNodeTracker { tracker.update() } - @SubscribeEvent + @HandleEvent fun onConfigFix(event: ConfigUpdaterMigrator.ConfigFixEvent) { event.move(2, "misc.enderNodeTracker", "combat.enderNodeTracker") event.transform(11, "combat.enderNodeTracker.textFormat") { element -> 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 fefa68f3536d..1daea5869717 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 @@ -349,7 +349,7 @@ object GhostTracker { override fun toString(): String = display } - @SubscribeEvent + @HandleEvent fun onConfigLoad(event: ConfigLoadEvent) { val storage = storage ?: return if (storage.migratedTotalKills) return @@ -368,7 +368,7 @@ object GhostTracker { } } - @SubscribeEvent + @HandleEvent fun onConfigFix(event: ConfigUpdaterMigrator.ConfigFixEvent) { fun migrateItem(oldData: JsonElement): JsonElement { diff --git a/src/main/java/at/hannibal2/skyhanni/features/commands/PartyCommands.kt b/src/main/java/at/hannibal2/skyhanni/features/commands/PartyCommands.kt index b0c29fdcbfa7..0010718e8455 100644 --- a/src/main/java/at/hannibal2/skyhanni/features/commands/PartyCommands.kt +++ b/src/main/java/at/hannibal2/skyhanni/features/commands/PartyCommands.kt @@ -117,7 +117,7 @@ object PartyCommands { return null } - @SubscribeEvent + @HandleEvent fun onConfigFix(event: ConfigUpdaterMigrator.ConfigFixEvent) { event.move(5, "commands.usePartyTransferAlias", "commands.shortCommands") 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 6eb0da01119c..f3bbf3ddcda0 100644 --- a/src/main/java/at/hannibal2/skyhanni/features/commands/WikiManager.kt +++ b/src/main/java/at/hannibal2/skyhanni/features/commands/WikiManager.kt @@ -14,7 +14,6 @@ import at.hannibal2.skyhanni.utils.LorenzUtils import at.hannibal2.skyhanni.utils.NEUItems import at.hannibal2.skyhanni.utils.StringUtils.removeColor import net.minecraft.item.ItemStack -import net.minecraftforge.fml.common.eventhandler.SubscribeEvent import java.net.URLEncoder @SkyHanniModule @@ -26,7 +25,7 @@ object WikiManager { private val config get() = SkyHanniMod.feature.misc.commands.betterWiki - @SubscribeEvent + @HandleEvent fun onConfigFix(event: ConfigUpdaterMigrator.ConfigFixEvent) { event.move(6, "commands.useFandomWiki", "commands.fandomWiki.enabled") } diff --git a/src/main/java/at/hannibal2/skyhanni/features/commands/tabcomplete/PlayerTabComplete.kt b/src/main/java/at/hannibal2/skyhanni/features/commands/tabcomplete/PlayerTabComplete.kt index 693c2615976f..4ca43c59b628 100644 --- a/src/main/java/at/hannibal2/skyhanni/features/commands/tabcomplete/PlayerTabComplete.kt +++ b/src/main/java/at/hannibal2/skyhanni/features/commands/tabcomplete/PlayerTabComplete.kt @@ -1,6 +1,7 @@ package at.hannibal2.skyhanni.features.commands.tabcomplete import at.hannibal2.skyhanni.SkyHanniMod +import at.hannibal2.skyhanni.api.event.HandleEvent import at.hannibal2.skyhanni.config.ConfigUpdaterMigrator import at.hannibal2.skyhanni.data.FriendAPI import at.hannibal2.skyhanni.data.GuildAPI @@ -110,7 +111,7 @@ object PlayerTabComplete { vipVisits = data.vipVisits } - @SubscribeEvent + @HandleEvent fun onConfigFix(event: ConfigUpdaterMigrator.ConfigFixEvent) { event.move(2, "misc.tabCompleteCommands", "commands.tabComplete") } diff --git a/src/main/java/at/hannibal2/skyhanni/features/cosmetics/CosmeticFollowingLine.kt b/src/main/java/at/hannibal2/skyhanni/features/cosmetics/CosmeticFollowingLine.kt index 8f318e8ea4c9..7ca7ad1b1d0d 100644 --- a/src/main/java/at/hannibal2/skyhanni/features/cosmetics/CosmeticFollowingLine.kt +++ b/src/main/java/at/hannibal2/skyhanni/features/cosmetics/CosmeticFollowingLine.kt @@ -1,6 +1,7 @@ package at.hannibal2.skyhanni.features.cosmetics 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.events.LorenzRenderWorldEvent @@ -129,7 +130,7 @@ object CosmeticFollowingLine { private fun isEnabled() = (LorenzUtils.inSkyBlock || OutsideSbFeature.FOLLOWING_LINE.isSelected()) && config.enabled - @SubscribeEvent + @HandleEvent fun onConfigFix(event: ConfigUpdaterMigrator.ConfigFixEvent) { event.move(9, "misc.cosmeticConfig", "misc.cosmetic") event.move(9, "misc.cosmeticConfig.followingLineConfig", "misc.cosmetic.followingLine") 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 c1f52600b273..8edb9cefd83c 100644 --- a/src/main/java/at/hannibal2/skyhanni/features/dungeon/DungeonAPI.kt +++ b/src/main/java/at/hannibal2/skyhanni/features/dungeon/DungeonAPI.kt @@ -341,8 +341,8 @@ object DungeonAPI { } } - @SubscribeEvent - fun onDebugDataCollect(event: DebugDataCollectEvent) { + @HandleEvent + fun onDebug(event: DebugDataCollectEvent) { event.title("Dungeon") if (!inDungeon()) { 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 3f7332016b3a..88e6c0625603 100644 --- a/src/main/java/at/hannibal2/skyhanni/features/dungeon/DungeonCleanEnd.kt +++ b/src/main/java/at/hannibal2/skyhanni/features/dungeon/DungeonCleanEnd.kt @@ -132,7 +132,7 @@ object DungeonCleanEnd { } } - @SubscribeEvent + @HandleEvent fun onConfigFix(event: ConfigUpdaterMigrator.ConfigFixEvent) { event.move(3, "dungeon.cleanEndToggle", "dungeon.cleanEnd.enabled") event.move(3, "dungeon.cleanEndF3IgnoreGuardians", "dungeon.cleanEnd.F3IgnoreGuardians") 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 ab73259ab713..cb2b5a8fd911 100644 --- a/src/main/java/at/hannibal2/skyhanni/features/dungeon/DungeonCopilot.kt +++ b/src/main/java/at/hannibal2/skyhanni/features/dungeon/DungeonCopilot.kt @@ -155,7 +155,7 @@ object DungeonCopilot { config.pos.renderString(nextStep, posLabel = "Dungeon Copilot") } - @SubscribeEvent + @HandleEvent fun onConfigFix(event: ConfigUpdaterMigrator.ConfigFixEvent) { event.move(3, "dungeon.messageFilterKeysAndDoors", "dungeon.messageFilter.keysAndDoors") event.move(3, "dungeon.copilotEnabled", "dungeon.dungeonCopilot.enabled") diff --git a/src/main/java/at/hannibal2/skyhanni/features/dungeon/DungeonFinderFeatures.kt b/src/main/java/at/hannibal2/skyhanni/features/dungeon/DungeonFinderFeatures.kt index d0c7a5b83945..aabc785c3a95 100644 --- a/src/main/java/at/hannibal2/skyhanni/features/dungeon/DungeonFinderFeatures.kt +++ b/src/main/java/at/hannibal2/skyhanni/features/dungeon/DungeonFinderFeatures.kt @@ -380,7 +380,7 @@ object DungeonFinderFeatures { toolTipMap = emptyMap() } - @SubscribeEvent + @HandleEvent fun onConfigFix(event: ConfigUpdaterMigrator.ConfigFixEvent) { event.move(2, "dungeon.partyFinderColoredClassLevel", "dungeon.partyFinder.coloredClassLevel") } diff --git a/src/main/java/at/hannibal2/skyhanni/features/dungeon/DungeonHideItems.kt b/src/main/java/at/hannibal2/skyhanni/features/dungeon/DungeonHideItems.kt index 0cb127635be6..32c9e6c60bfe 100644 --- a/src/main/java/at/hannibal2/skyhanni/features/dungeon/DungeonHideItems.kt +++ b/src/main/java/at/hannibal2/skyhanni/features/dungeon/DungeonHideItems.kt @@ -194,7 +194,7 @@ object DungeonHideItems { movingSkeletonSkulls.clear() } - @SubscribeEvent + @HandleEvent fun onConfigFix(event: ConfigUpdaterMigrator.ConfigFixEvent) { event.move(3, "dungeon.hideSuperboomTNT", "dungeon.objectHider.hideSuperboomTNT") event.move(3, "dungeon.hideBlessing", "dungeon.objectHider.hideBlessing") diff --git a/src/main/java/at/hannibal2/skyhanni/features/dungeon/DungeonHighlightClickedBlocks.kt b/src/main/java/at/hannibal2/skyhanni/features/dungeon/DungeonHighlightClickedBlocks.kt index 5eb13abb4ad3..6c48b0452323 100644 --- a/src/main/java/at/hannibal2/skyhanni/features/dungeon/DungeonHighlightClickedBlocks.kt +++ b/src/main/java/at/hannibal2/skyhanni/features/dungeon/DungeonHighlightClickedBlocks.kt @@ -101,7 +101,7 @@ object DungeonHighlightClickedBlocks { } } - @SubscribeEvent + @HandleEvent fun onConfigFix(event: ConfigUpdaterMigrator.ConfigFixEvent) { event.move(56, "dungeon.highlightClickedBlocks", "dungeon.clickedBlocks.enabled") } diff --git a/src/main/java/at/hannibal2/skyhanni/features/dungeon/DungeonMobManager.kt b/src/main/java/at/hannibal2/skyhanni/features/dungeon/DungeonMobManager.kt index 83280a94cdea..858697ca13ee 100644 --- a/src/main/java/at/hannibal2/skyhanni/features/dungeon/DungeonMobManager.kt +++ b/src/main/java/at/hannibal2/skyhanni/features/dungeon/DungeonMobManager.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.mob.Mob import at.hannibal2.skyhanni.data.mob.MobData @@ -29,7 +30,7 @@ object DungeonMobManager { private val staredInvisible = mutableSetOf() private val felOnTheGround = mutableSetOf() - @SubscribeEvent + @HandleEvent fun onConfigLoad(event: ConfigLoadEvent) { onToggle( starredConfig.highlight, 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 32a10924cc0d..94fb6cd12daa 100644 --- a/src/main/java/at/hannibal2/skyhanni/features/dungeon/DungeonsRaceGuide.kt +++ b/src/main/java/at/hannibal2/skyhanni/features/dungeon/DungeonsRaceGuide.kt @@ -57,7 +57,7 @@ object DungeonsRaceGuide { updateConfig() } - @SubscribeEvent + @HandleEvent fun onConfigLoad(event: ConfigLoadEvent) { ConditionalUtils.onToggle(config.rainbowColor, config.monochromeColor, config.lookAhead) { updateConfig() diff --git a/src/main/java/at/hannibal2/skyhanni/features/event/diana/BurrowWarpHelper.kt b/src/main/java/at/hannibal2/skyhanni/features/event/diana/BurrowWarpHelper.kt index 4074b465de33..206db62d2961 100644 --- a/src/main/java/at/hannibal2/skyhanni/features/event/diana/BurrowWarpHelper.kt +++ b/src/main/java/at/hannibal2/skyhanni/features/event/diana/BurrowWarpHelper.kt @@ -1,11 +1,12 @@ package at.hannibal2.skyhanni.features.event.diana import at.hannibal2.skyhanni.SkyHanniMod +import at.hannibal2.skyhanni.api.event.HandleEvent import at.hannibal2.skyhanni.data.TitleManager import at.hannibal2.skyhanni.events.DebugDataCollectEvent import at.hannibal2.skyhanni.events.LorenzChatEvent -import at.hannibal2.skyhanni.events.LorenzKeyPressEvent import at.hannibal2.skyhanni.events.LorenzWorldChangeEvent +import at.hannibal2.skyhanni.events.minecraft.KeyPressEvent import at.hannibal2.skyhanni.skyhannimodule.SkyHanniModule import at.hannibal2.skyhanni.utils.ChatUtils import at.hannibal2.skyhanni.utils.CollectionUtils.sorted @@ -29,8 +30,8 @@ object BurrowWarpHelper { private var lastWarpTime = SimpleTimeMark.farPast() private var lastWarp: WarpPoint? = null - @SubscribeEvent - fun onKeyClick(event: LorenzKeyPressEvent) { + @HandleEvent + fun onKeyPress(event: KeyPressEvent) { if (!DianaAPI.isDoingDiana()) return if (!config.burrowNearestWarp) return @@ -73,8 +74,8 @@ object BurrowWarpHelper { currentWarp = null } - @SubscribeEvent - fun onDebugDataCollect(event: DebugDataCollectEvent) { + @HandleEvent + fun onDebug(event: DebugDataCollectEvent) { event.title("Diana Burrow Nearest Warp") if (!DianaAPI.isDoingDiana()) { 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 bb9ce7ff3ad3..c4eebff84f62 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 @@ -69,8 +69,8 @@ object GriffinBurrowHelper { private var testList = listOf() private var testGriffinSpots = false - @SubscribeEvent - fun onDebugDataCollect(event: DebugDataCollectEvent) { + @HandleEvent + fun onDebug(event: DebugDataCollectEvent) { event.title("Griffin Burrow Helper") if (!DianaAPI.isDoingDiana()) { @@ -354,7 +354,7 @@ object GriffinBurrowHelper { } } - @SubscribeEvent + @HandleEvent fun onConfigFix(event: ConfigUpdaterMigrator.ConfigFixEvent) { event.move(2, "diana", "event.diana") } 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 6b953eb939b5..1ce206a05599 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 @@ -36,8 +36,8 @@ object GriffinBurrowParticleFinder { // This exists to detect the unlucky timing when the user opens a burrow before it gets fully detected private var fakeBurrow: LorenzVec? = null - @SubscribeEvent - fun onDebugDataCollect(event: DebugDataCollectEvent) { + @HandleEvent + fun onDebug(event: DebugDataCollectEvent) { event.title("Griffin Burrow Particle Finder") if (!DianaAPI.isDoingDiana()) { 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 48bd5b8fcd14..309b456de4d0 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 @@ -4,11 +4,11 @@ import at.hannibal2.skyhanni.SkyHanniMod import at.hannibal2.skyhanni.api.event.HandleEvent import at.hannibal2.skyhanni.data.IslandType import at.hannibal2.skyhanni.events.LorenzChatEvent -import at.hannibal2.skyhanni.events.LorenzKeyPressEvent import at.hannibal2.skyhanni.events.LorenzWorldChangeEvent import at.hannibal2.skyhanni.events.SecondPassedEvent import at.hannibal2.skyhanni.events.diana.InquisitorFoundEvent import at.hannibal2.skyhanni.events.entity.EntityHealthUpdateEvent +import at.hannibal2.skyhanni.events.minecraft.KeyPressEvent import at.hannibal2.skyhanni.events.minecraft.packet.PacketReceivedEvent import at.hannibal2.skyhanni.skyhannimodule.SkyHanniModule import at.hannibal2.skyhanni.utils.ChatUtils @@ -200,8 +200,8 @@ object InquisitorWaypointShare { } } - @SubscribeEvent - fun onKeyClick(event: LorenzKeyPressEvent) { + @HandleEvent + fun onKeyPress(event: KeyPressEvent) { if (!isEnabled()) return if (Minecraft.getMinecraft().currentScreen != null) return if (event.keyCode == config.keyBindShare) sendInquisitor() diff --git a/src/main/java/at/hannibal2/skyhanni/features/event/diana/MythologicalCreatureTracker.kt b/src/main/java/at/hannibal2/skyhanni/features/event/diana/MythologicalCreatureTracker.kt index dbd46cd345aa..2068842aec05 100644 --- a/src/main/java/at/hannibal2/skyhanni/features/event/diana/MythologicalCreatureTracker.kt +++ b/src/main/java/at/hannibal2/skyhanni/features/event/diana/MythologicalCreatureTracker.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.events.ConfigLoadEvent import at.hannibal2.skyhanni.events.GuiRenderEvent @@ -125,7 +126,7 @@ object MythologicalCreatureTracker { addSearchString(" §7- §e${data.creaturesSinceLastInquisitor.addSeparators()} §7Creatures since last Minos Inquisitor") } - @SubscribeEvent + @HandleEvent fun onConfigLoad(event: ConfigLoadEvent) { ConditionalUtils.onToggle(config.showPercentage) { tracker.update() diff --git a/src/main/java/at/hannibal2/skyhanni/features/event/hoppity/HoppityCallWarning.kt b/src/main/java/at/hannibal2/skyhanni/features/event/hoppity/HoppityCallWarning.kt index 5223dd952f57..0b05c76f34fe 100644 --- a/src/main/java/at/hannibal2/skyhanni/features/event/hoppity/HoppityCallWarning.kt +++ b/src/main/java/at/hannibal2/skyhanni/features/event/hoppity/HoppityCallWarning.kt @@ -5,9 +5,9 @@ import at.hannibal2.skyhanni.data.PurseAPI import at.hannibal2.skyhanni.events.ConfigLoadEvent import at.hannibal2.skyhanni.events.GuiRenderEvent import at.hannibal2.skyhanni.events.LorenzChatEvent -import at.hannibal2.skyhanni.events.LorenzKeyPressEvent import at.hannibal2.skyhanni.events.MessageSendToServerEvent import at.hannibal2.skyhanni.events.SecondPassedEvent +import at.hannibal2.skyhanni.events.minecraft.KeyPressEvent import at.hannibal2.skyhanni.features.inventory.chocolatefactory.ChocolateFactoryAPI import at.hannibal2.skyhanni.skyhannimodule.SkyHanniModule import at.hannibal2.skyhanni.utils.ChatUtils @@ -73,8 +73,8 @@ object HoppityCallWarning { private var acceptUUID: String? = null private var commandSentTimer = SimpleTimeMark.farPast() - @SubscribeEvent - fun onKeyPress(event: LorenzKeyPressEvent) { + @HandleEvent + fun onKeyPress(event: KeyPressEvent) { if (config.acceptHotkey == Keyboard.KEY_NONE || config.acceptHotkey != event.keyCode) return acceptUUID?.let { HypixelCommands.callback(acceptUUID!!) @@ -82,7 +82,7 @@ object HoppityCallWarning { } } - @SubscribeEvent + @HandleEvent fun onConfigLoad(event: ConfigLoadEvent) { val soundProperty = config.hoppityCallSound ConditionalUtils.onToggle(soundProperty) { 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 b20581830a80..32808c4f3cc5 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 @@ -804,7 +804,7 @@ object HoppityCollectionStats { } } - @SubscribeEvent + @HandleEvent fun onConfigFix(event: ConfigUpdaterMigrator.ConfigFixEvent) { val bp = "inventory.chocolateFactory" mapOf( diff --git a/src/main/java/at/hannibal2/skyhanni/features/event/hoppity/HoppityEggLocator.kt b/src/main/java/at/hannibal2/skyhanni/features/event/hoppity/HoppityEggLocator.kt index 1eb3438424ba..53de2ae200bd 100644 --- a/src/main/java/at/hannibal2/skyhanni/features/event/hoppity/HoppityEggLocator.kt +++ b/src/main/java/at/hannibal2/skyhanni/features/event/hoppity/HoppityEggLocator.kt @@ -306,8 +306,8 @@ object HoppityEggLocator { return distToLine / disMultiplierSquared } - @SubscribeEvent - fun onDebugDataCollect(event: DebugDataCollectEvent) { + @HandleEvent + fun onDebug(event: DebugDataCollectEvent) { event.title("Hoppity Eggs Locations") if (!isEnabled()) { diff --git a/src/main/java/at/hannibal2/skyhanni/features/event/hoppity/HoppityEggsManager.kt b/src/main/java/at/hannibal2/skyhanni/features/event/hoppity/HoppityEggsManager.kt index 5bf9e30dc0dd..46ce29f0d22b 100644 --- a/src/main/java/at/hannibal2/skyhanni/features/event/hoppity/HoppityEggsManager.kt +++ b/src/main/java/at/hannibal2/skyhanni/features/event/hoppity/HoppityEggsManager.kt @@ -257,7 +257,7 @@ object HoppityEggsManager { SoundUtils.repeatSound(100, 10, SoundUtils.plingSound) } - @SubscribeEvent + @HandleEvent fun onConfigFix(event: ConfigUpdaterMigrator.ConfigFixEvent) { event.move( 44, diff --git a/src/main/java/at/hannibal2/skyhanni/features/event/hoppity/HoppityEventSummary.kt b/src/main/java/at/hannibal2/skyhanni/features/event/hoppity/HoppityEventSummary.kt index 02d530af4e79..564f424d8dcb 100644 --- a/src/main/java/at/hannibal2/skyhanni/features/event/hoppity/HoppityEventSummary.kt +++ b/src/main/java/at/hannibal2/skyhanni/features/event/hoppity/HoppityEventSummary.kt @@ -20,11 +20,11 @@ import at.hannibal2.skyhanni.events.InventoryCloseEvent import at.hannibal2.skyhanni.events.InventoryFullyOpenedEvent import at.hannibal2.skyhanni.events.IslandChangeEvent import at.hannibal2.skyhanni.events.LorenzChatEvent -import at.hannibal2.skyhanni.events.LorenzKeyPressEvent import at.hannibal2.skyhanni.events.ProfileJoinEvent import at.hannibal2.skyhanni.events.RepositoryReloadEvent import at.hannibal2.skyhanni.events.SecondPassedEvent import at.hannibal2.skyhanni.events.hoppity.RabbitFoundEvent +import at.hannibal2.skyhanni.events.minecraft.KeyPressEvent import at.hannibal2.skyhanni.features.event.hoppity.HoppityRabbitTheFishChecker.mealEggInventoryPattern import at.hannibal2.skyhanni.features.inventory.chocolatefactory.ChocolateFactoryAPI import at.hannibal2.skyhanni.features.inventory.chocolatefactory.ChocolateShopPrice.menuNamePattern @@ -191,8 +191,8 @@ object HoppityEventSummary { reCheckInventoryState() } - @SubscribeEvent - fun onKeyPress(event: LorenzKeyPressEvent) { + @HandleEvent + fun onKeyPress(event: KeyPressEvent) { reCheckInventoryState() if (!liveDisplayConfig.enabled) return if (liveDisplayConfig.toggleKeybind == Keyboard.KEY_NONE || liveDisplayConfig.toggleKeybind != event.keyCode) return @@ -232,13 +232,13 @@ object HoppityEventSummary { ) } - @SubscribeEvent + @HandleEvent fun onConfigFix(event: ConfigUpdaterMigrator.ConfigFixEvent) { event.move(64, "event.hoppity.preventMissingFish", "event.hoppity.preventMissingRabbitTheFish") event.move(65, "hoppityStatLiveDisplayToggled", "hoppityStatLiveDisplayToggledOff") } - @SubscribeEvent + @HandleEvent fun onConfigLoad(event: ConfigLoadEvent) { config.eventSummary.statDisplayList.afterChange { lastKnownStatHash = 0 diff --git a/src/main/java/at/hannibal2/skyhanni/features/event/jerry/frozentreasure/FrozenTreasureTracker.kt b/src/main/java/at/hannibal2/skyhanni/features/event/jerry/frozentreasure/FrozenTreasureTracker.kt index e41a61013210..e24db7dd1f47 100644 --- a/src/main/java/at/hannibal2/skyhanni/features/event/jerry/frozentreasure/FrozenTreasureTracker.kt +++ b/src/main/java/at/hannibal2/skyhanni/features/event/jerry/frozentreasure/FrozenTreasureTracker.kt @@ -1,6 +1,7 @@ package at.hannibal2.skyhanni.features.event.jerry.frozentreasure import at.hannibal2.skyhanni.SkyHanniMod +import at.hannibal2.skyhanni.api.event.HandleEvent import at.hannibal2.skyhanni.config.ConfigUpdaterMigrator import at.hannibal2.skyhanni.config.features.event.winter.FrozenTreasureConfig.FrozenTreasureDisplayEntry import at.hannibal2.skyhanni.data.IslandType @@ -177,7 +178,7 @@ object FrozenTreasureTracker { tracker.renderDisplay(config.position) } - @SubscribeEvent + @HandleEvent fun onConfigFix(event: ConfigUpdaterMigrator.ConfigFixEvent) { event.move(2, "misc.frozenTreasureTracker", "event.winter.frozenTreasureTracker") event.move( 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 254fea75bc58..7a6d5e38f44c 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 @@ -151,7 +151,7 @@ object BasketWaypoints { isActive = newIsActive } - @SubscribeEvent + @HandleEvent fun onConfigLoad(event: ConfigLoadEvent) { config.pathfind.onToggle { if (config.pathfind.get() && isActive && isEnabled()) startPathfind() @@ -189,7 +189,7 @@ object BasketWaypoints { private fun isEnabled() = HypixelData.hypixelLive && !LorenzUtils.inSkyBlock - @SubscribeEvent + @HandleEvent fun onConfigFix(event: ConfigUpdaterMigrator.ConfigFixEvent) { event.move(13, "event.halloweenBasket", "event.lobbyWaypoints.halloweenBasket") } diff --git a/src/main/java/at/hannibal2/skyhanni/features/event/spook/TheGreatSpook.kt b/src/main/java/at/hannibal2/skyhanni/features/event/spook/TheGreatSpook.kt index d9d0a91e965c..7cbfdd64a920 100644 --- a/src/main/java/at/hannibal2/skyhanni/features/event/spook/TheGreatSpook.kt +++ b/src/main/java/at/hannibal2/skyhanni/features/event/spook/TheGreatSpook.kt @@ -116,7 +116,7 @@ object TheGreatSpook { displayGreatSpookEnd = Renderable.string(timeLeftString) } - @SubscribeEvent + @HandleEvent fun onConfigLoad(event: ConfigLoadEvent) { val config = SkyHanniMod.feature.dev.debug.forceGreatSpook config.afterChange { @@ -241,7 +241,7 @@ object TheGreatSpook { greatSpookEndTime = if (SkyHanniMod.feature.dev.debug.forceGreatSpook.get()) SimpleTimeMark.farFuture() else endTime } - @SubscribeEvent + @HandleEvent fun onDebug(event: DebugDataCollectEvent) { event.title("Great Spook") diff --git a/src/main/java/at/hannibal2/skyhanni/features/fame/CityProjectFeatures.kt b/src/main/java/at/hannibal2/skyhanni/features/fame/CityProjectFeatures.kt index 33498b274e50..01459cb2569d 100644 --- a/src/main/java/at/hannibal2/skyhanni/features/fame/CityProjectFeatures.kt +++ b/src/main/java/at/hannibal2/skyhanni/features/fame/CityProjectFeatures.kt @@ -1,6 +1,7 @@ package at.hannibal2.skyhanni.features.fame import at.hannibal2.skyhanni.SkyHanniMod +import at.hannibal2.skyhanni.api.event.HandleEvent import at.hannibal2.skyhanni.config.ConfigUpdaterMigrator import at.hannibal2.skyhanni.data.EntityMovementData import at.hannibal2.skyhanni.data.IslandGraphs @@ -238,7 +239,7 @@ object CityProjectFeatures { } } - @SubscribeEvent + @HandleEvent fun onConfigFix(event: ConfigUpdaterMigrator.ConfigFixEvent) { event.move(2, "misc.cityProject", "event.cityProject") } diff --git a/src/main/java/at/hannibal2/skyhanni/features/fame/UpgradeReminder.kt b/src/main/java/at/hannibal2/skyhanni/features/fame/UpgradeReminder.kt index 44f053f0aa73..92ed5b49da26 100644 --- a/src/main/java/at/hannibal2/skyhanni/features/fame/UpgradeReminder.kt +++ b/src/main/java/at/hannibal2/skyhanni/features/fame/UpgradeReminder.kt @@ -1,6 +1,7 @@ package at.hannibal2.skyhanni.features.fame import at.hannibal2.skyhanni.SkyHanniMod +import at.hannibal2.skyhanni.api.event.HandleEvent import at.hannibal2.skyhanni.config.ConfigUpdaterMigrator import at.hannibal2.skyhanni.data.EntityMovementData import at.hannibal2.skyhanni.data.IslandGraphs @@ -167,7 +168,7 @@ object UpgradeReminder { private fun isEnabled() = LorenzUtils.inSkyBlock && config.accountUpgradeReminder - @SubscribeEvent + @HandleEvent fun onConfigFix(event: ConfigUpdaterMigrator.ConfigFixEvent) { event.move( 49, diff --git a/src/main/java/at/hannibal2/skyhanni/features/fishing/ChumBucketHider.kt b/src/main/java/at/hannibal2/skyhanni/features/fishing/ChumBucketHider.kt index 8afd4899866e..779854fa26f3 100644 --- a/src/main/java/at/hannibal2/skyhanni/features/fishing/ChumBucketHider.kt +++ b/src/main/java/at/hannibal2/skyhanni/features/fishing/ChumBucketHider.kt @@ -80,7 +80,7 @@ object ChumBucketHider { } } - @SubscribeEvent + @HandleEvent fun onConfigLoad(event: ConfigLoadEvent) { ConditionalUtils.onToggle(config.enabled, config.hideBucket, config.hideOwn) { reset() } } 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 7ffb623a8571..ec1df2d9e14f 100644 --- a/src/main/java/at/hannibal2/skyhanni/features/fishing/FishingTimer.kt +++ b/src/main/java/at/hannibal2/skyhanni/features/fishing/FishingTimer.kt @@ -7,12 +7,12 @@ import at.hannibal2.skyhanni.data.IslandType import at.hannibal2.skyhanni.data.mob.Mob import at.hannibal2.skyhanni.events.DebugDataCollectEvent import at.hannibal2.skyhanni.events.GuiRenderEvent -import at.hannibal2.skyhanni.events.LorenzKeyPressEvent import at.hannibal2.skyhanni.events.LorenzTickEvent import at.hannibal2.skyhanni.events.LorenzWorldChangeEvent import at.hannibal2.skyhanni.events.MobEvent import at.hannibal2.skyhanni.events.SeaCreatureFishEvent import at.hannibal2.skyhanni.events.SecondPassedEvent +import at.hannibal2.skyhanni.events.minecraft.KeyPressEvent import at.hannibal2.skyhanni.skyhannimodule.SkyHanniModule import at.hannibal2.skyhanni.utils.DelayedRun import at.hannibal2.skyhanni.utils.KeyboardManager.isKeyClicked @@ -160,8 +160,8 @@ object FishingTimer { updateInfo() } - @SubscribeEvent - fun onKeyPress(event: LorenzKeyPressEvent) { + @HandleEvent + fun onKeyPress(event: KeyPressEvent) { if (!isEnabled()) return if (Minecraft.getMinecraft().currentScreen != null) return if (config.manualResetTimer.isKeyClicked()) { @@ -229,7 +229,7 @@ object FishingTimer { return "$timeColor$timeFormat §8($countColor$currentCount §b$name§8)" } - @SubscribeEvent + @HandleEvent fun onDebug(event: DebugDataCollectEvent) { event.title("Barn Fishing Timer") event.addIrrelevant { @@ -263,7 +263,7 @@ object FishingTimer { private fun isEnabled() = LorenzUtils.inSkyBlock && config.enabled.get() - @SubscribeEvent + @HandleEvent fun onConfigFix(event: ConfigUpdaterMigrator.ConfigFixEvent) { event.move(3, "fishing.barnTimer", "fishing.barnTimer.enabled") event.move(3, "fishing.barnTimerAlertTime", "fishing.barnTimer.alertTime") diff --git a/src/main/java/at/hannibal2/skyhanni/features/fishing/LavaReplacement.kt b/src/main/java/at/hannibal2/skyhanni/features/fishing/LavaReplacement.kt index 68029e35d8e4..ad00ead14a61 100644 --- a/src/main/java/at/hannibal2/skyhanni/features/fishing/LavaReplacement.kt +++ b/src/main/java/at/hannibal2/skyhanni/features/fishing/LavaReplacement.kt @@ -13,7 +13,6 @@ import at.hannibal2.skyhanni.utils.LorenzUtils.isInIsland import com.google.gson.JsonArray import com.google.gson.JsonPrimitive import net.minecraft.client.Minecraft -import net.minecraftforge.fml.common.eventhandler.SubscribeEvent @SkyHanniModule object LavaReplacement { @@ -31,7 +30,7 @@ object LavaReplacement { } } - @SubscribeEvent + @HandleEvent fun onConfigLoad(event: ConfigLoadEvent) { ConditionalUtils.onToggle(config.enabled, config.everywhere, config.islands) { update() @@ -62,7 +61,7 @@ object LavaReplacement { fun inIsland() = island.isInIsland() } - @SubscribeEvent + @HandleEvent fun onConfigFix(event: ConfigUpdaterMigrator.ConfigFixEvent) { event.move(65, "fishing.lavaReplacement.onlyInCrimsonIsle", "fishing.lavaReplacement.everywhere") { element -> JsonPrimitive(!element.asBoolean) 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 06c68482af53..24059bd4ef55 100644 --- a/src/main/java/at/hannibal2/skyhanni/features/fishing/SeaCreatureFeatures.kt +++ b/src/main/java/at/hannibal2/skyhanni/features/fishing/SeaCreatureFeatures.kt @@ -101,7 +101,7 @@ object SeaCreatureFeatures { } } - @SubscribeEvent + @HandleEvent fun onConfigFix(event: ConfigUpdaterMigrator.ConfigFixEvent) { event.move(2, "fishing.rareSeaCreatureHighlight", "fishing.rareCatches.highlight") } diff --git a/src/main/java/at/hannibal2/skyhanni/features/fishing/ThunderSparksHighlight.kt b/src/main/java/at/hannibal2/skyhanni/features/fishing/ThunderSparksHighlight.kt index 0bd155afd8ef..d7ca5cd144d6 100644 --- a/src/main/java/at/hannibal2/skyhanni/features/fishing/ThunderSparksHighlight.kt +++ b/src/main/java/at/hannibal2/skyhanni/features/fishing/ThunderSparksHighlight.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.events.LorenzRenderWorldEvent @@ -67,7 +68,7 @@ object ThunderSparksHighlight { private fun isEnabled() = (IslandType.CRIMSON_ISLE.isInIsland() || LorenzUtils.isStrandedProfile) && config.highlight - @SubscribeEvent + @HandleEvent fun onConfigFix(event: ConfigUpdaterMigrator.ConfigFixEvent) { event.move(3, "fishing.thunderSparkHighlight", "fishing.thunderSpark.highlight") event.move(3, "fishing.thunderSparkColor", "fishing.thunderSpark.color") diff --git a/src/main/java/at/hannibal2/skyhanni/features/fishing/TotemOfCorruption.kt b/src/main/java/at/hannibal2/skyhanni/features/fishing/TotemOfCorruption.kt index dd5ba4724520..64c02f3f76d5 100644 --- a/src/main/java/at/hannibal2/skyhanni/features/fishing/TotemOfCorruption.kt +++ b/src/main/java/at/hannibal2/skyhanni/features/fishing/TotemOfCorruption.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.features.fishing.TotemOfCorruptionConfig.OutlineType import at.hannibal2.skyhanni.events.ConfigLoadEvent import at.hannibal2.skyhanni.events.GuiRenderEvent @@ -108,7 +109,7 @@ object TotemOfCorruption { } } - @SubscribeEvent + @HandleEvent fun onConfigLoad(event: ConfigLoadEvent) { config.showOverlay.onToggle { display = emptyList() 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 1944a65d8a76..742e5abfd97b 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 @@ -168,7 +168,7 @@ object SeaCreatureTracker { return { it in items } } - @SubscribeEvent + @HandleEvent fun onConfigLoad(event: ConfigLoadEvent) { ConditionalUtils.onToggle(config.showPercentage) { tracker.update() 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 f79105fd414f..c50a250b507f 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 @@ -305,8 +305,8 @@ object GoldenFishTimer { removeGoldenFish() } - @SubscribeEvent - fun onDebugData(event: DebugDataCollectEvent) { + @HandleEvent + fun onDebug(event: DebugDataCollectEvent) { event.title("Golden Fish Timer") if (!isEnabled()) { event.addIrrelevant("Not Enabled") diff --git a/src/main/java/at/hannibal2/skyhanni/features/fishing/trophy/OdgerWaypoint.kt b/src/main/java/at/hannibal2/skyhanni/features/fishing/trophy/OdgerWaypoint.kt index a5438d720db7..3d56036eea70 100644 --- a/src/main/java/at/hannibal2/skyhanni/features/fishing/trophy/OdgerWaypoint.kt +++ b/src/main/java/at/hannibal2/skyhanni/features/fishing/trophy/OdgerWaypoint.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.config.ConfigUpdaterMigrator import at.hannibal2.skyhanni.data.IslandType import at.hannibal2.skyhanni.events.LorenzRenderWorldEvent @@ -42,7 +43,7 @@ object OdgerWaypoint { event.drawDynamicText(location, "Odger", 1.5) } - @SubscribeEvent + @HandleEvent fun onConfigFix(event: ConfigUpdaterMigrator.ConfigFixEvent) { event.move(2, "fishing.odgerLocation", "fishing.trophyFishing.odgerLocation") } diff --git a/src/main/java/at/hannibal2/skyhanni/features/fishing/trophy/TrophyFishDisplay.kt b/src/main/java/at/hannibal2/skyhanni/features/fishing/trophy/TrophyFishDisplay.kt index 7d25c35b8ec4..f9e729bd2131 100644 --- a/src/main/java/at/hannibal2/skyhanni/features/fishing/trophy/TrophyFishDisplay.kt +++ b/src/main/java/at/hannibal2/skyhanni/features/fishing/trophy/TrophyFishDisplay.kt @@ -74,8 +74,8 @@ object TrophyFishDisplay { update() } - @SubscribeEvent - fun onConfigReload(event: ConfigLoadEvent) { + @HandleEvent + fun onConfigLoad(event: ConfigLoadEvent) { with(config) { ConditionalUtils.onToggle( enabled, diff --git a/src/main/java/at/hannibal2/skyhanni/features/fishing/trophy/TrophyFishFillet.kt b/src/main/java/at/hannibal2/skyhanni/features/fishing/trophy/TrophyFishFillet.kt index 33bfd63f0bb3..1cca2aefe208 100644 --- a/src/main/java/at/hannibal2/skyhanni/features/fishing/trophy/TrophyFishFillet.kt +++ b/src/main/java/at/hannibal2/skyhanni/features/fishing/trophy/TrophyFishFillet.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.config.ConfigUpdaterMigrator import at.hannibal2.skyhanni.events.LorenzToolTipEvent import at.hannibal2.skyhanni.features.fishing.trophy.TrophyFishManager.getFilletValue @@ -35,7 +36,7 @@ object TrophyFishFillet { event.toolTip.add("§7Fillet: §8${filletValue.addSeparators()} Magmafish §7(§6${filletPrice.shortFormat()}§7)") } - @SubscribeEvent + @HandleEvent fun onConfigFix(event: ConfigUpdaterMigrator.ConfigFixEvent) { event.move(2, "fishing.trophyFilletTooltip", "fishing.trophyFishing.filletTooltip") } diff --git a/src/main/java/at/hannibal2/skyhanni/features/fishing/trophy/TrophyFishMessages.kt b/src/main/java/at/hannibal2/skyhanni/features/fishing/trophy/TrophyFishMessages.kt index 4a23e84e5d52..bcac56c1c2b5 100644 --- a/src/main/java/at/hannibal2/skyhanni/features/fishing/trophy/TrophyFishMessages.kt +++ b/src/main/java/at/hannibal2/skyhanni/features/fishing/trophy/TrophyFishMessages.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.config.ConfigUpdaterMigrator import at.hannibal2.skyhanni.config.features.fishing.trophyfishing.ChatMessagesConfig.DesignFormat import at.hannibal2.skyhanni.events.LorenzChatEvent @@ -113,7 +114,7 @@ object TrophyFishMessages { rarity == TrophyRarity.SILVER && amount != 1 - @SubscribeEvent + @HandleEvent fun onConfigFix(event: ConfigUpdaterMigrator.ConfigFixEvent) { event.move(2, "fishing.trophyCounter", "fishing.trophyFishing.chatMessages.enabled") event.move(2, "fishing.trophyDesign", "fishing.trophyFishing.chatMessages.design") diff --git a/src/main/java/at/hannibal2/skyhanni/features/garden/AnitaMedalProfit.kt b/src/main/java/at/hannibal2/skyhanni/features/garden/AnitaMedalProfit.kt index e0eb9fb45e78..f9a0a16ed48e 100644 --- a/src/main/java/at/hannibal2/skyhanni/features/garden/AnitaMedalProfit.kt +++ b/src/main/java/at/hannibal2/skyhanni/features/garden/AnitaMedalProfit.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.GuiRenderEvent import at.hannibal2.skyhanni.events.InventoryCloseEvent @@ -182,7 +183,7 @@ object AnitaMedalProfit { ) } - @SubscribeEvent + @HandleEvent fun onConfigFix(event: ConfigUpdaterMigrator.ConfigFixEvent) { event.move(3, "garden.anitaMedalProfitEnabled", "garden.anitaShop.medalProfitEnabled") event.move(3, "garden.anitaMedalProfitPos", "garden.anitaShop.medalProfitPos") 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 8c8dcdd18fd0..0dc6ce28cf15 100644 --- a/src/main/java/at/hannibal2/skyhanni/features/garden/FarmingFortuneDisplay.kt +++ b/src/main/java/at/hannibal2/skyhanni/features/garden/FarmingFortuneDisplay.kt @@ -396,7 +396,7 @@ object FarmingFortuneDisplay { fun CropType.getLatestTrueFarmingFortune() = latestFF?.get(this) - @SubscribeEvent + @HandleEvent fun onConfigFix(event: ConfigUpdaterMigrator.ConfigFixEvent) { event.move(3, "garden.farmingFortuneDisplay", "garden.farmingFortunes.display") event.move(3, "garden.farmingFortuneDropMultiplier", "garden.farmingFortunes.dropMultiplier") 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 ebcc82491e4c..2753c95616d5 100644 --- a/src/main/java/at/hannibal2/skyhanni/features/garden/GardenAPI.kt +++ b/src/main/java/at/hannibal2/skyhanni/features/garden/GardenAPI.kt @@ -207,7 +207,7 @@ object GardenAPI { ChatUtils.chat("Manually reset all crop speed data!") } - @SubscribeEvent + @HandleEvent fun onConfigLoad(event: ConfigLoadEvent) { GardenBestCropTime.reset() } diff --git a/src/main/java/at/hannibal2/skyhanni/features/garden/GardenLevelDisplay.kt b/src/main/java/at/hannibal2/skyhanni/features/garden/GardenLevelDisplay.kt index ae52f170e566..8344f6b32022 100644 --- a/src/main/java/at/hannibal2/skyhanni/features/garden/GardenLevelDisplay.kt +++ b/src/main/java/at/hannibal2/skyhanni/features/garden/GardenLevelDisplay.kt @@ -214,14 +214,14 @@ object GardenLevelDisplay { config.pos.renderString(display, posLabel = "Garden Level") } - @SubscribeEvent + @HandleEvent fun onConfigLoad(event: ConfigLoadEvent) { ConditionalUtils.onToggle(config.overflow) { update() } } private fun isEnabled() = GardenAPI.inGarden() && config.display - @SubscribeEvent + @HandleEvent fun onConfigFix(event: ConfigUpdaterMigrator.ConfigFixEvent) { event.move(3, "garden.gardenLevelDisplay", "garden.gardenLevels.display") event.move(3, "garden.gardenLevelPos", "garden.gardenLevels.pos") 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 40162217e051..ebbdd8907c75 100644 --- a/src/main/java/at/hannibal2/skyhanni/features/garden/GardenNextJacobContest.kt +++ b/src/main/java/at/hannibal2/skyhanni/features/garden/GardenNextJacobContest.kt @@ -98,8 +98,8 @@ object GardenNextJacobContest { var fetchedFromElite = false private var isSendingContests = false - @SubscribeEvent - fun onDebugDataCollect(event: DebugDataCollectEvent) { + @HandleEvent + fun onDebug(event: DebugDataCollectEvent) { event.title("Garden Next Jacob Contest") if (!GardenAPI.inGarden()) { @@ -278,7 +278,7 @@ object GardenNextJacobContest { SkyHanniMod.configManager.saveConfig(ConfigFileType.JACOB_CONTESTS, "Save contests") } - @SubscribeEvent + @HandleEvent fun onConfigLoad(event: ConfigLoadEvent) { val savedContests = SkyHanniMod.jacobContestsData.contestTimes val year = savedContests.firstNotNullOfOrNull { @@ -641,7 +641,7 @@ object GardenNextJacobContest { fun isNextCrop(cropName: CropType) = nextContestCrops.contains(cropName) && config.otherGuis - @SubscribeEvent + @HandleEvent fun onConfigFix(event: ConfigUpdaterMigrator.ConfigFixEvent) { event.move(3, "garden.nextJacobContestDisplay", "garden.nextJacobContests.display") event.move(3, "garden.nextJacobContestEverywhere", "garden.nextJacobContests.everywhere") 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 8d804141561c..ace5cba716e0 100644 --- a/src/main/java/at/hannibal2/skyhanni/features/garden/GardenOptimalSpeed.kt +++ b/src/main/java/at/hannibal2/skyhanni/features/garden/GardenOptimalSpeed.kt @@ -130,7 +130,7 @@ object GardenOptimalSpeed { optimalSpeed = cropInHand?.getOptimalSpeed() } - @SubscribeEvent + @HandleEvent fun onConfigLoad(event: ConfigLoadEvent) { for (value in CropType.entries) { ConditionalUtils.onToggle(value.getConfig()) { @@ -217,7 +217,7 @@ object GardenOptimalSpeed { private fun isRancherOverlayEnabled() = GardenAPI.inGarden() && config.signEnabled - @SubscribeEvent + @HandleEvent fun onConfigFix(event: ConfigUpdaterMigrator.ConfigFixEvent) { event.move(3, "garden.optimalSpeedEnabled", "garden.optimalSpeeds.enabled") event.move(3, "garden.optimalSpeedWarning", "garden.optimalSpeeds.warning") diff --git a/src/main/java/at/hannibal2/skyhanni/features/garden/GardenPlotBorders.kt b/src/main/java/at/hannibal2/skyhanni/features/garden/GardenPlotBorders.kt index 9be28436815d..1a59dee59081 100644 --- a/src/main/java/at/hannibal2/skyhanni/features/garden/GardenPlotBorders.kt +++ b/src/main/java/at/hannibal2/skyhanni/features/garden/GardenPlotBorders.kt @@ -1,7 +1,8 @@ package at.hannibal2.skyhanni.features.garden -import at.hannibal2.skyhanni.events.LorenzKeyPressEvent +import at.hannibal2.skyhanni.api.event.HandleEvent import at.hannibal2.skyhanni.events.LorenzRenderWorldEvent +import at.hannibal2.skyhanni.events.minecraft.KeyPressEvent import at.hannibal2.skyhanni.features.garden.GardenPlotAPI.renderPlot import at.hannibal2.skyhanni.skyhannimodule.SkyHanniModule import at.hannibal2.skyhanni.utils.LocationUtils.distanceSqToPlayer @@ -18,8 +19,8 @@ object GardenPlotBorders { private var timeLastSaved = SimpleTimeMark.farPast() private var showBorders = false - @SubscribeEvent - fun onKeyClick(event: LorenzKeyPressEvent) { + @HandleEvent + fun onKeyPress(event: KeyPressEvent) { if (!isEnabled()) return if (timeLastSaved.passedSince() < 250.milliseconds) return diff --git a/src/main/java/at/hannibal2/skyhanni/features/garden/GardenWarpCommands.kt b/src/main/java/at/hannibal2/skyhanni/features/garden/GardenWarpCommands.kt index 281fb01447e4..853b72ed9bb6 100644 --- a/src/main/java/at/hannibal2/skyhanni/features/garden/GardenWarpCommands.kt +++ b/src/main/java/at/hannibal2/skyhanni/features/garden/GardenWarpCommands.kt @@ -1,8 +1,8 @@ package at.hannibal2.skyhanni.features.garden import at.hannibal2.skyhanni.api.event.HandleEvent -import at.hannibal2.skyhanni.events.LorenzKeyPressEvent import at.hannibal2.skyhanni.events.MessageSendToServerEvent +import at.hannibal2.skyhanni.events.minecraft.KeyPressEvent import at.hannibal2.skyhanni.features.misc.LockMouseLook import at.hannibal2.skyhanni.skyhannimodule.SkyHanniModule import at.hannibal2.skyhanni.utils.ChatUtils @@ -12,7 +12,6 @@ import at.hannibal2.skyhanni.utils.RegexUtils.matchMatcher import at.hannibal2.skyhanni.utils.SimpleTimeMark import at.hannibal2.skyhanni.utils.repopatterns.RepoPattern import net.minecraft.client.Minecraft -import net.minecraftforge.fml.common.eventhandler.SubscribeEvent import kotlin.time.Duration.Companion.seconds @SkyHanniModule @@ -58,8 +57,8 @@ object GardenWarpCommands { } } - @SubscribeEvent - fun onKeyClick(event: LorenzKeyPressEvent) { + @HandleEvent + fun onKeyPress(event: KeyPressEvent) { if (!GardenAPI.inGarden()) return if (Minecraft.getMinecraft().currentScreen != null) return if (NEUItems.neuHasFocus()) return 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 73cf8634ac06..31fa31041284 100755 --- a/src/main/java/at/hannibal2/skyhanni/features/garden/GardenYawAndPitch.kt +++ b/src/main/java/at/hannibal2/skyhanni/features/garden/GardenYawAndPitch.kt @@ -66,7 +66,7 @@ object GardenYawAndPitch { (LorenzUtils.inSkyBlock && (GardenAPI.inGarden() || config.showOutsideGarden)) ) - @SubscribeEvent + @HandleEvent fun onConfigFix(event: ConfigUpdaterMigrator.ConfigFixEvent) { event.move(18, "garden.yawPitchDisplay.showEverywhere", "garden.yawPitchDisplay.showOutsideGarden") } 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 60d61a2fb09b..da849c384044 100644 --- a/src/main/java/at/hannibal2/skyhanni/features/garden/SensitivityReducer.kt +++ b/src/main/java/at/hannibal2/skyhanni/features/garden/SensitivityReducer.kt @@ -79,7 +79,7 @@ object SensitivityReducer { } } - @SubscribeEvent + @HandleEvent fun onConfigLoad(event: ConfigLoadEvent) { config.reducingFactor.afterChange { reloadSensitivity() @@ -182,8 +182,8 @@ object SensitivityReducer { } } - @SubscribeEvent - fun onDebugDataCollect(event: DebugDataCollectEvent) { + @HandleEvent + fun onDebug(event: DebugDataCollectEvent) { event.title("Garden Sensitivity Reducer") if (!GardenAPI.inGarden()) { diff --git a/src/main/java/at/hannibal2/skyhanni/features/garden/ToolTooltipTweaks.kt b/src/main/java/at/hannibal2/skyhanni/features/garden/ToolTooltipTweaks.kt index 95bcbbea74d2..4527b726f763 100644 --- a/src/main/java/at/hannibal2/skyhanni/features/garden/ToolTooltipTweaks.kt +++ b/src/main/java/at/hannibal2/skyhanni/features/garden/ToolTooltipTweaks.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.features.garden.TooltipTweaksConfig.CropTooltipFortuneEntry import at.hannibal2.skyhanni.events.LorenzToolTipEvent @@ -160,7 +161,7 @@ object ToolTooltipTweaks { } } - @SubscribeEvent + @HandleEvent fun onConfigFix(event: ConfigUpdaterMigrator.ConfigFixEvent) { event.move(3, "garden.compactToolTooltips", "garden.tooltipTweak.compactToolTooltips") event.move(3, "garden.fortuneTooltipKeybind", "garden.tooltipTweak.fortuneTooltipKeybind") diff --git a/src/main/java/at/hannibal2/skyhanni/features/garden/composter/ComposterDisplay.kt b/src/main/java/at/hannibal2/skyhanni/features/garden/composter/ComposterDisplay.kt index 9c8dc43f64a1..daf26417b52f 100644 --- a/src/main/java/at/hannibal2/skyhanni/features/garden/composter/ComposterDisplay.kt +++ b/src/main/java/at/hannibal2/skyhanni/features/garden/composter/ComposterDisplay.kt @@ -205,7 +205,7 @@ object ComposterDisplay { LorenzUtils.sendTitle("§eComposter Warning!", 3.seconds) } - @SubscribeEvent + @HandleEvent fun onConfigFix(event: ConfigUpdaterMigrator.ConfigFixEvent) { event.move(3, "garden.composterDisplayEnabled", "garden.composters.displayEnabled") event.move(3, "garden.composterDisplayOutsideGarden", "garden.composters.displayOutsideGarden") diff --git a/src/main/java/at/hannibal2/skyhanni/features/garden/composter/ComposterInventoryNumbers.kt b/src/main/java/at/hannibal2/skyhanni/features/garden/composter/ComposterInventoryNumbers.kt index c26c562b30ce..60613260019c 100644 --- a/src/main/java/at/hannibal2/skyhanni/features/garden/composter/ComposterInventoryNumbers.kt +++ b/src/main/java/at/hannibal2/skyhanni/features/garden/composter/ComposterInventoryNumbers.kt @@ -12,7 +12,6 @@ import at.hannibal2.skyhanni.utils.NumberUtil.shortFormat import at.hannibal2.skyhanni.utils.RegexUtils.firstMatcher import at.hannibal2.skyhanni.utils.StringUtils.removeColor import at.hannibal2.skyhanni.utils.repopatterns.RepoPattern -import net.minecraftforge.fml.common.eventhandler.SubscribeEvent @SkyHanniModule object ComposterInventoryNumbers { @@ -82,7 +81,7 @@ object ComposterInventoryNumbers { } } - @SubscribeEvent + @HandleEvent fun onConfigFix(event: ConfigUpdaterMigrator.ConfigFixEvent) { event.move(3, "garden.composterInventoryNumbers", "garden.composters.inventoryNumbers") } 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 ab7674806828..d4bcc6db5ca7 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 @@ -621,7 +621,7 @@ object ComposterOverlay { DAY("Day", 60 * 60 * 24), } - @SubscribeEvent + @HandleEvent fun onConfigFix(event: ConfigUpdaterMigrator.ConfigFixEvent) { event.move(3, "garden.composterOverlay", "garden.composters.overlay") event.move(3, "garden.composterOverlayPriceType", "garden.composters.overlayPriceType") @@ -634,8 +634,8 @@ object ComposterOverlay { } } - @SubscribeEvent - fun onDebugDataCollect(event: DebugDataCollectEvent) { + @HandleEvent + fun onDebug(event: DebugDataCollectEvent) { event.title("Garden Composter") event.addIrrelevant { diff --git a/src/main/java/at/hannibal2/skyhanni/features/garden/composter/GardenComposterInventoryFeatures.kt b/src/main/java/at/hannibal2/skyhanni/features/garden/composter/GardenComposterInventoryFeatures.kt index 0474d85fda6a..a9b0ae2d3ac2 100644 --- a/src/main/java/at/hannibal2/skyhanni/features/garden/composter/GardenComposterInventoryFeatures.kt +++ b/src/main/java/at/hannibal2/skyhanni/features/garden/composter/GardenComposterInventoryFeatures.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.events.GuiContainerEvent import at.hannibal2.skyhanni.events.LorenzToolTipEvent @@ -91,7 +92,7 @@ object GardenComposterInventoryFeatures { } } - @SubscribeEvent + @HandleEvent fun onConfigFix(event: ConfigUpdaterMigrator.ConfigFixEvent) { event.move(3, "garden.composterUpgradePrice", "garden.composters.upgradePrice") event.move(3, "garden.composterHighLightUpgrade", "garden.composters.highlightUpgrade") diff --git a/src/main/java/at/hannibal2/skyhanni/features/garden/contest/FarmingPersonalBestGain.kt b/src/main/java/at/hannibal2/skyhanni/features/garden/contest/FarmingPersonalBestGain.kt index 729693c1d4d0..43b17c58efe3 100644 --- a/src/main/java/at/hannibal2/skyhanni/features/garden/contest/FarmingPersonalBestGain.kt +++ b/src/main/java/at/hannibal2/skyhanni/features/garden/contest/FarmingPersonalBestGain.kt @@ -1,5 +1,6 @@ package at.hannibal2.skyhanni.features.garden.contest +import at.hannibal2.skyhanni.api.event.HandleEvent import at.hannibal2.skyhanni.config.ConfigUpdaterMigrator import at.hannibal2.skyhanni.data.jsonobjects.repo.GardenJson import at.hannibal2.skyhanni.events.LorenzChatEvent @@ -58,7 +59,7 @@ object FarmingPersonalBestGain { personalBestIncrements = data.personalBestIncrement } - @SubscribeEvent + @HandleEvent fun onConfigFix(event: ConfigUpdaterMigrator.ConfigFixEvent) { event.move(68, "garden.contestPersonalBestIncreaseFF", "garden.personalBests.increaseFF") } 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 a4fd33c6dcea..cf3617fdcece 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 @@ -228,7 +228,7 @@ object JacobFarmingContestsInventory { } } - @SubscribeEvent + @HandleEvent fun onConfigFix(event: ConfigUpdaterMigrator.ConfigFixEvent) { event.move( 3, diff --git a/src/main/java/at/hannibal2/skyhanni/features/garden/farming/ArmorDropTracker.kt b/src/main/java/at/hannibal2/skyhanni/features/garden/farming/ArmorDropTracker.kt index 81ed91f01078..c9787683bfda 100644 --- a/src/main/java/at/hannibal2/skyhanni/features/garden/farming/ArmorDropTracker.kt +++ b/src/main/java/at/hannibal2/skyhanni/features/garden/farming/ArmorDropTracker.kt @@ -163,7 +163,7 @@ object ArmorDropTracker { return currentArmorDropChance } - @SubscribeEvent + @HandleEvent fun onConfigFix(event: ConfigUpdaterMigrator.ConfigFixEvent) { event.move(3, "garden.farmingArmorDropsEnabled", "garden.farmingArmorDrop.enabled") event.move(3, "garden.farmingArmorDropsHideChat", "garden.farmingArmorDrop.hideChat") 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 0c5b6e3f9331..9e8aac9fbef1 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 @@ -441,7 +441,7 @@ object CropMoneyDisplay { private fun isEnabled() = GardenAPI.inGarden() && config.display - @SubscribeEvent + @HandleEvent fun onConfigFix(event: ConfigUpdaterMigrator.ConfigFixEvent) { event.move(3, "garden.moneyPerHourDisplay", "garden.moneyPerHours.display") event.move(3, "garden.moneyPerHourShowOnlyBest", "garden.moneyPerHours.showOnlyBest") 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 a1b142425667..04cc32c91311 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 @@ -118,7 +118,7 @@ object DicerRngDropTracker { } } - @SubscribeEvent + @HandleEvent fun onConfigLoad(event: ConfigLoadEvent) { ConditionalUtils.onToggle(config.compact) { tracker.update() @@ -181,7 +181,7 @@ object DicerRngDropTracker { fun isEnabled() = GardenAPI.inGarden() && config.display - @SubscribeEvent + @HandleEvent fun onConfigFix(event: ConfigUpdaterMigrator.ConfigFixEvent) { event.move(3, "garden.dicerCounterDisplay", "garden.dicerCounters.display") event.move(3, "garden.dicerCounterHideChat", "garden.dicerCounters.hideChat") 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 7e3eee6fe9da..b742bbd353ac 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 @@ -86,7 +86,7 @@ object FarmingWeightDisplay { } } - @SubscribeEvent + @HandleEvent fun onConfigFix(event: ConfigUpdaterMigrator.ConfigFixEvent) { event.transform(1, "garden.eliteFarmingWeightoffScreenDropMessage") event.move(3, "garden.eliteFarmingWeightDisplay", "garden.eliteFarmingWeights.display") diff --git a/src/main/java/at/hannibal2/skyhanni/features/garden/farming/GardenBestCropTime.kt b/src/main/java/at/hannibal2/skyhanni/features/garden/farming/GardenBestCropTime.kt index e8ca52ac8485..d441fab1015e 100644 --- a/src/main/java/at/hannibal2/skyhanni/features/garden/farming/GardenBestCropTime.kt +++ b/src/main/java/at/hannibal2/skyhanni/features/garden/farming/GardenBestCropTime.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.NextConfig import at.hannibal2.skyhanni.config.features.garden.cropmilestones.NextConfig.BestTypeEntry @@ -17,7 +18,6 @@ import at.hannibal2.skyhanni.utils.CollectionUtils.sorted import at.hannibal2.skyhanni.utils.ConfigUtils import at.hannibal2.skyhanni.utils.TimeUnit import at.hannibal2.skyhanni.utils.TimeUtils.format -import net.minecraftforge.fml.common.eventhandler.SubscribeEvent import kotlin.time.Duration.Companion.milliseconds @SkyHanniModule @@ -136,7 +136,7 @@ object GardenBestCropTime { private fun getGardenExpForTier(gardenLevel: Int) = if (gardenLevel > 30) 300 else gardenLevel * 10 - @SubscribeEvent + @HandleEvent fun onConfigFix(event: ConfigUpdaterMigrator.ConfigFixEvent) { event.move(3, "garden.cropMilestoneBestType", "garden.cropMilestones.next.bestType") event.move(3, "garden.cropMilestoneShowOnlyBest", "garden.cropMilestones.next.showOnlyBest") 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 887c0c8ed602..fbf9a4cf18dd 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 @@ -59,7 +59,7 @@ object GardenCropMilestoneDisplay { private var lastMushWarnedLevel = -1 private var previousMushNext = 0 - @SubscribeEvent + @HandleEvent fun onConfigLoad(event: ConfigLoadEvent) { ConditionalUtils.onToggle( config.bestShowMaxedNeeded, @@ -338,7 +338,7 @@ object GardenCropMilestoneDisplay { private fun isEnabled() = GardenAPI.inGarden() && config.progress - @SubscribeEvent + @HandleEvent fun onConfigFix(event: ConfigUpdaterMigrator.ConfigFixEvent) { event.move(3, "garden.cropMilestoneProgress", "garden.cropMilestones.progress") event.move(3, "garden.cropMilestoneWarnClose", "garden.cropMilestones.warnClose") 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 a30f40727276..3bfec86484d6 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 @@ -189,7 +189,7 @@ object GardenCropSpeed { fun isSpeedDataEmpty() = cropsPerSecond?.values?.sum()?.let { it == 0 } ?: true - @SubscribeEvent + @HandleEvent fun onConfigFix(event: ConfigUpdaterMigrator.ConfigFixEvent) { event.move(3, "garden.blocksBrokenResetTime", "garden.cropMilestones.blocksBrokenResetTime") } diff --git a/src/main/java/at/hannibal2/skyhanni/features/garden/farming/GardenCustomKeybinds.kt b/src/main/java/at/hannibal2/skyhanni/features/garden/farming/GardenCustomKeybinds.kt index be5b60d31ba3..30705ee86d41 100644 --- a/src/main/java/at/hannibal2/skyhanni/features/garden/farming/GardenCustomKeybinds.kt +++ b/src/main/java/at/hannibal2/skyhanni/features/garden/farming/GardenCustomKeybinds.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.events.ConfigLoadEvent import at.hannibal2.skyhanni.events.LorenzTickEvent @@ -66,7 +67,7 @@ object GardenCustomKeybinds { lastDuplicateKeybindsWarnTime = SimpleTimeMark.now() } - @SubscribeEvent + @HandleEvent fun onConfigLoad(event: ConfigLoadEvent) { with(config) { ConditionalUtils.onToggle(attack, useItem, left, right, forward, back, jump, sneak) { @@ -140,7 +141,7 @@ object GardenCustomKeybinds { } } - @SubscribeEvent + @HandleEvent fun onConfigFix(event: ConfigUpdaterMigrator.ConfigFixEvent) { event.move(3, "garden.keyBindEnabled", "garden.keyBind.enabled") event.move(3, "garden.keyBindAttack", "garden.keyBind.attack") 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 630e0a227e85..03a5bb0ec160 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 @@ -416,8 +416,8 @@ object CaptureFarmingGear { storage.outdatedItems.clear() } - @SubscribeEvent - fun onConfigUpdaterMigratorConfigFix(event: ConfigUpdaterMigrator.ConfigFixEvent) { + @HandleEvent + fun onConfigFix(event: ConfigUpdaterMigrator.ConfigFixEvent) { event.move(48, "#profile.garden.fortune.carrotFortune", "#profile.garden.fortune.carrolyn.CARROT") event.move(48, "#profile.garden.fortune.pumpkinFortune", "#profile.garden.fortune.carrolyn.PUMPKIN") event.move(48, "#profile.garden.fortune.cocoaBeansFortune", "#profile.garden.fortune.carrolyn.COCOA_BEANS") diff --git a/src/main/java/at/hannibal2/skyhanni/features/garden/inventory/AnitaExtraFarmingFortune.kt b/src/main/java/at/hannibal2/skyhanni/features/garden/inventory/AnitaExtraFarmingFortune.kt index c589562bcaec..6abaf0aff459 100644 --- a/src/main/java/at/hannibal2/skyhanni/features/garden/inventory/AnitaExtraFarmingFortune.kt +++ b/src/main/java/at/hannibal2/skyhanni/features/garden/inventory/AnitaExtraFarmingFortune.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.jsonobjects.repo.AnitaUpgradeCostsJson import at.hannibal2.skyhanni.data.jsonobjects.repo.AnitaUpgradePrice @@ -86,7 +87,7 @@ object AnitaExtraFarmingFortune { levelPrice = data.levelPrice } - @SubscribeEvent + @HandleEvent fun onConfigFix(event: ConfigUpdaterMigrator.ConfigFixEvent) { event.move(3, "garden.extraFarmingFortune", "garden.anitaShop.extraFarmingFortune") } 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 492e2016c364..d6fa123ab2a3 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 @@ -82,7 +82,7 @@ object GardenCropMilestoneInventory { event.toolTip.add(index, "§7Progress to Tier $maxTier: §e$percentageFormat") } - @SubscribeEvent + @HandleEvent fun onConfigFix(event: ConfigUpdaterMigrator.ConfigFixEvent) { event.move(3, "garden.numberAverageCropMilestone", "garden.number.averageCropMilestone") event.move(3, "garden.cropMilestoneTotalProgress", "garden.tooltipTweak.cropMilestoneTotalProgress") diff --git a/src/main/java/at/hannibal2/skyhanni/features/garden/inventory/GardenInventoryNumbers.kt b/src/main/java/at/hannibal2/skyhanni/features/garden/inventory/GardenInventoryNumbers.kt index f48d5b4580a8..88e9b30d96d7 100644 --- a/src/main/java/at/hannibal2/skyhanni/features/garden/inventory/GardenInventoryNumbers.kt +++ b/src/main/java/at/hannibal2/skyhanni/features/garden/inventory/GardenInventoryNumbers.kt @@ -15,7 +15,6 @@ import at.hannibal2.skyhanni.utils.NumberUtil.romanToDecimalIfNecessary import at.hannibal2.skyhanni.utils.RegexUtils.firstMatcher import at.hannibal2.skyhanni.utils.RegexUtils.matchMatcher import at.hannibal2.skyhanni.utils.repopatterns.RepoPattern -import net.minecraftforge.fml.common.eventhandler.SubscribeEvent @SkyHanniModule object GardenInventoryNumbers { @@ -62,7 +61,7 @@ object GardenInventoryNumbers { } } - @SubscribeEvent + @HandleEvent fun onConfigFix(event: ConfigUpdaterMigrator.ConfigFixEvent) { event.move(3, "garden.numberCropMilestone", "garden.number.cropMilestone") event.move(3, "garden.numberCropUpgrades", "garden.number.cropUpgrades") diff --git a/src/main/java/at/hannibal2/skyhanni/features/garden/inventory/SkyMartCopperPrice.kt b/src/main/java/at/hannibal2/skyhanni/features/garden/inventory/SkyMartCopperPrice.kt index 6578748fca95..dcd82a256134 100644 --- a/src/main/java/at/hannibal2/skyhanni/features/garden/inventory/SkyMartCopperPrice.kt +++ b/src/main/java/at/hannibal2/skyhanni/features/garden/inventory/SkyMartCopperPrice.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.events.GuiRenderEvent import at.hannibal2.skyhanni.events.InventoryCloseEvent @@ -112,7 +113,7 @@ object SkyMartCopperPrice { } } - @SubscribeEvent + @HandleEvent fun onConfigFix(event: ConfigUpdaterMigrator.ConfigFixEvent) { event.move(3, "garden.skyMartCopperPrice", "garden.skyMart.copperPrice") event.move(3, "garden.skyMartCopperPriceAdvancedStats", "garden.skyMart.copperPriceAdvancedStats") 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 129ec78e28f5..65125fda3989 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 @@ -383,8 +383,8 @@ object PestAPI { } } - @SubscribeEvent - fun onDebugDataCollect(event: DebugDataCollectEvent) { + @HandleEvent + fun onDebug(event: DebugDataCollectEvent) { event.title("Garden Pests") if (!GardenAPI.inGarden()) { diff --git a/src/main/java/at/hannibal2/skyhanni/features/garden/pests/PestFinder.kt b/src/main/java/at/hannibal2/skyhanni/features/garden/pests/PestFinder.kt index 3d61325c27fc..302b0dc6c79c 100644 --- a/src/main/java/at/hannibal2/skyhanni/features/garden/pests/PestFinder.kt +++ b/src/main/java/at/hannibal2/skyhanni/features/garden/pests/PestFinder.kt @@ -6,9 +6,9 @@ import at.hannibal2.skyhanni.data.model.TabWidget import at.hannibal2.skyhanni.events.GuiRenderEvent import at.hannibal2.skyhanni.events.IslandChangeEvent import at.hannibal2.skyhanni.events.LorenzChatEvent -import at.hannibal2.skyhanni.events.LorenzKeyPressEvent import at.hannibal2.skyhanni.events.LorenzRenderWorldEvent import at.hannibal2.skyhanni.events.garden.pests.PestUpdateEvent +import at.hannibal2.skyhanni.events.minecraft.KeyPressEvent import at.hannibal2.skyhanni.features.garden.GardenAPI import at.hannibal2.skyhanni.features.garden.GardenPlotAPI import at.hannibal2.skyhanni.features.garden.GardenPlotAPI.isPestCountInaccurate @@ -191,8 +191,8 @@ object PestFinder { if (PestAPI.noPestsChatPattern.matches(event.message)) LorenzUtils.sendTitle("§eNo pests!", 2.seconds) } - @SubscribeEvent - fun onKeyClick(event: LorenzKeyPressEvent) { + @HandleEvent + fun onKeyPress(event: KeyPressEvent) { if (!GardenAPI.inGarden()) return if (Minecraft.getMinecraft().currentScreen != null) return if (NEUItems.neuHasFocus()) return diff --git a/src/main/java/at/hannibal2/skyhanni/features/garden/pests/PestSpawn.kt b/src/main/java/at/hannibal2/skyhanni/features/garden/pests/PestSpawn.kt index d70b13a3b022..3ada64462ac9 100644 --- a/src/main/java/at/hannibal2/skyhanni/features/garden/pests/PestSpawn.kt +++ b/src/main/java/at/hannibal2/skyhanni/features/garden/pests/PestSpawn.kt @@ -1,5 +1,6 @@ package at.hannibal2.skyhanni.features.garden.pests +import at.hannibal2.skyhanni.api.event.HandleEvent import at.hannibal2.skyhanni.config.ConfigUpdaterMigrator import at.hannibal2.skyhanni.config.features.garden.pests.PestSpawnConfig import at.hannibal2.skyhanni.config.features.garden.pests.PestSpawnConfig.ChatMessageFormatEntry @@ -113,7 +114,7 @@ object PestSpawn { } } - @SubscribeEvent + @HandleEvent fun onConfigFix(event: ConfigUpdaterMigrator.ConfigFixEvent) { event.transform(15, "garden.pests.pestSpawn.chatMessageFormat") { element -> ConfigUtils.migrateIntToEnum(element, ChatMessageFormatEntry::class.java) diff --git a/src/main/java/at/hannibal2/skyhanni/features/garden/pests/StereoHarmonyDisplay.kt b/src/main/java/at/hannibal2/skyhanni/features/garden/pests/StereoHarmonyDisplay.kt index c537cbe26e4e..3620a1e55480 100644 --- a/src/main/java/at/hannibal2/skyhanni/features/garden/pests/StereoHarmonyDisplay.kt +++ b/src/main/java/at/hannibal2/skyhanni/features/garden/pests/StereoHarmonyDisplay.kt @@ -1,5 +1,6 @@ package at.hannibal2.skyhanni.features.garden.pests +import at.hannibal2.skyhanni.api.event.HandleEvent import at.hannibal2.skyhanni.data.ProfileStorageData import at.hannibal2.skyhanni.events.ConfigLoadEvent import at.hannibal2.skyhanni.events.GuiRenderEvent @@ -112,7 +113,7 @@ object StereoHarmonyDisplay { display = emptyList() } - @SubscribeEvent + @HandleEvent fun onConfigLoad(event: ConfigLoadEvent) { ConditionalUtils.onToggle(config.showHead, config.showCrop) { update() } } 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 360768e560a2..f0ba066b481f 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 @@ -298,7 +298,7 @@ object GardenVisitorDropStatistics { ) } - @SubscribeEvent + @HandleEvent fun onConfigLoad(event: ConfigLoadEvent) { val storage = GardenAPI.storage?.visitorDrops ?: return val visitorRarities = storage.visitorRarities @@ -326,7 +326,7 @@ object GardenVisitorDropStatistics { config.pos.renderStringsAndItems(display, posLabel = "Visitor Stats") } - @SubscribeEvent + @HandleEvent fun onConfigFix(event: ConfigUpdaterMigrator.ConfigFixEvent) { val originalPrefix = "garden.visitorDropsStatistics." val newPrefix = "garden.visitors.dropsStatistics." 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 89b1577a5618..3459a52413a6 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 @@ -679,8 +679,8 @@ object GardenVisitorFeatures { return false } - @SubscribeEvent - fun onDebugDataCollect(event: DebugDataCollectEvent) { + @HandleEvent + fun onDebug(event: DebugDataCollectEvent) { event.title("Garden Visitor Stats") if (!GardenAPI.inGarden()) { @@ -707,7 +707,7 @@ object GardenVisitorFeatures { } } - @SubscribeEvent + @HandleEvent fun onConfigFix(event: ConfigUpdaterMigrator.ConfigFixEvent) { event.move(3, "garden.visitorNeedsDisplay", "garden.visitors.needs.display") event.move(3, "garden.visitorNeedsPos", "garden.visitors.needs.pos") 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 14ad314cfc8d..f0a192ab3aac 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 @@ -236,7 +236,7 @@ object GardenVisitorTimer { private fun isSixthVisitorWarningEnabled() = config.sixthVisitorWarning private fun isEnabled() = GardenAPI.inGarden() && config.enabled - @SubscribeEvent + @HandleEvent fun onConfigFix(event: ConfigUpdaterMigrator.ConfigFixEvent) { event.move(3, "garden.visitorTimerEnabled", "garden.visitors.timer.enabled") event.move(3, "garden.visitorTimerSixthVisitorEnabled", "garden.visitors.timer.sixthVisitorEnabled") 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 6df445836fc3..aa5b443f3571 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 @@ -182,7 +182,7 @@ object CustomScoreboard { takeIf { !informationFilteringConfig.hideEmptyLinesAtTopAndBottom } ?: dropWhile { it.display.isBlank() }.dropLastWhile { it.display.isBlank() } - @SubscribeEvent + @HandleEvent fun onConfigLoad(event: ConfigLoadEvent) { ConditionalUtils.onToggle( config.scoreboardEntries, @@ -209,8 +209,8 @@ object CustomScoreboard { currentIslandEvents = eventsConfig.eventEntries.get().map { it.event }.filter { it.showIsland() } } - @SubscribeEvent - fun onDebugDataCollect(event: DebugDataCollectEvent) { + @HandleEvent + fun onDebug(event: DebugDataCollectEvent) { event.title("Custom Scoreboard") event.addIrrelevant { if (!config.enabled.get()) { diff --git a/src/main/java/at/hannibal2/skyhanni/features/gui/customscoreboard/CustomScoreboardConfigFix.kt b/src/main/java/at/hannibal2/skyhanni/features/gui/customscoreboard/CustomScoreboardConfigFix.kt index 44dac812764e..a8347585bec4 100644 --- a/src/main/java/at/hannibal2/skyhanni/features/gui/customscoreboard/CustomScoreboardConfigFix.kt +++ b/src/main/java/at/hannibal2/skyhanni/features/gui/customscoreboard/CustomScoreboardConfigFix.kt @@ -1,5 +1,6 @@ package at.hannibal2.skyhanni.features.gui.customscoreboard +import at.hannibal2.skyhanni.api.event.HandleEvent import at.hannibal2.skyhanni.config.ConfigUpdaterMigrator import at.hannibal2.skyhanni.skyhannimodule.SkyHanniModule import at.hannibal2.skyhanni.utils.RenderUtils.HorizontalAlignment @@ -7,7 +8,6 @@ import at.hannibal2.skyhanni.utils.RenderUtils.VerticalAlignment import com.google.gson.JsonArray import com.google.gson.JsonElement import com.google.gson.JsonPrimitive -import net.minecraftforge.fml.common.eventhandler.SubscribeEvent @SkyHanniModule object CustomScoreboardConfigFix { @@ -20,7 +20,7 @@ object CustomScoreboardConfigFix { private const val TITLE_AND_FOOTER_KEY = "$DISPLAY_PREFIX.titleAndFooter" private const val EVENT_ENTRIES_KEY = "$DISPLAY_PREFIX.events.eventEntries" - @SubscribeEvent + @HandleEvent fun onConfigFix(event: ConfigUpdaterMigrator.ConfigFixEvent) { event.move(28, "$DISPLAY_CONFIG_PREFIX.showAllActiveEvents", "$EVENTS_CONFIG_KEY.showAllActiveEvents") 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 94b66b827a86..58594a562010 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 @@ -87,7 +87,7 @@ object QuiverDisplay { } } - @SubscribeEvent + @HandleEvent fun onConfigLoad(event: ConfigLoadEvent) { ConditionalUtils.onToggle( config.whenToShow, 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 67d31b463326..039e80549989 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 @@ -93,7 +93,7 @@ object QuiverWarning { private fun inInstance() = DungeonAPI.inDungeon() || KuudraAPI.inKuudra() - @SubscribeEvent + @HandleEvent fun onConfigFix(event: ConfigUpdaterMigrator.ConfigFixEvent) { event.move(35, "inventory.quiverAlert", "combat.quiverConfig.lowQuiverNotification") } diff --git a/src/main/java/at/hannibal2/skyhanni/features/inventory/AuctionsHighlighter.kt b/src/main/java/at/hannibal2/skyhanni/features/inventory/AuctionsHighlighter.kt index 0503a4e119b2..96df662dedf5 100644 --- a/src/main/java/at/hannibal2/skyhanni/features/inventory/AuctionsHighlighter.kt +++ b/src/main/java/at/hannibal2/skyhanni/features/inventory/AuctionsHighlighter.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.config.ConfigUpdaterMigrator import at.hannibal2.skyhanni.events.GuiContainerEvent import at.hannibal2.skyhanni.features.misc.items.EstimatedItemValueCalculator @@ -65,7 +66,7 @@ object AuctionsHighlighter { } } - @SubscribeEvent + @HandleEvent fun onConfigFix(event: ConfigUpdaterMigrator.ConfigFixEvent) { event.move(25, "inventory.highlightAuctions", "inventory.auctions.highlightAuctions") event.move(25, "inventory.highlightAuctionsUnderbid", "inventory.auctions.highlightAuctionsUnderbid") diff --git a/src/main/java/at/hannibal2/skyhanni/features/inventory/ChestValue.kt b/src/main/java/at/hannibal2/skyhanni/features/inventory/ChestValue.kt index 7f0cedc7f1e9..0baae0861fba 100644 --- a/src/main/java/at/hannibal2/skyhanni/features/inventory/ChestValue.kt +++ b/src/main/java/at/hannibal2/skyhanni/features/inventory/ChestValue.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.config.ConfigUpdaterMigrator import at.hannibal2.skyhanni.config.features.inventory.ChestValueConfig.NumberFormatEntry import at.hannibal2.skyhanni.config.features.inventory.ChestValueConfig.SortingTypeEntry @@ -295,7 +296,7 @@ object ChestValue { private fun isEnabled() = LorenzUtils.inSkyBlock && config.enabled - @SubscribeEvent + @HandleEvent fun onConfigFix(event: ConfigUpdaterMigrator.ConfigFixEvent) { event.transform(17, "inventory.chestValueConfig.formatType") { element -> ConfigUtils.migrateIntToEnum(element, NumberFormatEntry::class.java) 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 f47a08bde047..42ab144fdb8f 100644 --- a/src/main/java/at/hannibal2/skyhanni/features/inventory/HarpFeatures.kt +++ b/src/main/java/at/hannibal2/skyhanni/features/inventory/HarpFeatures.kt @@ -192,7 +192,7 @@ object HarpFeatures { event.stackTip = KeyboardManager.getKeyName(keyCode).take(3) } - @SubscribeEvent + @HandleEvent fun onConfigFix(event: ConfigUpdaterMigrator.ConfigFixEvent) { event.move(2, "misc.harpKeybinds", "inventory.helper.harp.keybinds") event.move(2, "misc.harpNumbers", "inventory.helper.harp.showNumbers") diff --git a/src/main/java/at/hannibal2/skyhanni/features/inventory/HideNotClickableItems.kt b/src/main/java/at/hannibal2/skyhanni/features/inventory/HideNotClickableItems.kt index 42e4fa07150f..d928516cd2b5 100644 --- a/src/main/java/at/hannibal2/skyhanni/features/inventory/HideNotClickableItems.kt +++ b/src/main/java/at/hannibal2/skyhanni/features/inventory/HideNotClickableItems.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.config.ConfigUpdaterMigrator import at.hannibal2.skyhanni.data.jsonobjects.repo.HideNotClickableItemsJson import at.hannibal2.skyhanni.data.jsonobjects.repo.SalvageFilter @@ -617,7 +618,7 @@ object HideNotClickableItems { private fun isEnabled() = LorenzUtils.inSkyBlock && config.items - @SubscribeEvent + @HandleEvent fun onConfigFix(event: ConfigUpdaterMigrator.ConfigFixEvent) { event.move(3, "inventory.hideNotClickableItems", "inventory.hideNotClickable.items") event.move(3, "inventory.hideNotClickableItemsBlockClicks", "inventory.hideNotClickable.itemsBlockClicks") diff --git a/src/main/java/at/hannibal2/skyhanni/features/inventory/HighlightBonzoMasks.kt b/src/main/java/at/hannibal2/skyhanni/features/inventory/HighlightBonzoMasks.kt index 41d673ad6263..6198c5037867 100644 --- a/src/main/java/at/hannibal2/skyhanni/features/inventory/HighlightBonzoMasks.kt +++ b/src/main/java/at/hannibal2/skyhanni/features/inventory/HighlightBonzoMasks.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.config.ConfigUpdaterMigrator import at.hannibal2.skyhanni.events.GuiContainerEvent import at.hannibal2.skyhanni.events.LorenzChatEvent @@ -75,7 +76,7 @@ object HighlightBonzoMasks { maskTimers.clear() } - @SubscribeEvent + @HandleEvent fun onConfigFix(event: ConfigUpdaterMigrator.ConfigFixEvent) { event.move(2, "inventory.highlightDepletedBonzosMasks", "itemAbilities.depletedBonzosMasks") } diff --git a/src/main/java/at/hannibal2/skyhanni/features/inventory/ItemDisplayOverlayFeatures.kt b/src/main/java/at/hannibal2/skyhanni/features/inventory/ItemDisplayOverlayFeatures.kt index e4ec55351758..d40d99f7253e 100644 --- a/src/main/java/at/hannibal2/skyhanni/features/inventory/ItemDisplayOverlayFeatures.kt +++ b/src/main/java/at/hannibal2/skyhanni/features/inventory/ItemDisplayOverlayFeatures.kt @@ -60,7 +60,6 @@ import at.hannibal2.skyhanni.utils.repopatterns.RepoPattern import com.google.gson.JsonArray import com.google.gson.JsonElement import net.minecraft.item.ItemStack -import net.minecraftforge.fml.common.eventhandler.SubscribeEvent @SkyHanniModule object ItemDisplayOverlayFeatures { @@ -359,7 +358,7 @@ object ItemDisplayOverlayFeatures { return text } - @SubscribeEvent + @HandleEvent fun onConfigFix(event: ConfigUpdaterMigrator.ConfigFixEvent) { event.transform(11, "inventory.itemNumberAsStackSize") { element -> ConfigUtils.migrateIntArrayListToEnumArrayList(element, ItemNumberEntry::class.java) diff --git a/src/main/java/at/hannibal2/skyhanni/features/inventory/RngMeterInventory.kt b/src/main/java/at/hannibal2/skyhanni/features/inventory/RngMeterInventory.kt index 2d6916355451..805d9a45778e 100644 --- a/src/main/java/at/hannibal2/skyhanni/features/inventory/RngMeterInventory.kt +++ b/src/main/java/at/hannibal2/skyhanni/features/inventory/RngMeterInventory.kt @@ -58,7 +58,7 @@ object RngMeterInventory { } } - @SubscribeEvent + @HandleEvent fun onConfigFix(event: ConfigUpdaterMigrator.ConfigFixEvent) { event.move(3, "inventory.rngMeterFloorName", "inventory.rngMeter.floorName") event.move(3, "inventory.rngMeterNoDrop", "inventory.rngMeter.noDrop") diff --git a/src/main/java/at/hannibal2/skyhanni/features/inventory/SackDisplay.kt b/src/main/java/at/hannibal2/skyhanni/features/inventory/SackDisplay.kt index 41a12e13732a..258d5d6db48c 100644 --- a/src/main/java/at/hannibal2/skyhanni/features/inventory/SackDisplay.kt +++ b/src/main/java/at/hannibal2/skyhanni/features/inventory/SackDisplay.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.config.ConfigUpdaterMigrator import at.hannibal2.skyhanni.config.features.inventory.SackDisplayConfig.NumberFormatEntry import at.hannibal2.skyhanni.config.features.inventory.SackDisplayConfig.PriceFormatEntry @@ -323,7 +324,7 @@ object SackDisplay { UNFORMATTED("Unformatted"), } - @SubscribeEvent + @HandleEvent fun onConfigFix(event: ConfigUpdaterMigrator.ConfigFixEvent) { event.transform(15, "inventory.sackDisplay.numberFormat") { element -> ConfigUtils.migrateIntToEnum(element, NumberFormatEntry::class.java) diff --git a/src/main/java/at/hannibal2/skyhanni/features/inventory/StatsTuning.kt b/src/main/java/at/hannibal2/skyhanni/features/inventory/StatsTuning.kt index 935dc580bd90..f8e794bef4fd 100644 --- a/src/main/java/at/hannibal2/skyhanni/features/inventory/StatsTuning.kt +++ b/src/main/java/at/hannibal2/skyhanni/features/inventory/StatsTuning.kt @@ -116,7 +116,7 @@ object StatsTuning { } } - @SubscribeEvent + @HandleEvent fun onConfigFix(event: ConfigUpdaterMigrator.ConfigFixEvent) { event.move(3, "inventory.statsTuningSelectedStats", "inventory.statsTuning.selectedStats") event.move(3, "inventory.statsTuningSelectedTemplate", "inventory.statsTuning.selectedTemplate") 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 329263f0a13d..0b297c120767 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 @@ -72,7 +72,7 @@ object AuctionHouseCopyUnderbidPrice { } } - @SubscribeEvent + @HandleEvent fun onConfigFix(event: ConfigUpdaterMigrator.ConfigFixEvent) { event.move(25, "inventory.copyUnderbidPrice", "inventory.auctions.autoCopyUnderbidPrice") } 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 855ad1668850..d621ccf3659a 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 @@ -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.config.ConfigUpdaterMigrator import at.hannibal2.skyhanni.data.OwnInventoryData import at.hannibal2.skyhanni.data.bazaar.HypixelBazaarFetcher @@ -176,7 +177,7 @@ object BazaarApi { } } - @SubscribeEvent + @HandleEvent fun onConfigFix(event: ConfigUpdaterMigrator.ConfigFixEvent) { event.move(25, "bazaar", "inventory.bazaar") } diff --git a/src/main/java/at/hannibal2/skyhanni/features/inventory/caketracker/CakeTracker.kt b/src/main/java/at/hannibal2/skyhanni/features/inventory/caketracker/CakeTracker.kt index 74a018db80ed..568d8acf36a0 100644 --- a/src/main/java/at/hannibal2/skyhanni/features/inventory/caketracker/CakeTracker.kt +++ b/src/main/java/at/hannibal2/skyhanni/features/inventory/caketracker/CakeTracker.kt @@ -168,7 +168,7 @@ object CakeTracker { } } - @SubscribeEvent + @HandleEvent fun onConfigLoad(event: ConfigLoadEvent) { ConditionalUtils.onToggle(config.maxHeight) { lastKnownCakeDataHash = 0 diff --git a/src/main/java/at/hannibal2/skyhanni/features/inventory/chocolatefactory/ChocolateFactoryAPI.kt b/src/main/java/at/hannibal2/skyhanni/features/inventory/chocolatefactory/ChocolateFactoryAPI.kt index e256250cbaea..113b8be4596a 100644 --- a/src/main/java/at/hannibal2/skyhanni/features/inventory/chocolatefactory/ChocolateFactoryAPI.kt +++ b/src/main/java/at/hannibal2/skyhanni/features/inventory/chocolatefactory/ChocolateFactoryAPI.kt @@ -1,6 +1,7 @@ package at.hannibal2.skyhanni.features.inventory.chocolatefactory import at.hannibal2.skyhanni.SkyHanniMod +import at.hannibal2.skyhanni.api.event.HandleEvent import at.hannibal2.skyhanni.config.ConfigUpdaterMigrator import at.hannibal2.skyhanni.config.features.inventory.chocolatefactory.ChocolateFactoryConfig import at.hannibal2.skyhanni.config.storage.ProfileSpecificStorage.ChocolateFactoryStorage @@ -174,7 +175,7 @@ object ChocolateFactoryAPI { ChocolateFactoryUpgrade.updateIgnoredSlots() } - @SubscribeEvent + @HandleEvent fun onConfigFix(event: ConfigUpdaterMigrator.ConfigFixEvent) { val old = "event.chocolateFactory" val new = "inventory.chocolateFactory" diff --git a/src/main/java/at/hannibal2/skyhanni/features/inventory/chocolatefactory/ChocolateFactoryDataLoader.kt b/src/main/java/at/hannibal2/skyhanni/features/inventory/chocolatefactory/ChocolateFactoryDataLoader.kt index bf759fceac39..b192476290a3 100644 --- a/src/main/java/at/hannibal2/skyhanni/features/inventory/chocolatefactory/ChocolateFactoryDataLoader.kt +++ b/src/main/java/at/hannibal2/skyhanni/features/inventory/chocolatefactory/ChocolateFactoryDataLoader.kt @@ -1,5 +1,6 @@ package at.hannibal2.skyhanni.features.inventory.chocolatefactory +import at.hannibal2.skyhanni.api.event.HandleEvent import at.hannibal2.skyhanni.config.ConfigUpdaterMigrator import at.hannibal2.skyhanni.events.ConfigLoadEvent import at.hannibal2.skyhanni.events.InventoryCloseEvent @@ -246,7 +247,7 @@ object ChocolateFactoryDataLoader { clearData() } - @SubscribeEvent + @HandleEvent fun onConfigFix(event: ConfigUpdaterMigrator.ConfigFixEvent) { event.move( 47, @@ -255,7 +256,7 @@ object ChocolateFactoryDataLoader { ) } - @SubscribeEvent + @HandleEvent fun onConfigLoad(event: ConfigLoadEvent) { val soundProperty = config.rabbitWarning.specialRabbitSound ConditionalUtils.onToggle(soundProperty) { diff --git a/src/main/java/at/hannibal2/skyhanni/features/inventory/chocolatefactory/ChocolateFactoryStats.kt b/src/main/java/at/hannibal2/skyhanni/features/inventory/chocolatefactory/ChocolateFactoryStats.kt index 02d6b50915a4..05666a1bad1e 100644 --- a/src/main/java/at/hannibal2/skyhanni/features/inventory/chocolatefactory/ChocolateFactoryStats.kt +++ b/src/main/java/at/hannibal2/skyhanni/features/inventory/chocolatefactory/ChocolateFactoryStats.kt @@ -1,5 +1,6 @@ package at.hannibal2.skyhanni.features.inventory.chocolatefactory +import at.hannibal2.skyhanni.api.event.HandleEvent import at.hannibal2.skyhanni.config.ConfigUpdaterMigrator import at.hannibal2.skyhanni.events.GuiRenderEvent import at.hannibal2.skyhanni.events.SecondPassedEvent @@ -187,7 +188,7 @@ object ChocolateFactoryStats { ) } - @SubscribeEvent + @HandleEvent fun onConfigFix(event: ConfigUpdaterMigrator.ConfigFixEvent) { event.transform(42, "event.chocolateFactory.statsDisplayList") { element -> addToDisplayList(element, "TIME_TOWER", "TIME_TO_PRESTIGE") diff --git a/src/main/java/at/hannibal2/skyhanni/features/inventory/chocolatefactory/ChocolateFactoryStrayTracker.kt b/src/main/java/at/hannibal2/skyhanni/features/inventory/chocolatefactory/ChocolateFactoryStrayTracker.kt index 22e2013f397d..53692ff22ddf 100644 --- a/src/main/java/at/hannibal2/skyhanni/features/inventory/chocolatefactory/ChocolateFactoryStrayTracker.kt +++ b/src/main/java/at/hannibal2/skyhanni/features/inventory/chocolatefactory/ChocolateFactoryStrayTracker.kt @@ -327,7 +327,7 @@ object ChocolateFactoryStrayTracker { return newElement } - @SubscribeEvent + @HandleEvent fun onConfigFix(event: ConfigUpdaterMigrator.ConfigFixEvent) { event.transform(58, "chocolateFactory.strayTracker.straysCaught") { element -> migrateJsonStringKeyToRarityKey(element, LorenzRarity::class.java) diff --git a/src/main/java/at/hannibal2/skyhanni/features/inventory/experimentationtable/GuardianReminder.kt b/src/main/java/at/hannibal2/skyhanni/features/inventory/experimentationtable/GuardianReminder.kt index 12cbcf659e28..237786a48c22 100644 --- a/src/main/java/at/hannibal2/skyhanni/features/inventory/experimentationtable/GuardianReminder.kt +++ b/src/main/java/at/hannibal2/skyhanni/features/inventory/experimentationtable/GuardianReminder.kt @@ -1,6 +1,7 @@ package at.hannibal2.skyhanni.features.inventory.experimentationtable 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.InventoryFullyOpenedEvent @@ -80,7 +81,7 @@ object GuardianReminder { GlStateManager.popMatrix() } - @SubscribeEvent + @HandleEvent fun onConfigFix(event: ConfigUpdaterMigrator.ConfigFixEvent) { event.move(59, "inventory.helper.enchanting.guardianReminder", "inventory.experimentationTable.guardianReminder") } diff --git a/src/main/java/at/hannibal2/skyhanni/features/inventory/experimentationtable/SuperpairsClicksAlert.kt b/src/main/java/at/hannibal2/skyhanni/features/inventory/experimentationtable/SuperpairsClicksAlert.kt index 379d3aa50a71..5ded459d4a6e 100644 --- a/src/main/java/at/hannibal2/skyhanni/features/inventory/experimentationtable/SuperpairsClicksAlert.kt +++ b/src/main/java/at/hannibal2/skyhanni/features/inventory/experimentationtable/SuperpairsClicksAlert.kt @@ -1,6 +1,7 @@ package at.hannibal2.skyhanni.features.inventory.experimentationtable import at.hannibal2.skyhanni.SkyHanniMod +import at.hannibal2.skyhanni.api.event.HandleEvent import at.hannibal2.skyhanni.config.ConfigUpdaterMigrator import at.hannibal2.skyhanni.events.InventoryOpenEvent import at.hannibal2.skyhanni.events.InventoryUpdatedEvent @@ -71,7 +72,7 @@ object SuperpairsClicksAlert { .filter { it.key < 45 } .any { it.value.stackSize > roundsNeeded } - @SubscribeEvent + @HandleEvent fun onConfigFix(event: ConfigUpdaterMigrator.ConfigFixEvent) { event.move(46, "misc.superpairsClicksAlert", "inventory.helper.enchanting.superpairsClicksAlert") diff --git a/src/main/java/at/hannibal2/skyhanni/features/inventory/experimentationtable/UltraRareBookAlert.kt b/src/main/java/at/hannibal2/skyhanni/features/inventory/experimentationtable/UltraRareBookAlert.kt index 5845b33536ec..5eb7d8dd60e7 100644 --- a/src/main/java/at/hannibal2/skyhanni/features/inventory/experimentationtable/UltraRareBookAlert.kt +++ b/src/main/java/at/hannibal2/skyhanni/features/inventory/experimentationtable/UltraRareBookAlert.kt @@ -1,6 +1,7 @@ package at.hannibal2.skyhanni.features.inventory.experimentationtable 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.InventoryCloseEvent @@ -84,7 +85,7 @@ object UltraRareBookAlert { enchantsFound = false } - @SubscribeEvent + @HandleEvent fun onConfigFix(event: ConfigUpdaterMigrator.ConfigFixEvent) { event.move(59, "inventory.helper.enchanting.ultraRareBookAlert", "inventory.experimentationTable.ultraRareBookAlert") } diff --git a/src/main/java/at/hannibal2/skyhanni/features/inventory/tiarelay/TiaRelayHelper.kt b/src/main/java/at/hannibal2/skyhanni/features/inventory/tiarelay/TiaRelayHelper.kt index 897d8bb03440..a366fa4737d5 100644 --- a/src/main/java/at/hannibal2/skyhanni/features/inventory/tiarelay/TiaRelayHelper.kt +++ b/src/main/java/at/hannibal2/skyhanni/features/inventory/tiarelay/TiaRelayHelper.kt @@ -141,7 +141,7 @@ object TiaRelayHelper { lastClickTime = SimpleTimeMark.now() } - @SubscribeEvent + @HandleEvent fun onConfigFix(event: ConfigUpdaterMigrator.ConfigFixEvent) { event.move(2, "misc.tiaRelayMute", "inventory.helper.tiaRelay.tiaRelayMute") event.move(2, "misc.tiaRelayHelper", "inventory.helper.tiaRelay.soundHelper") diff --git a/src/main/java/at/hannibal2/skyhanni/features/inventory/wardrobe/CustomWardrobe.kt b/src/main/java/at/hannibal2/skyhanni/features/inventory/wardrobe/CustomWardrobe.kt index 3e90b17f35d0..c463b380e99c 100644 --- a/src/main/java/at/hannibal2/skyhanni/features/inventory/wardrobe/CustomWardrobe.kt +++ b/src/main/java/at/hannibal2/skyhanni/features/inventory/wardrobe/CustomWardrobe.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.config.core.config.Position import at.hannibal2.skyhanni.events.ConfigLoadEvent import at.hannibal2.skyhanni.events.GuiContainerEvent @@ -125,8 +126,8 @@ object CustomWardrobe { } } - @SubscribeEvent - fun onConfigUpdate(event: ConfigLoadEvent) { + @HandleEvent + fun onConfigLoad(event: ConfigLoadEvent) { with(config.spacing) { ConditionalUtils.onToggle( globalScale, outlineThickness, outlineBlur, diff --git a/src/main/java/at/hannibal2/skyhanni/features/inventory/wardrobe/EstimatedWardrobePrice.kt b/src/main/java/at/hannibal2/skyhanni/features/inventory/wardrobe/EstimatedWardrobePrice.kt index 82acccf49874..bbb8ba3db86c 100644 --- a/src/main/java/at/hannibal2/skyhanni/features/inventory/wardrobe/EstimatedWardrobePrice.kt +++ b/src/main/java/at/hannibal2/skyhanni/features/inventory/wardrobe/EstimatedWardrobePrice.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.config.ConfigUpdaterMigrator import at.hannibal2.skyhanni.events.LorenzToolTipEvent import at.hannibal2.skyhanni.skyhannimodule.SkyHanniModule @@ -33,7 +34,7 @@ object EstimatedWardrobePrice { private fun isEnabled() = LorenzUtils.inSkyBlock && config.armor && WardrobeAPI.inWardrobe() && !WardrobeAPI.inCustomWardrobe - @SubscribeEvent + @HandleEvent fun onConfigFix(event: ConfigUpdaterMigrator.ConfigFixEvent) { event.move(3, "misc.estimatedIemValueArmor", "misc.estimatedItemValues.armor") } diff --git a/src/main/java/at/hannibal2/skyhanni/features/inventory/wardrobe/WardrobeAPI.kt b/src/main/java/at/hannibal2/skyhanni/features/inventory/wardrobe/WardrobeAPI.kt index 18371d6d6250..0cfbd9846add 100644 --- a/src/main/java/at/hannibal2/skyhanni/features/inventory/wardrobe/WardrobeAPI.kt +++ b/src/main/java/at/hannibal2/skyhanni/features/inventory/wardrobe/WardrobeAPI.kt @@ -1,5 +1,6 @@ package at.hannibal2.skyhanni.features.inventory.wardrobe +import at.hannibal2.skyhanni.api.event.HandleEvent import at.hannibal2.skyhanni.data.ProfileStorageData import at.hannibal2.skyhanni.events.DebugDataCollectEvent import at.hannibal2.skyhanni.events.InventoryCloseEvent @@ -179,8 +180,8 @@ object WardrobeAPI { } } - @SubscribeEvent - fun onDebugCollect(event: DebugDataCollectEvent) { + @HandleEvent + fun onDebug(event: DebugDataCollectEvent) { event.title("Wardrobe") event.addIrrelevant { for (slot in slots) { diff --git a/src/main/java/at/hannibal2/skyhanni/features/itemabilities/ChickenHeadTimer.kt b/src/main/java/at/hannibal2/skyhanni/features/itemabilities/ChickenHeadTimer.kt index be4af7d4b563..88fbe36bfa30 100644 --- a/src/main/java/at/hannibal2/skyhanni/features/itemabilities/ChickenHeadTimer.kt +++ b/src/main/java/at/hannibal2/skyhanni/features/itemabilities/ChickenHeadTimer.kt @@ -1,6 +1,7 @@ package at.hannibal2.skyhanni.features.itemabilities 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.LorenzChatEvent @@ -68,7 +69,7 @@ object ChickenHeadTimer { config.position.renderString(displayText, posLabel = "Chicken Head Timer") } - @SubscribeEvent + @HandleEvent fun onConfigFix(event: ConfigUpdaterMigrator.ConfigFixEvent) { event.move(2, "misc.chickenHeadTimerHideChat", "itemAbilities.chickenHead.hideChat") event.move(2, "misc.chickenHeadTimerPosition", "itemAbilities.chickenHead.position") diff --git a/src/main/java/at/hannibal2/skyhanni/features/itemabilities/FireVeilWandParticles.kt b/src/main/java/at/hannibal2/skyhanni/features/itemabilities/FireVeilWandParticles.kt index 8fc6f3349c12..58ea560393a2 100644 --- a/src/main/java/at/hannibal2/skyhanni/features/itemabilities/FireVeilWandParticles.kt +++ b/src/main/java/at/hannibal2/skyhanni/features/itemabilities/FireVeilWandParticles.kt @@ -62,7 +62,7 @@ object FireVeilWandParticles { RenderUtils.drawCircle(Minecraft.getMinecraft().thePlayer, event.partialTicks, 3.5, color) } - @SubscribeEvent + @HandleEvent fun onConfigFix(event: ConfigUpdaterMigrator.ConfigFixEvent) { event.move(3, "itemAbilities.fireVeilWandDisplayColor", "itemAbilities.fireVeilWands.displayColor") event.move(3, "itemAbilities.fireVeilWandDisplay", "itemAbilities.fireVeilWands.display") 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 943292379228..8145d090d541 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 @@ -415,7 +415,7 @@ object ItemAbilityCooldown { } } - @SubscribeEvent + @HandleEvent fun onConfigFix(event: ConfigUpdaterMigrator.ConfigFixEvent) { event.move(31, "itemAbilities", "inventory.itemAbilities") } 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 674d2f413bec..248035f7da77 100644 --- a/src/main/java/at/hannibal2/skyhanni/features/mining/DeepCavernsGuide.kt +++ b/src/main/java/at/hannibal2/skyhanni/features/mining/DeepCavernsGuide.kt @@ -80,7 +80,7 @@ object DeepCavernsGuide { updateConfig() } - @SubscribeEvent + @HandleEvent fun onConfigLoad(event: ConfigLoadEvent) { ConditionalUtils.onToggle(config.rainbowColor, config.monochromeColor, config.lookAhead) { updateConfig() @@ -170,7 +170,7 @@ object DeepCavernsGuide { fun isEnabled() = IslandType.DEEP_CAVERNS.isInIsland() && config.enabled - @SubscribeEvent + @HandleEvent fun onConfigFix(event: ConfigUpdaterMigrator.ConfigFixEvent) { event.move(38, "mining.deepCavernsParkour", "mining.deepCavernsGuide") } 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 c2445ddc0f18..177f6129a3a4 100644 --- a/src/main/java/at/hannibal2/skyhanni/features/mining/HighlightMiningCommissionMobs.kt +++ b/src/main/java/at/hannibal2/skyhanni/features/mining/HighlightMiningCommissionMobs.kt @@ -103,7 +103,7 @@ object HighlightMiningCommissionMobs { } } - @SubscribeEvent + @HandleEvent fun onConfigFix(event: ConfigUpdaterMigrator.ConfigFixEvent) { event.move(2, "misc.mining", "mining") } 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 4e3b6ed7e45a..78cf3a2fcbfb 100644 --- a/src/main/java/at/hannibal2/skyhanni/features/mining/MiningCommissionsBlocksColor.kt +++ b/src/main/java/at/hannibal2/skyhanni/features/mining/MiningCommissionsBlocksColor.kt @@ -130,8 +130,8 @@ object MiningCommissionsBlocksColor { } } - @SubscribeEvent - fun onConfigReload(event: ConfigLoadEvent) { + @HandleEvent + fun onConfigLoad(event: ConfigLoadEvent) { color = config.color.get().toDyeColor() config.sneakQuickToggle.onToggle { oldSneakState = false @@ -152,8 +152,8 @@ object MiningCommissionsBlocksColor { replaceBlocksMapCache = mutableMapOf() } - @SubscribeEvent - fun onDebugDataCollect(event: DebugDataCollectEvent) { + @HandleEvent + fun onDebug(event: DebugDataCollectEvent) { event.title("Mining Commissions Blocks Color") if (!enabled) { event.addIrrelevant("not enabled") 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 43f8e97d2326..282ae9d43b1f 100644 --- a/src/main/java/at/hannibal2/skyhanni/features/mining/MiningNotifications.kt +++ b/src/main/java/at/hannibal2/skyhanni/features/mining/MiningNotifications.kt @@ -98,7 +98,7 @@ object MiningNotifications { hasSentAscensionRope = false } - @SubscribeEvent + @HandleEvent fun onConfigLoad(event: ConfigLoadEvent) { ConditionalUtils.onToggle(config.coldThreshold) { if (MiningAPI.cold != config.coldThreshold.get()) hasSentCold = false 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 a8365a6eaaa8..b8c9c9df6b8c 100644 --- a/src/main/java/at/hannibal2/skyhanni/features/mining/TunnelsMaps.kt +++ b/src/main/java/at/hannibal2/skyhanni/features/mining/TunnelsMaps.kt @@ -13,12 +13,12 @@ import at.hannibal2.skyhanni.events.InventoryCloseEvent import at.hannibal2.skyhanni.events.InventoryFullyOpenedEvent import at.hannibal2.skyhanni.events.IslandChangeEvent import at.hannibal2.skyhanni.events.ItemClickEvent -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.RepositoryReloadEvent import at.hannibal2.skyhanni.events.SkyHanniWarpEvent +import at.hannibal2.skyhanni.events.minecraft.KeyPressEvent import at.hannibal2.skyhanni.skyhannimodule.SkyHanniModule import at.hannibal2.skyhanni.test.command.ErrorManager import at.hannibal2.skyhanni.utils.CollectionUtils.addString @@ -256,7 +256,7 @@ object TunnelsMaps { } } - @SubscribeEvent + @HandleEvent fun onConfigLoad(event: ConfigLoadEvent) { onToggle( config.compactGemstone, @@ -477,8 +477,8 @@ object TunnelsMaps { null } ?: config.pathColour.toSpecialColor() - @SubscribeEvent - fun onKeyPress(event: LorenzKeyPressEvent) { + @HandleEvent + fun onKeyPress(event: KeyPressEvent) { if (!isEnabled()) return if (Minecraft.getMinecraft().currentScreen != null) return campfireKey(event) @@ -493,7 +493,7 @@ object TunnelsMaps { nextSpot() } - private fun campfireKey(event: LorenzKeyPressEvent) { + private fun campfireKey(event: KeyPressEvent) { if (event.keyCode != config.campfireKey) return if (config.travelScroll) { HypixelCommands.warp("basecamp") @@ -523,7 +523,7 @@ object TunnelsMaps { private var nextSpotDelay = SimpleTimeMark.farPast() - private fun nextSpotKey(event: LorenzKeyPressEvent) { + private fun nextSpotKey(event: KeyPressEvent) { if (event.keyCode != config.nextSpotHotkey) return nextSpot() } diff --git a/src/main/java/at/hannibal2/skyhanni/features/mining/eventtracker/MiningEventDisplay.kt b/src/main/java/at/hannibal2/skyhanni/features/mining/eventtracker/MiningEventDisplay.kt index 990efb478818..6868a651241f 100644 --- a/src/main/java/at/hannibal2/skyhanni/features/mining/eventtracker/MiningEventDisplay.kt +++ b/src/main/java/at/hannibal2/skyhanni/features/mining/eventtracker/MiningEventDisplay.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.ConfigUpdaterMigrator import at.hannibal2.skyhanni.config.enums.OutsideSbFeature import at.hannibal2.skyhanni.config.features.mining.MiningEventConfig @@ -129,7 +130,7 @@ object MiningEventDisplay { return (isOnValidMiningLocation || OutsideSbFeature.MINING_EVENT_DISPLAY.isSelected()) && config.enabled } - @SubscribeEvent + @HandleEvent fun onConfigFix(event: ConfigUpdaterMigrator.ConfigFixEvent) { event.transform(46, "mining.miningEvent.compressedFormat") { ConfigUtils.migrateBooleanToEnum(it, CompressFormat.COMPACT_TEXT, CompressFormat.DEFAULT) 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 54865161f225..885f2ec6bcc8 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 @@ -251,7 +251,7 @@ object MiningEventTracker { } } - @SubscribeEvent + @HandleEvent fun onConfigFix(event: ConfigUpdaterMigrator.ConfigFixEvent) { event.transform(29, "mining.miningEvent.showType") { element -> if (element.asString == "BOTH") JsonPrimitive("ALL") else element diff --git a/src/main/java/at/hannibal2/skyhanni/features/mining/fossilexcavator/solver/FossilSolverDisplay.kt b/src/main/java/at/hannibal2/skyhanni/features/mining/fossilexcavator/solver/FossilSolverDisplay.kt index 85d3041c77fa..b4f0f472e6e4 100644 --- a/src/main/java/at/hannibal2/skyhanni/features/mining/fossilexcavator/solver/FossilSolverDisplay.kt +++ b/src/main/java/at/hannibal2/skyhanni/features/mining/fossilexcavator/solver/FossilSolverDisplay.kt @@ -220,7 +220,7 @@ object FossilSolverDisplay { config.position.renderStrings(displayList, posLabel = "Fossil Excavator Solver") } - @SubscribeEvent + @HandleEvent fun onConfigFix(event: ConfigUpdaterMigrator.ConfigFixEvent) { event.move(36, "mining.fossilExcavator", "mining.fossilExcavator2.solver") event.move(37, "mining.fossilExcavator2", "mining.fossilExcavator") diff --git a/src/main/java/at/hannibal2/skyhanni/features/mining/glacitemineshaft/MineshaftWaypoints.kt b/src/main/java/at/hannibal2/skyhanni/features/mining/glacitemineshaft/MineshaftWaypoints.kt index 4f8b11101581..9909f4d99f85 100644 --- a/src/main/java/at/hannibal2/skyhanni/features/mining/glacitemineshaft/MineshaftWaypoints.kt +++ b/src/main/java/at/hannibal2/skyhanni/features/mining/glacitemineshaft/MineshaftWaypoints.kt @@ -5,9 +5,9 @@ import at.hannibal2.skyhanni.api.event.HandleEvent import at.hannibal2.skyhanni.data.IslandType import at.hannibal2.skyhanni.data.PartyAPI import at.hannibal2.skyhanni.events.IslandChangeEvent -import at.hannibal2.skyhanni.events.LorenzKeyPressEvent import at.hannibal2.skyhanni.events.LorenzRenderWorldEvent import at.hannibal2.skyhanni.events.LorenzWorldChangeEvent +import at.hannibal2.skyhanni.events.minecraft.KeyPressEvent import at.hannibal2.skyhanni.skyhannimodule.SkyHanniModule import at.hannibal2.skyhanni.utils.HypixelCommands import at.hannibal2.skyhanni.utils.LocationUtils.distanceToPlayer @@ -58,8 +58,8 @@ object MineshaftWaypoints { } } - @SubscribeEvent - fun onKeyPress(event: LorenzKeyPressEvent) { + @HandleEvent + fun onKeyPress(event: KeyPressEvent) { if (Minecraft.getMinecraft().currentScreen != null) return if (event.keyCode != config.shareWaypointLocation) return if (timeLastShared.passedSince() < 500.milliseconds) return diff --git a/src/main/java/at/hannibal2/skyhanni/features/mining/powdertracker/PowderTracker.kt b/src/main/java/at/hannibal2/skyhanni/features/mining/powdertracker/PowderTracker.kt index 240464944fb0..573e02b17900 100644 --- a/src/main/java/at/hannibal2/skyhanni/features/mining/powdertracker/PowderTracker.kt +++ b/src/main/java/at/hannibal2/skyhanni/features/mining/powdertracker/PowderTracker.kt @@ -223,7 +223,7 @@ object PowderTracker { } } - @SubscribeEvent + @HandleEvent fun onConfigLoad(event: ConfigLoadEvent) { config.textFormat.afterChange { tracker.update() @@ -256,7 +256,7 @@ object PowderTracker { tracker.update() } - @SubscribeEvent + @HandleEvent fun onConfigFix(event: ConfigUpdaterMigrator.ConfigFixEvent) { event.move(2, "misc.powderTrackerConfig", "mining.powderTracker") event.transform(8, "#profile.powderTracker") { old -> old.asJsonObject.get("0") } 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 f3c5cb449ca3..251c82a16c04 100644 --- a/src/main/java/at/hannibal2/skyhanni/features/minion/MinionFeatures.kt +++ b/src/main/java/at/hannibal2/skyhanni/features/minion/MinionFeatures.kt @@ -429,7 +429,7 @@ object MinionFeatures { } } - @SubscribeEvent + @HandleEvent fun onConfigFix(event: ConfigUpdaterMigrator.ConfigFixEvent) { event.move(3, "minions.lastClickedMinionDisplay", "minions.lastClickedMinion.display") event.move(3, "minions.lastOpenedMinionColor", "minions.lastClickedMinion.color") diff --git a/src/main/java/at/hannibal2/skyhanni/features/misc/AuctionHousePriceComparison.kt b/src/main/java/at/hannibal2/skyhanni/features/misc/AuctionHousePriceComparison.kt index 6ee64373aebe..75b2d4d0ac4a 100644 --- a/src/main/java/at/hannibal2/skyhanni/features/misc/AuctionHousePriceComparison.kt +++ b/src/main/java/at/hannibal2/skyhanni/features/misc/AuctionHousePriceComparison.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.GuiContainerEvent import at.hannibal2.skyhanni.events.InventoryOpenEvent @@ -122,7 +123,7 @@ object AuctionHousePriceComparison { } } - @SubscribeEvent + @HandleEvent fun onConfigFix(event: ConfigUpdaterMigrator.ConfigFixEvent) { event.move(31, "inventory.auctionsPriceComparison", "inventory.auctions.auctionsPriceComparison") } diff --git a/src/main/java/at/hannibal2/skyhanni/features/misc/BetterSignEditing.kt b/src/main/java/at/hannibal2/skyhanni/features/misc/BetterSignEditing.kt index 096f7eeccd66..5078ba8e460e 100644 --- a/src/main/java/at/hannibal2/skyhanni/features/misc/BetterSignEditing.kt +++ b/src/main/java/at/hannibal2/skyhanni/features/misc/BetterSignEditing.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.LorenzTickEvent import at.hannibal2.skyhanni.mixins.transformers.AccessorGuiEditSign @@ -71,7 +72,7 @@ object BetterSignEditing { pasteLastClicked = pasteClicked } - @SubscribeEvent + @HandleEvent fun onConfigFix(event: ConfigUpdaterMigrator.ConfigFixEvent) { event.move(16, "misc.pasteIntoSigns", "misc.betterSignEditing") } diff --git a/src/main/java/at/hannibal2/skyhanni/features/misc/BetterWikiFromMenus.kt b/src/main/java/at/hannibal2/skyhanni/features/misc/BetterWikiFromMenus.kt index 3bfa54c7b841..3e61da76eed6 100644 --- a/src/main/java/at/hannibal2/skyhanni/features/misc/BetterWikiFromMenus.kt +++ b/src/main/java/at/hannibal2/skyhanni/features/misc/BetterWikiFromMenus.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.GuiContainerEvent import at.hannibal2.skyhanni.features.commands.WikiManager @@ -17,7 +18,7 @@ object BetterWikiFromMenus { private val config get() = SkyHanniMod.feature.misc.commands.betterWiki - @SubscribeEvent + @HandleEvent fun onConfigFix(event: ConfigUpdaterMigrator.ConfigFixEvent) { event.move(6, "fandomWiki", "commands.fandomWiki") } diff --git a/src/main/java/at/hannibal2/skyhanni/features/misc/ButtonOnPause.kt b/src/main/java/at/hannibal2/skyhanni/features/misc/ButtonOnPause.kt index 6060d2afb3f4..39a9af068efc 100644 --- a/src/main/java/at/hannibal2/skyhanni/features/misc/ButtonOnPause.kt +++ b/src/main/java/at/hannibal2/skyhanni/features/misc/ButtonOnPause.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.ConfigGuiManager import at.hannibal2.skyhanni.config.ConfigUpdaterMigrator import at.hannibal2.skyhanni.skyhannimodule.SkyHanniModule @@ -49,7 +50,7 @@ object ButtonOnPause { } } - @SubscribeEvent + @HandleEvent fun onConfigFix(event: ConfigUpdaterMigrator.ConfigFixEvent) { event.move(2, "misc.configButtonOnPause", "gui.configButtonOnPause") } diff --git a/src/main/java/at/hannibal2/skyhanni/features/misc/CustomTextBox.kt b/src/main/java/at/hannibal2/skyhanni/features/misc/CustomTextBox.kt index 8bbfbdb30256..8e79168c6186 100644 --- a/src/main/java/at/hannibal2/skyhanni/features/misc/CustomTextBox.kt +++ b/src/main/java/at/hannibal2/skyhanni/features/misc/CustomTextBox.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.config.enums.OutsideSbFeature import at.hannibal2.skyhanni.events.ConfigLoadEvent @@ -17,7 +18,7 @@ object CustomTextBox { private val config get() = SkyHanniMod.feature.gui.customTextBox private var display = listOf() - @SubscribeEvent + @HandleEvent fun onConfigLoad(event: ConfigLoadEvent) { display = config.text.get().format() @@ -47,7 +48,7 @@ object CustomTextBox { private fun isEnabled() = (LorenzUtils.inSkyBlock || OutsideSbFeature.CUSTOM_TEXT_BOX.isSelected()) && config.enabled - @SubscribeEvent + @HandleEvent fun onConfigFix(event: ConfigUpdaterMigrator.ConfigFixEvent) { event.move(2, "misc.textBox", "gui.customTextBox") } diff --git a/src/main/java/at/hannibal2/skyhanni/features/misc/HideArmor.kt b/src/main/java/at/hannibal2/skyhanni/features/misc/HideArmor.kt index 8d3cdac42877..8a6f7c0645a8 100644 --- a/src/main/java/at/hannibal2/skyhanni/features/misc/HideArmor.kt +++ b/src/main/java/at/hannibal2/skyhanni/features/misc/HideArmor.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.config.features.misc.HideArmorConfig.ModeEntry import at.hannibal2.skyhanni.events.SkyHanniRenderEntityEvent @@ -70,7 +71,7 @@ object HideArmor { } } - @SubscribeEvent + @HandleEvent fun onConfigFix(event: ConfigUpdaterMigrator.ConfigFixEvent) { event.transform(15, "misc.hideArmor2.mode") { element -> ConfigUtils.migrateIntToEnum(element, ModeEntry::class.java) diff --git a/src/main/java/at/hannibal2/skyhanni/features/misc/IslandAreas.kt b/src/main/java/at/hannibal2/skyhanni/features/misc/IslandAreas.kt index 8aabed587c05..c4bc07d5fefe 100644 --- a/src/main/java/at/hannibal2/skyhanni/features/misc/IslandAreas.kt +++ b/src/main/java/at/hannibal2/skyhanni/features/misc/IslandAreas.kt @@ -254,7 +254,7 @@ object IslandAreas { } } - @SubscribeEvent + @HandleEvent fun onConfigLoad(event: ConfigLoadEvent) { ConditionalUtils.onToggle(config.pathfinder.color) { targetNode?.let { diff --git a/src/main/java/at/hannibal2/skyhanni/features/misc/LockMouseLook.kt b/src/main/java/at/hannibal2/skyhanni/features/misc/LockMouseLook.kt index c84192a02b53..0be92291a287 100644 --- a/src/main/java/at/hannibal2/skyhanni/features/misc/LockMouseLook.kt +++ b/src/main/java/at/hannibal2/skyhanni/features/misc/LockMouseLook.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.events.DebugDataCollectEvent import at.hannibal2.skyhanni.events.GuiRenderEvent import at.hannibal2.skyhanni.events.LorenzChatEvent @@ -80,8 +81,8 @@ object LockMouseLook { } } - @SubscribeEvent - fun onDebugDataCollect(event: DebugDataCollectEvent) { + @HandleEvent + fun onDebug(event: DebugDataCollectEvent) { event.title("Mouse Lock") if (!lockedMouse) { diff --git a/src/main/java/at/hannibal2/skyhanni/features/misc/MarkedPlayerManager.kt b/src/main/java/at/hannibal2/skyhanni/features/misc/MarkedPlayerManager.kt index 4cf0cc3f937b..34323ffb9734 100644 --- a/src/main/java/at/hannibal2/skyhanni/features/misc/MarkedPlayerManager.kt +++ b/src/main/java/at/hannibal2/skyhanni/features/misc/MarkedPlayerManager.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.config.enums.OutsideSbFeature import at.hannibal2.skyhanni.events.ConfigLoadEvent @@ -92,7 +93,7 @@ object MarkedPlayerManager { return text } - @SubscribeEvent + @HandleEvent fun onConfigLoad(event: ConfigLoadEvent) { config.markOwnName.whenChanged { _, new -> val name = LorenzUtils.getPlayerName() @@ -127,7 +128,7 @@ object MarkedPlayerManager { } } - @SubscribeEvent + @HandleEvent fun onConfigFix(event: ConfigUpdaterMigrator.ConfigFixEvent) { event.move(31, "markedPlayers", "gui.markedPlayers") } diff --git a/src/main/java/at/hannibal2/skyhanni/features/misc/MiscFeatures.kt b/src/main/java/at/hannibal2/skyhanni/features/misc/MiscFeatures.kt index 98d4205256e0..726e565e873e 100644 --- a/src/main/java/at/hannibal2/skyhanni/features/misc/MiscFeatures.kt +++ b/src/main/java/at/hannibal2/skyhanni/features/misc/MiscFeatures.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.ReceiveParticleEvent import at.hannibal2.skyhanni.skyhannimodule.SkyHanniModule @@ -49,7 +50,7 @@ object MiscFeatures { } } - @SubscribeEvent + @HandleEvent fun onConfigFix(event: ConfigUpdaterMigrator.ConfigFixEvent) { event.move(2, "mobs", "combat.mobs") } 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 2fd181c8f494..888373c3f483 100644 --- a/src/main/java/at/hannibal2/skyhanni/features/misc/NoBitsWarning.kt +++ b/src/main/java/at/hannibal2/skyhanni/features/misc/NoBitsWarning.kt @@ -11,7 +11,6 @@ import at.hannibal2.skyhanni.utils.LorenzUtils import at.hannibal2.skyhanni.utils.NumberUtil.addSeparators import at.hannibal2.skyhanni.utils.SoundUtils import at.hannibal2.skyhanni.utils.SoundUtils.createSound -import net.minecraftforge.fml.common.eventhandler.SubscribeEvent import kotlin.time.Duration.Companion.seconds @SkyHanniModule @@ -39,7 +38,7 @@ object NoBitsWarning { } } - @SubscribeEvent + @HandleEvent fun onConfigFix(event: ConfigUpdaterMigrator.ConfigFixEvent) { event.move(35, "misc.noBitsWarning", "misc.noBitsWarning.enabled") event.move(40, "misc.noBitsWarning.enabled", "misc.bits.enableWarning") diff --git a/src/main/java/at/hannibal2/skyhanni/features/misc/NonGodPotEffectDisplay.kt b/src/main/java/at/hannibal2/skyhanni/features/misc/NonGodPotEffectDisplay.kt index 31efab14d9d4..5279bbc356d4 100644 --- a/src/main/java/at/hannibal2/skyhanni/features/misc/NonGodPotEffectDisplay.kt +++ b/src/main/java/at/hannibal2/skyhanni/features/misc/NonGodPotEffectDisplay.kt @@ -282,7 +282,7 @@ object NonGodPotEffectDisplay { ) } - @SubscribeEvent + @HandleEvent fun onConfigFix(event: ConfigUpdaterMigrator.ConfigFixEvent) { event.move(3, "misc.nonGodPotEffectDisplay", "misc.potionEffect.nonGodPotEffectDisplay") event.move(3, "misc.nonGodPotEffectShowMixins", "misc.potionEffect.nonGodPotEffectShowMixins") diff --git a/src/main/java/at/hannibal2/skyhanni/features/misc/ParticleHider.kt b/src/main/java/at/hannibal2/skyhanni/features/misc/ParticleHider.kt index c9ad14620610..bfbfeb3b99bf 100644 --- a/src/main/java/at/hannibal2/skyhanni/features/misc/ParticleHider.kt +++ b/src/main/java/at/hannibal2/skyhanni/features/misc/ParticleHider.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.ReceiveParticleEvent import at.hannibal2.skyhanni.features.dungeon.DungeonAPI @@ -45,7 +46,7 @@ object ParticleHider { } } - @SubscribeEvent + @HandleEvent fun onConfigFix(event: ConfigUpdaterMigrator.ConfigFixEvent) { event.move(3, "misc.hideBlazeParticles", "misc.particleHiders.hideBlazeParticles") event.move(3, "misc.hideEndermanParticles", "misc.particleHiders.hideEndermanParticles") diff --git a/src/main/java/at/hannibal2/skyhanni/features/misc/PatcherSendCoordinates.kt b/src/main/java/at/hannibal2/skyhanni/features/misc/PatcherSendCoordinates.kt index 5a0a2897fbac..82046eb7bde8 100644 --- a/src/main/java/at/hannibal2/skyhanni/features/misc/PatcherSendCoordinates.kt +++ b/src/main/java/at/hannibal2/skyhanni/features/misc/PatcherSendCoordinates.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.LorenzChatEvent import at.hannibal2.skyhanni.events.LorenzRenderWorldEvent @@ -98,7 +99,7 @@ object PatcherSendCoordinates { data class PatcherBeacon(val location: LorenzVec, val name: String, val time: Long) - @SubscribeEvent + @HandleEvent fun onConfigFix(event: ConfigUpdaterMigrator.ConfigFixEvent) { event.move(39, "misc.patcherSendCoordWaypoint", "misc.patcherCoordsWaypoint.enabled") } 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 d277c5797232..4b16c639e80e 100644 --- a/src/main/java/at/hannibal2/skyhanni/features/misc/PocketSackInASackDisplay.kt +++ b/src/main/java/at/hannibal2/skyhanni/features/misc/PocketSackInASackDisplay.kt @@ -56,7 +56,7 @@ object PocketSackInASackDisplay { } } - @SubscribeEvent + @HandleEvent fun onConfigFix(event: ConfigUpdaterMigrator.ConfigFixEvent) { event.move(31, "misc.pocketSackInASack", "inventory.pocketSackInASack") } diff --git a/src/main/java/at/hannibal2/skyhanni/features/misc/QuickModMenuSwitch.kt b/src/main/java/at/hannibal2/skyhanni/features/misc/QuickModMenuSwitch.kt index 9bbaa38ab15e..2eef9111c189 100644 --- a/src/main/java/at/hannibal2/skyhanni/features/misc/QuickModMenuSwitch.kt +++ b/src/main/java/at/hannibal2/skyhanni/features/misc/QuickModMenuSwitch.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.config.enums.OutsideSbFeature import at.hannibal2.skyhanni.data.jsonobjects.repo.ModGuiSwitcherJson @@ -164,7 +165,7 @@ object QuickModMenuSwitch { fun isEnabled() = (LorenzUtils.inSkyBlock || OutsideSbFeature.QUICK_MOD_MENU_SWITCH.isSelected()) && config.enabled - @SubscribeEvent + @HandleEvent fun onConfigFix(event: ConfigUpdaterMigrator.ConfigFixEvent) { event.move(3, "dev.modMenuLog", "dev.debug.modMenuLog") } diff --git a/src/main/java/at/hannibal2/skyhanni/features/misc/TimeFeatures.kt b/src/main/java/at/hannibal2/skyhanni/features/misc/TimeFeatures.kt index bf28ff0f85e9..be0e474156d4 100644 --- a/src/main/java/at/hannibal2/skyhanni/features/misc/TimeFeatures.kt +++ b/src/main/java/at/hannibal2/skyhanni/features/misc/TimeFeatures.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.config.enums.OutsideSbFeature import at.hannibal2.skyhanni.data.IslandType @@ -57,7 +58,7 @@ object TimeFeatures { } } - @SubscribeEvent + @HandleEvent fun onConfigFix(event: ConfigUpdaterMigrator.ConfigFixEvent) { event.move(2, "misc.timeConfigs.winterTime", "event.winter.islandCloseTime") event.move(2, "misc.timeConfigs.winterTimePos", "event.winter.islandCloseTimePosition") diff --git a/src/main/java/at/hannibal2/skyhanni/features/misc/TpsCounter.kt b/src/main/java/at/hannibal2/skyhanni/features/misc/TpsCounter.kt index 66973e288032..83899e1944c9 100644 --- a/src/main/java/at/hannibal2/skyhanni/features/misc/TpsCounter.kt +++ b/src/main/java/at/hannibal2/skyhanni/features/misc/TpsCounter.kt @@ -123,7 +123,7 @@ object TpsCounter { config.tpsDisplay && (LorenzUtils.inSkyBlock || OutsideSbFeature.TPS_DISPLAY.isSelected()) - @SubscribeEvent + @HandleEvent fun onConfigFix(event: ConfigUpdaterMigrator.ConfigFixEvent) { event.move(2, "misc.tpsDisplayEnabled", "gui.tpsDisplay") event.move(2, "misc.tpsDisplayPosition", "gui.tpsDisplayPosition") diff --git a/src/main/java/at/hannibal2/skyhanni/features/misc/compacttablist/AdvancedPlayerList.kt b/src/main/java/at/hannibal2/skyhanni/features/misc/compacttablist/AdvancedPlayerList.kt index 15556a5281c3..856677cd2c2c 100644 --- a/src/main/java/at/hannibal2/skyhanni/features/misc/compacttablist/AdvancedPlayerList.kt +++ b/src/main/java/at/hannibal2/skyhanni/features/misc/compacttablist/AdvancedPlayerList.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.config.features.misc.compacttablist.AdvancedPlayerListConfig.PlayerSortEntry import at.hannibal2.skyhanni.data.FriendAPI @@ -22,7 +23,6 @@ import at.hannibal2.skyhanni.utils.RegexUtils.matchMatcher import at.hannibal2.skyhanni.utils.StringUtils.removeColor import at.hannibal2.skyhanni.utils.TimeLimitedCache import at.hannibal2.skyhanni.utils.repopatterns.RepoPattern -import net.minecraftforge.fml.common.eventhandler.SubscribeEvent import java.util.regex.Matcher import kotlin.random.Random import kotlin.time.Duration.Companion.minutes @@ -256,7 +256,7 @@ object AdvancedPlayerList { constructor(icon: String, score: Int) : this({ icon }, score) } - @SubscribeEvent + @HandleEvent fun onConfigFix(event: ConfigUpdaterMigrator.ConfigFixEvent) { event.transform(15, "misc.compactTabList.advancedPlayerList.playerSortOrder") { element -> ConfigUtils.migrateIntToEnum(element, PlayerSortEntry::class.java) 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 816bb7699d79..421a5f954b24 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 @@ -14,7 +14,6 @@ import at.hannibal2.skyhanni.utils.StringUtils.removeSFormattingCode import at.hannibal2.skyhanni.utils.StringUtils.trimWhiteSpaceAndResets import at.hannibal2.skyhanni.utils.TabListData import at.hannibal2.skyhanni.utils.repopatterns.RepoPattern -import net.minecraftforge.fml.common.eventhandler.SubscribeEvent // heavily inspired by SBA code @SkyHanniModule @@ -277,7 +276,7 @@ object TabListReader { } } - @SubscribeEvent + @HandleEvent fun onConfigLoad(event: ConfigLoadEvent) { ConditionalUtils.onToggle(config.enabled) { updateTablistData() 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 4d9ae1762704..81e56c4283e2 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 @@ -220,7 +220,7 @@ object TabListRenderer { } } - @SubscribeEvent + @HandleEvent fun onConfigFix(event: ConfigUpdaterMigrator.ConfigFixEvent) { event.move(31, "misc.compactTabList", "gui.compactTabList") } diff --git a/src/main/java/at/hannibal2/skyhanni/features/misc/discordrpc/DiscordRPCManager.kt b/src/main/java/at/hannibal2/skyhanni/features/misc/discordrpc/DiscordRPCManager.kt index 29f20fc050ed..20ae7c37a96e 100644 --- a/src/main/java/at/hannibal2/skyhanni/features/misc/discordrpc/DiscordRPCManager.kt +++ b/src/main/java/at/hannibal2/skyhanni/features/misc/discordrpc/DiscordRPCManager.kt @@ -13,12 +13,12 @@ import at.hannibal2.skyhanni.data.HypixelData import at.hannibal2.skyhanni.data.jsonobjects.repo.StackingEnchantData import at.hannibal2.skyhanni.data.jsonobjects.repo.StackingEnchantsJson import at.hannibal2.skyhanni.events.ConfigLoadEvent -import at.hannibal2.skyhanni.events.LorenzKeyPressEvent import at.hannibal2.skyhanni.events.LorenzTickEvent import at.hannibal2.skyhanni.events.LorenzWorldChangeEvent import at.hannibal2.skyhanni.events.RepositoryReloadEvent import at.hannibal2.skyhanni.events.SecondPassedEvent import at.hannibal2.skyhanni.events.minecraft.ClientDisconnectEvent +import at.hannibal2.skyhanni.events.minecraft.KeyPressEvent import at.hannibal2.skyhanni.skyhannimodule.SkyHanniModule import at.hannibal2.skyhanni.test.command.ErrorManager import at.hannibal2.skyhanni.utils.ChatUtils @@ -98,7 +98,7 @@ object DiscordRPCManager : IPCListener { private fun isConnected() = client?.status == PipeStatus.CONNECTED - @SubscribeEvent + @HandleEvent fun onConfigLoad(event: ConfigLoadEvent) { ConditionalUtils.onToggle(config.firstLine, config.secondLine, config.customText) { if (isConnected()) { @@ -216,13 +216,13 @@ object DiscordRPCManager : IPCListener { } // Events that change things in DiscordStatus - @SubscribeEvent - fun onKeyClick(event: LorenzKeyPressEvent) { + @HandleEvent + fun onKeyPress(event: KeyPressEvent) { if (!isEnabled() || !PriorityEntry.AFK.isSelected()) return // autoPriority 4 is dynamic afk beenAfkFor = SimpleTimeMark.now() } - @SubscribeEvent + @HandleEvent fun onConfigFix(event: ConfigUpdaterMigrator.ConfigFixEvent) { event.transform(11, "misc.discordRPC.firstLine") { element -> ConfigUtils.migrateIntToEnum(element, LineEntry::class.java) 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 6b9721e12754..c5bb3973b552 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 @@ -138,7 +138,7 @@ object EstimatedItemValue { cache.clear() } - @SubscribeEvent + @HandleEvent fun onConfigLoad(event: ConfigLoadEvent) { with(config) { ConditionalUtils.onToggle( @@ -247,7 +247,7 @@ object EstimatedItemValue { return newDisplay } - @SubscribeEvent + @HandleEvent fun onConfigFix(event: ConfigUpdaterMigrator.ConfigFixEvent) { event.move(3, "misc.estimatedIemValueEnabled", "misc.estimatedItemValues.enabled") event.move(3, "misc.estimatedItemValueHotkey", "misc.estimatedItemValues.hotkey") 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 824f4b3c7c48..8c1661739348 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 @@ -91,7 +91,7 @@ object EnchantParser { this.enchants = event.getConstant("Enchants") } - @SubscribeEvent + @HandleEvent fun onConfigLoad(event: ConfigLoadEvent) { // Add observers to config options that would need us to mark cache dirty ConditionalUtils.onToggle( 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 787140aab65c..d42d0fb0cc8c 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 @@ -138,7 +138,7 @@ object LimboTimeTracker { shownPB = false } - @SubscribeEvent + @HandleEvent fun onConfigFix(event: ConfigUpdaterMigrator.ConfigFixEvent) { event.move(27, oldPath = "misc.limboTimePB", newPath = "#player.personalBest") } @@ -169,8 +169,8 @@ object LimboTimeTracker { } } - @SubscribeEvent - fun onDebugDataCollect(event: DebugDataCollectEvent) { + @HandleEvent + fun onDebug(event: DebugDataCollectEvent) { event.title("Limbo") if (!inLimbo) { event.addIrrelevant("not in limbo") diff --git a/src/main/java/at/hannibal2/skyhanni/features/misc/pets/CurrentPetDisplay.kt b/src/main/java/at/hannibal2/skyhanni/features/misc/pets/CurrentPetDisplay.kt index 8c920f4b3e17..b07a921a945f 100644 --- a/src/main/java/at/hannibal2/skyhanni/features/misc/pets/CurrentPetDisplay.kt +++ b/src/main/java/at/hannibal2/skyhanni/features/misc/pets/CurrentPetDisplay.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.data.PetAPI import at.hannibal2.skyhanni.events.GuiRenderEvent @@ -90,7 +91,7 @@ object CurrentPetDisplay { config.displayPos.renderString(PetAPI.currentPet, posLabel = "Current Pet") } - @SubscribeEvent + @HandleEvent fun onConfigFix(event: ConfigUpdaterMigrator.ConfigFixEvent) { event.move(3, "misc.petDisplay", "misc.pets.display") event.move(9, "misc.petDisplayPos", "misc.pets.displayPos") 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 048864f1b4d6..df98bbcbd3c8 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 @@ -10,7 +10,6 @@ import at.hannibal2.skyhanni.utils.RenderUtils.drawSlotText import at.hannibal2.skyhanni.utils.SkyBlockItemModifierUtils.getMaxPetLevel import at.hannibal2.skyhanni.utils.SkyBlockItemModifierUtils.getPetCandyUsed import at.hannibal2.skyhanni.utils.SkyBlockItemModifierUtils.getPetLevel -import net.minecraftforge.fml.common.eventhandler.SubscribeEvent @SkyHanniModule object PetCandyUsedDisplay { @@ -37,7 +36,7 @@ object PetCandyUsedDisplay { event.drawSlotText(x, y, stackTip, .9f) } - @SubscribeEvent + @HandleEvent fun onConfigFix(event: ConfigUpdaterMigrator.ConfigFixEvent) { event.move(22, "misc.petCandyUsed", "misc.petCandy.showCandy") } diff --git a/src/main/java/at/hannibal2/skyhanni/features/misc/pets/PetExpTooltip.kt b/src/main/java/at/hannibal2/skyhanni/features/misc/pets/PetExpTooltip.kt index 7343f84df5e5..fd7306f6fbca 100644 --- a/src/main/java/at/hannibal2/skyhanni/features/misc/pets/PetExpTooltip.kt +++ b/src/main/java/at/hannibal2/skyhanni/features/misc/pets/PetExpTooltip.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.LorenzToolTipEvent import at.hannibal2.skyhanni.skyhannimodule.SkyHanniModule @@ -115,7 +116,7 @@ object PetExpTooltip { return Pair(maxLevel, maxXp) } - @SubscribeEvent + @HandleEvent fun onConfigFix(event: ConfigUpdaterMigrator.ConfigFixEvent) { event.move(3, "misc.petExperienceToolTip.petDisplay", "misc.pets.petExperienceToolTip.petDisplay") event.move(3, "misc.petExperienceToolTip.showAlways", "misc.pets.petExperienceToolTip.showAlways") diff --git a/src/main/java/at/hannibal2/skyhanni/features/misc/trevor/TrevorFeatures.kt b/src/main/java/at/hannibal2/skyhanni/features/misc/trevor/TrevorFeatures.kt index ec93e9a25b3d..c1cf24cd3d64 100644 --- a/src/main/java/at/hannibal2/skyhanni/features/misc/trevor/TrevorFeatures.kt +++ b/src/main/java/at/hannibal2/skyhanni/features/misc/trevor/TrevorFeatures.kt @@ -9,11 +9,11 @@ import at.hannibal2.skyhanni.data.Perk import at.hannibal2.skyhanni.events.CheckRenderEntityEvent import at.hannibal2.skyhanni.events.GuiRenderEvent import at.hannibal2.skyhanni.events.LorenzChatEvent -import at.hannibal2.skyhanni.events.LorenzKeyPressEvent import at.hannibal2.skyhanni.events.LorenzRenderWorldEvent import at.hannibal2.skyhanni.events.LorenzTickEvent import at.hannibal2.skyhanni.events.LorenzWorldChangeEvent import at.hannibal2.skyhanni.events.SecondPassedEvent +import at.hannibal2.skyhanni.events.minecraft.KeyPressEvent import at.hannibal2.skyhanni.mixins.hooks.RenderLivingEntityHelper import at.hannibal2.skyhanni.skyhannimodule.SkyHanniModule import at.hannibal2.skyhanni.utils.ColorUtils.addAlpha @@ -303,8 +303,8 @@ object TrevorFeatures { } } - @SubscribeEvent - fun onKeyClick(event: LorenzKeyPressEvent) { + @HandleEvent + fun onKeyPress(event: KeyPressEvent) { if (!onFarmingIsland()) return if (Minecraft.getMinecraft().currentScreen != null) return if (NEUItems.neuHasFocus()) return @@ -368,7 +368,7 @@ object TrevorFeatures { fun onFarmingIsland() = IslandType.THE_FARMING_ISLANDS.isInIsland() - @SubscribeEvent + @HandleEvent fun onConfigFix(event: ConfigUpdaterMigrator.ConfigFixEvent) { event.transform(11, "misc.trevorTheTrapper.textFormat") { element -> ConfigUtils.migrateIntArrayListToEnumArrayList(element, TrackerEntry::class.java) diff --git a/src/main/java/at/hannibal2/skyhanni/features/misc/update/UpdateManager.kt b/src/main/java/at/hannibal2/skyhanni/features/misc/update/UpdateManager.kt index 76ed7c14cd1e..e22395aebf09 100644 --- a/src/main/java/at/hannibal2/skyhanni/features/misc/update/UpdateManager.kt +++ b/src/main/java/at/hannibal2/skyhanni/features/misc/update/UpdateManager.kt @@ -1,6 +1,7 @@ package at.hannibal2.skyhanni.features.misc.update import at.hannibal2.skyhanni.SkyHanniMod +import at.hannibal2.skyhanni.api.event.HandleEvent import at.hannibal2.skyhanni.config.features.About.UpdateStream import at.hannibal2.skyhanni.events.ConfigLoadEvent import at.hannibal2.skyhanni.events.LorenzTickEvent @@ -43,7 +44,7 @@ object UpdateManager { return potentialUpdate?.update?.versionNumber?.asString } - @SubscribeEvent + @HandleEvent fun onConfigLoad(event: ConfigLoadEvent) { SkyHanniMod.feature.about.updateStream.onToggle { reset() diff --git a/src/main/java/at/hannibal2/skyhanni/features/nether/CrimsonMinibossRespawnTimer.kt b/src/main/java/at/hannibal2/skyhanni/features/nether/CrimsonMinibossRespawnTimer.kt index 3c5325697dbb..e876a66d4380 100644 --- a/src/main/java/at/hannibal2/skyhanni/features/nether/CrimsonMinibossRespawnTimer.kt +++ b/src/main/java/at/hannibal2/skyhanni/features/nether/CrimsonMinibossRespawnTimer.kt @@ -1,6 +1,7 @@ package at.hannibal2.skyhanni.features.nether import at.hannibal2.skyhanni.SkyHanniMod +import at.hannibal2.skyhanni.api.event.HandleEvent import at.hannibal2.skyhanni.data.IslandType import at.hannibal2.skyhanni.data.mob.MobData import at.hannibal2.skyhanni.events.DebugDataCollectEvent @@ -186,7 +187,7 @@ object CrimsonMinibossRespawnTimer { currentAreaBoss = null } - @SubscribeEvent + @HandleEvent fun onDebug(event: DebugDataCollectEvent) { event.title("Crimson Isle Miniboss") event.addIrrelevant { diff --git a/src/main/java/at/hannibal2/skyhanni/features/nether/SulphurSkitterBox.kt b/src/main/java/at/hannibal2/skyhanni/features/nether/SulphurSkitterBox.kt index eb7fb814523e..9d14063edac5 100644 --- a/src/main/java/at/hannibal2/skyhanni/features/nether/SulphurSkitterBox.kt +++ b/src/main/java/at/hannibal2/skyhanni/features/nether/SulphurSkitterBox.kt @@ -1,6 +1,7 @@ package at.hannibal2.skyhanni.features.nether 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.SulphurSkitterBoxConfig import at.hannibal2.skyhanni.data.IslandType @@ -111,7 +112,7 @@ object SulphurSkitterBox { fun isEnabled() = IslandType.CRIMSON_ISLE.isInIsland() && config.enabled && (!config.onlyWithRods || FishingAPI.holdingLavaRod) - @SubscribeEvent + @HandleEvent fun onConfigFix(event: ConfigUpdaterMigrator.ConfigFixEvent) { event.move(24, "crimsonIsle.sulphurSkitterBoxConfig", "fishing.trophyFishing.sulphurSkitterBox") } diff --git a/src/main/java/at/hannibal2/skyhanni/features/nether/ashfang/AshfangFreezeCooldown.kt b/src/main/java/at/hannibal2/skyhanni/features/nether/ashfang/AshfangFreezeCooldown.kt index 07cf723fa6f4..c0206963fb2b 100644 --- a/src/main/java/at/hannibal2/skyhanni/features/nether/ashfang/AshfangFreezeCooldown.kt +++ b/src/main/java/at/hannibal2/skyhanni/features/nether/ashfang/AshfangFreezeCooldown.kt @@ -1,5 +1,6 @@ package at.hannibal2.skyhanni.features.nether.ashfang +import at.hannibal2.skyhanni.api.event.HandleEvent import at.hannibal2.skyhanni.config.ConfigUpdaterMigrator import at.hannibal2.skyhanni.events.GuiRenderEvent import at.hannibal2.skyhanni.events.LorenzChatEvent @@ -45,7 +46,7 @@ object AshfangFreezeCooldown { fun isCurrentlyFrozen() = unfrozenTime.isInFuture() - @SubscribeEvent + @HandleEvent fun onConfigFix(event: ConfigUpdaterMigrator.ConfigFixEvent) { event.move(2, "ashfang.freezeCooldown", "crimsonIsle.ashfang.freezeCooldown") event.move(2, "ashfang.freezeCooldownPos", "crimsonIsle.ashfang.freezeCooldownPos") diff --git a/src/main/java/at/hannibal2/skyhanni/features/nether/ashfang/AshfangHider.kt b/src/main/java/at/hannibal2/skyhanni/features/nether/ashfang/AshfangHider.kt index a136fc56a7bd..e86ee7dda243 100644 --- a/src/main/java/at/hannibal2/skyhanni/features/nether/ashfang/AshfangHider.kt +++ b/src/main/java/at/hannibal2/skyhanni/features/nether/ashfang/AshfangHider.kt @@ -40,7 +40,7 @@ object AshfangHider { if (event.entity.getWholeInventory().any { it?.name == "Glowstone" }) event.cancel() } - @SubscribeEvent + @HandleEvent fun onConfigFix(event: ConfigUpdaterMigrator.ConfigFixEvent) { event.move(2, "ashfang.hideDamageSplash", "crimsonIsle.ashfang.hide.damageSplash") event.move(2, "ashfang.hideParticles", "crimsonIsle.ashfang.hide.particles") diff --git a/src/main/java/at/hannibal2/skyhanni/features/nether/ashfang/AshfangHighlights.kt b/src/main/java/at/hannibal2/skyhanni/features/nether/ashfang/AshfangHighlights.kt index 6c6107f0f4c4..ee74e92e9cd9 100644 --- a/src/main/java/at/hannibal2/skyhanni/features/nether/ashfang/AshfangHighlights.kt +++ b/src/main/java/at/hannibal2/skyhanni/features/nether/ashfang/AshfangHighlights.kt @@ -93,7 +93,7 @@ object AshfangHighlights { private fun getColorCode(distance: Double): String = ColorUtils.blendRGB(LorenzColor.GREEN.toColor(), LorenzColor.RED.toColor(), distance / MAX_DISTANCE).getExtendedColorCode() - @SubscribeEvent + @HandleEvent fun onConfigFix(event: ConfigUpdaterMigrator.ConfigFixEvent) { event.move(2, "ashfang.blazingSouls", "crimsonIsle.ashfang.blazingSouls.enabled") event.move(2, "ashfang.blazingSoulsColor", "crimsonIsle.ashfang.blazingSouls.color") diff --git a/src/main/java/at/hannibal2/skyhanni/features/nether/ashfang/AshfangManager.kt b/src/main/java/at/hannibal2/skyhanni/features/nether/ashfang/AshfangManager.kt index 13c7264851fe..c7b6d286b57a 100644 --- a/src/main/java/at/hannibal2/skyhanni/features/nether/ashfang/AshfangManager.kt +++ b/src/main/java/at/hannibal2/skyhanni/features/nether/ashfang/AshfangManager.kt @@ -1,6 +1,7 @@ package at.hannibal2.skyhanni.features.nether.ashfang 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.ashfang.AshfangConfig import at.hannibal2.skyhanni.data.IslandType @@ -83,7 +84,7 @@ object AshfangManager { lastSpawnTime = SimpleTimeMark.farPast() } - @SubscribeEvent + @HandleEvent fun onConfigFix(event: ConfigUpdaterMigrator.ConfigFixEvent) { event.move(2, "ashfang.nextResetCooldown", "crimsonIsle.ashfang.nextResetCooldown") event.move(2, "ashfang.highlightBlazes", "crimsonIsle.ashfang.highlightBlazes") diff --git a/src/main/java/at/hannibal2/skyhanni/features/nether/ashfang/AshfangNextResetCooldown.kt b/src/main/java/at/hannibal2/skyhanni/features/nether/ashfang/AshfangNextResetCooldown.kt index b77301edc06d..e515e73aceb6 100644 --- a/src/main/java/at/hannibal2/skyhanni/features/nether/ashfang/AshfangNextResetCooldown.kt +++ b/src/main/java/at/hannibal2/skyhanni/features/nether/ashfang/AshfangNextResetCooldown.kt @@ -1,5 +1,6 @@ package at.hannibal2.skyhanni.features.nether.ashfang +import at.hannibal2.skyhanni.api.event.HandleEvent import at.hannibal2.skyhanni.config.ConfigUpdaterMigrator import at.hannibal2.skyhanni.events.GuiRenderEvent import at.hannibal2.skyhanni.skyhannimodule.SkyHanniModule @@ -30,7 +31,7 @@ object AshfangNextResetCooldown { ) } - @SubscribeEvent + @HandleEvent fun onConfigFix(event: ConfigUpdaterMigrator.ConfigFixEvent) { event.move(2, "ashfang.nextResetCooldown", "crimsonIsle.ashfang.nextResetCooldown") event.move(2, "ashfang.nextResetCooldownPos", "crimsonIsle.ashfang.nextResetCooldownPos") 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 4566fcb560d5..04d0a5948155 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 @@ -77,13 +77,17 @@ class CrimsonIsleReputationHelper(skyHanniMod: SkyHanniMod) { update() } - @SubscribeEvent + @HandleEvent fun onConfigLoad(event: ConfigLoadEvent) { ProfileStorageData.profileSpecific?.crimsonIsle?.let { miniBossHelper.loadData(it) kuudraBossHelper.loadData(it) questHelper.load(it) } + + config.hideComplete.afterChange { + updateRender() + } } @HandleEvent @@ -117,13 +121,6 @@ class CrimsonIsleReputationHelper(skyHanniMod: SkyHanniMod) { } } - @SubscribeEvent - fun onConfigInit(event: ConfigLoadEvent) { - config.hideComplete.afterChange { - updateRender() - } - } - private fun updateRender() { val newList = mutableListOf>() @@ -169,7 +166,7 @@ class CrimsonIsleReputationHelper(skyHanniMod: SkyHanniMod) { return config.hotkey.isKeyHeld() } - @SubscribeEvent + @HandleEvent fun onConfigFix(event: ConfigUpdaterMigrator.ConfigFixEvent) { event.move(2, "misc.crimsonIsleReputationHelper", "crimsonIsle.reputationHelper.enabled") event.move(2, "misc.reputationHelperUseHotkey", "crimsonIsle.reputationHelper.useHotkey") diff --git a/src/main/java/at/hannibal2/skyhanni/features/nether/reputationhelper/dailyquest/DailyQuestHelper.kt b/src/main/java/at/hannibal2/skyhanni/features/nether/reputationhelper/dailyquest/DailyQuestHelper.kt index af85ffaa1d2c..0d57f11602af 100644 --- a/src/main/java/at/hannibal2/skyhanni/features/nether/reputationhelper/dailyquest/DailyQuestHelper.kt +++ b/src/main/java/at/hannibal2/skyhanni/features/nether/reputationhelper/dailyquest/DailyQuestHelper.kt @@ -97,7 +97,7 @@ class DailyQuestHelper(val reputationHelper: CrimsonIsleReputationHelper) { questLoader.checkInventory(event) } - @SubscribeEvent + @HandleEvent fun onConfigLoad(event: ConfigLoadEvent) { ConditionalUtils.onToggle(config.enabled) { if (IslandType.CRIMSON_ISLE.isInIsland()) { diff --git a/src/main/java/at/hannibal2/skyhanni/features/rift/area/colosseum/BlobbercystsHighlight.kt b/src/main/java/at/hannibal2/skyhanni/features/rift/area/colosseum/BlobbercystsHighlight.kt index b5fa2c225afb..da134901d0be 100644 --- a/src/main/java/at/hannibal2/skyhanni/features/rift/area/colosseum/BlobbercystsHighlight.kt +++ b/src/main/java/at/hannibal2/skyhanni/features/rift/area/colosseum/BlobbercystsHighlight.kt @@ -1,6 +1,7 @@ package at.hannibal2.skyhanni.features.rift.area.colosseum import at.hannibal2.skyhanni.SkyHanniMod +import at.hannibal2.skyhanni.api.event.HandleEvent import at.hannibal2.skyhanni.config.ConfigUpdaterMigrator import at.hannibal2.skyhanni.events.LorenzTickEvent import at.hannibal2.skyhanni.events.LorenzWorldChangeEvent @@ -51,7 +52,7 @@ object BlobbercystsHighlight { fun isEnabled() = RiftAPI.inRift() && config.highlightBlobbercysts && LorenzUtils.skyBlockArea == "Colosseum" - @SubscribeEvent + @HandleEvent fun onConfigFix(event: ConfigUpdaterMigrator.ConfigFixEvent) { event.move(9, "rift.area.colosseumConfig", "rift.area.colosseum") } diff --git a/src/main/java/at/hannibal2/skyhanni/features/rift/area/dreadfarm/RiftAgaricusCap.kt b/src/main/java/at/hannibal2/skyhanni/features/rift/area/dreadfarm/RiftAgaricusCap.kt index c777bb5bcc86..24555c2a0ae6 100644 --- a/src/main/java/at/hannibal2/skyhanni/features/rift/area/dreadfarm/RiftAgaricusCap.kt +++ b/src/main/java/at/hannibal2/skyhanni/features/rift/area/dreadfarm/RiftAgaricusCap.kt @@ -92,7 +92,7 @@ object RiftAgaricusCap { fun isEnabled() = RiftAPI.inRift() && inArea && config.agaricusCap - @SubscribeEvent + @HandleEvent fun onConfigFix(event: ConfigUpdaterMigrator.ConfigFixEvent) { event.move(9, "rift.area.dreadfarmConfig", "rift.area.dreadfarm") } diff --git a/src/main/java/at/hannibal2/skyhanni/features/rift/area/dreadfarm/RiftWiltedBerberisHelper.kt b/src/main/java/at/hannibal2/skyhanni/features/rift/area/dreadfarm/RiftWiltedBerberisHelper.kt index 88e7a371f4ec..604947024a15 100644 --- a/src/main/java/at/hannibal2/skyhanni/features/rift/area/dreadfarm/RiftWiltedBerberisHelper.kt +++ b/src/main/java/at/hannibal2/skyhanni/features/rift/area/dreadfarm/RiftWiltedBerberisHelper.kt @@ -145,7 +145,7 @@ object RiftWiltedBerberisHelper { } } - @SubscribeEvent + @HandleEvent fun onConfigFix(event: ConfigUpdaterMigrator.ConfigFixEvent) { event.move(60, "rift.area.dreadfarm.wiltedBerberis.hideparticles", "rift.area.dreadfarm.wiltedBerberis.hideParticles") } 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 311aa0b20ab3..74be91d60fdc 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 @@ -174,7 +174,7 @@ object LivingCaveDefenseBlocks { fun isEnabled() = RiftAPI.inRift() && config.enabled && RiftAPI.inLivingCave() - @SubscribeEvent + @HandleEvent fun onConfigFix(event: ConfigUpdaterMigrator.ConfigFixEvent) { event.move(9, "rift.area.livingCaveConfig", "rift.area.livingCave") } 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 2645ae0a790a..c502d1095799 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 @@ -183,7 +183,7 @@ object DanceRoomHelper { fun isEnabled() = RiftAPI.inRift() && config.enabled - @SubscribeEvent + @HandleEvent fun onConfigFix(event: ConfigUpdaterMigrator.ConfigFixEvent) { event.move(9, "rift.area.mirrorVerseConfig", "rift.area.mirrorverse") } diff --git a/src/main/java/at/hannibal2/skyhanni/features/rift/area/mirrorverse/RiftLavaMazeParkour.kt b/src/main/java/at/hannibal2/skyhanni/features/rift/area/mirrorverse/RiftLavaMazeParkour.kt index 8d20ba6c256d..afe8c615a7c8 100644 --- a/src/main/java/at/hannibal2/skyhanni/features/rift/area/mirrorverse/RiftLavaMazeParkour.kt +++ b/src/main/java/at/hannibal2/skyhanni/features/rift/area/mirrorverse/RiftLavaMazeParkour.kt @@ -55,7 +55,7 @@ object RiftLavaMazeParkour { } } - @SubscribeEvent + @HandleEvent fun onConfigLoad(event: ConfigLoadEvent) { ConditionalUtils.onToggle(config.rainbowColor, config.monochromeColor, config.lookAhead) { updateConfig() diff --git a/src/main/java/at/hannibal2/skyhanni/features/rift/area/mirrorverse/RiftUpsideDownParkour.kt b/src/main/java/at/hannibal2/skyhanni/features/rift/area/mirrorverse/RiftUpsideDownParkour.kt index b77e099222a2..d7a8060d24b0 100644 --- a/src/main/java/at/hannibal2/skyhanni/features/rift/area/mirrorverse/RiftUpsideDownParkour.kt +++ b/src/main/java/at/hannibal2/skyhanni/features/rift/area/mirrorverse/RiftUpsideDownParkour.kt @@ -54,7 +54,7 @@ object RiftUpsideDownParkour { } } - @SubscribeEvent + @HandleEvent fun onConfigLoad(event: ConfigLoadEvent) { ConditionalUtils.onToggle(config.rainbowColor, config.monochromeColor, config.lookAhead) { updateConfig() diff --git a/src/main/java/at/hannibal2/skyhanni/features/rift/area/mirrorverse/TubulatorParkour.kt b/src/main/java/at/hannibal2/skyhanni/features/rift/area/mirrorverse/TubulatorParkour.kt index f4d8cdaa63c6..d2419c0ec0dc 100644 --- a/src/main/java/at/hannibal2/skyhanni/features/rift/area/mirrorverse/TubulatorParkour.kt +++ b/src/main/java/at/hannibal2/skyhanni/features/rift/area/mirrorverse/TubulatorParkour.kt @@ -47,7 +47,7 @@ object TubulatorParkour { } } - @SubscribeEvent + @HandleEvent fun onConfigLoad(event: ConfigLoadEvent) { ConditionalUtils.onToggle(config.rainbowColor, config.monochromeColor, config.lookAhead) { updateConfig() 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 dc1ee79ac35c..c848880a7e32 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 @@ -55,8 +55,8 @@ object RiftBloodEffigies { private fun cleanMap() = (0..5).associateWith { SimpleTimeMark.farPast() } - @SubscribeEvent - fun onDebugDataCollect(event: DebugDataCollectEvent) { + @HandleEvent + fun onDebug(event: DebugDataCollectEvent) { event.title("Rift Blood Effigies") if (!isEnabled()) { @@ -164,7 +164,7 @@ object RiftBloodEffigies { fun isEnabled() = RiftAPI.inRift() && config.enabled && RiftAPI.inStillgoreChateau() - @SubscribeEvent + @HandleEvent fun onConfigFix(event: ConfigUpdaterMigrator.ConfigFixEvent) { event.move(9, "rift.area.stillgoreChateauConfig", "rift.area.stillgoreChateau") } diff --git a/src/main/java/at/hannibal2/skyhanni/features/rift/area/westvillage/RiftGunthersRace.kt b/src/main/java/at/hannibal2/skyhanni/features/rift/area/westvillage/RiftGunthersRace.kt index 0c8529f4b256..5786b6580332 100644 --- a/src/main/java/at/hannibal2/skyhanni/features/rift/area/westvillage/RiftGunthersRace.kt +++ b/src/main/java/at/hannibal2/skyhanni/features/rift/area/westvillage/RiftGunthersRace.kt @@ -78,7 +78,7 @@ object RiftGunthersRace { updateConfig() } - @SubscribeEvent + @HandleEvent fun onConfigLoad(event: ConfigLoadEvent) { ConditionalUtils.onToggle(config.rainbowColor, config.monochromeColor, config.lookAhead) { updateConfig() diff --git a/src/main/java/at/hannibal2/skyhanni/features/rift/area/westvillage/VerminHighlighter.kt b/src/main/java/at/hannibal2/skyhanni/features/rift/area/westvillage/VerminHighlighter.kt index 232b73dd219c..f84d2b8a80b4 100644 --- a/src/main/java/at/hannibal2/skyhanni/features/rift/area/westvillage/VerminHighlighter.kt +++ b/src/main/java/at/hannibal2/skyhanni/features/rift/area/westvillage/VerminHighlighter.kt @@ -1,5 +1,6 @@ package at.hannibal2.skyhanni.features.rift.area.westvillage +import at.hannibal2.skyhanni.api.event.HandleEvent import at.hannibal2.skyhanni.events.ConfigLoadEvent import at.hannibal2.skyhanni.events.LorenzTickEvent import at.hannibal2.skyhanni.features.rift.RiftAPI @@ -45,7 +46,7 @@ object VerminHighlighter { } } - @SubscribeEvent + @HandleEvent fun onConfigLoad(event: ConfigLoadEvent) { ConditionalUtils.onToggle(config.color) { // running setEntityColorWithNoHurtTime() again diff --git a/src/main/java/at/hannibal2/skyhanni/features/rift/area/westvillage/kloon/KloonHacking.kt b/src/main/java/at/hannibal2/skyhanni/features/rift/area/westvillage/kloon/KloonHacking.kt index d5e04fb63081..0f0fbe033764 100644 --- a/src/main/java/at/hannibal2/skyhanni/features/rift/area/westvillage/kloon/KloonHacking.kt +++ b/src/main/java/at/hannibal2/skyhanni/features/rift/area/westvillage/kloon/KloonHacking.kt @@ -1,5 +1,6 @@ package at.hannibal2.skyhanni.features.rift.area.westvillage.kloon +import at.hannibal2.skyhanni.api.event.HandleEvent import at.hannibal2.skyhanni.config.ConfigUpdaterMigrator import at.hannibal2.skyhanni.data.ProfileStorageData import at.hannibal2.skyhanni.events.GuiContainerEvent @@ -172,7 +173,7 @@ object KloonHacking { return closestTerminal } - @SubscribeEvent + @HandleEvent fun onConfigFix(event: ConfigUpdaterMigrator.ConfigFixEvent) { event.move(9, "rift.area.westVillageConfig", "rift.area.westVillage") } diff --git a/src/main/java/at/hannibal2/skyhanni/features/rift/area/wyldwoods/ShyCruxWarnings.kt b/src/main/java/at/hannibal2/skyhanni/features/rift/area/wyldwoods/ShyCruxWarnings.kt index 540fb3b816ef..8a13b4c2429b 100644 --- a/src/main/java/at/hannibal2/skyhanni/features/rift/area/wyldwoods/ShyCruxWarnings.kt +++ b/src/main/java/at/hannibal2/skyhanni/features/rift/area/wyldwoods/ShyCruxWarnings.kt @@ -1,5 +1,6 @@ package at.hannibal2.skyhanni.features.rift.area.wyldwoods +import at.hannibal2.skyhanni.api.event.HandleEvent import at.hannibal2.skyhanni.config.ConfigUpdaterMigrator import at.hannibal2.skyhanni.events.LorenzTickEvent import at.hannibal2.skyhanni.features.rift.RiftAPI @@ -28,7 +29,7 @@ object ShyCruxWarnings { } } - @SubscribeEvent + @HandleEvent fun onConfigFix(event: ConfigUpdaterMigrator.ConfigFixEvent) { event.move(9, "rift.area.wyldWoodsConfig", "rift.area.wyldWoods") } diff --git a/src/main/java/at/hannibal2/skyhanni/features/rift/everywhere/CruxTalismanDisplay.kt b/src/main/java/at/hannibal2/skyhanni/features/rift/everywhere/CruxTalismanDisplay.kt index a01dc53ef141..d4525fa963c7 100644 --- a/src/main/java/at/hannibal2/skyhanni/features/rift/everywhere/CruxTalismanDisplay.kt +++ b/src/main/java/at/hannibal2/skyhanni/features/rift/everywhere/CruxTalismanDisplay.kt @@ -1,5 +1,6 @@ package at.hannibal2.skyhanni.features.rift.everywhere +import at.hannibal2.skyhanni.api.event.HandleEvent import at.hannibal2.skyhanni.events.ConfigLoadEvent import at.hannibal2.skyhanni.events.GuiRenderEvent import at.hannibal2.skyhanni.events.SecondPassedEvent @@ -129,7 +130,7 @@ object CruxTalismanDisplay { update() } - @SubscribeEvent + @HandleEvent fun onConfigLoad(event: ConfigLoadEvent) { ConditionalUtils.onToggle(config.showBonuses) { update() } } diff --git a/src/main/java/at/hannibal2/skyhanni/features/rift/everywhere/PunchcardHighlight.kt b/src/main/java/at/hannibal2/skyhanni/features/rift/everywhere/PunchcardHighlight.kt index 5123b5d63f09..cb402a30337b 100644 --- a/src/main/java/at/hannibal2/skyhanni/features/rift/everywhere/PunchcardHighlight.kt +++ b/src/main/java/at/hannibal2/skyhanni/features/rift/everywhere/PunchcardHighlight.kt @@ -91,8 +91,8 @@ object PunchcardHighlight { } } - @SubscribeEvent - fun onToggle(event: ConfigLoadEvent) { + @HandleEvent + fun onConfigLoad(event: ConfigLoadEvent) { ConditionalUtils.onToggle( config.highlight, config.color, 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 9202f1130f07..84e5f905976b 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 @@ -111,7 +111,7 @@ object RiftTimer { changes[System.currentTimeMillis()] = diffFormat } - @SubscribeEvent + @HandleEvent fun onConfigLoad(event: ConfigLoadEvent) { ConditionalUtils.onToggle( config.percentage, diff --git a/src/main/java/at/hannibal2/skyhanni/features/rift/everywhere/motes/RiftMotesOrb.kt b/src/main/java/at/hannibal2/skyhanni/features/rift/everywhere/motes/RiftMotesOrb.kt index b81f3598532a..508680ef61bb 100644 --- a/src/main/java/at/hannibal2/skyhanni/features/rift/everywhere/motes/RiftMotesOrb.kt +++ b/src/main/java/at/hannibal2/skyhanni/features/rift/everywhere/motes/RiftMotesOrb.kt @@ -1,5 +1,6 @@ package at.hannibal2.skyhanni.features.rift.everywhere.motes +import at.hannibal2.skyhanni.api.event.HandleEvent import at.hannibal2.skyhanni.config.ConfigUpdaterMigrator import at.hannibal2.skyhanni.events.LorenzChatEvent import at.hannibal2.skyhanni.events.LorenzRenderWorldEvent @@ -102,7 +103,7 @@ object RiftMotesOrb { fun isEnabled() = RiftAPI.inRift() && config.enabled - @SubscribeEvent + @HandleEvent fun onConfigFix(event: ConfigUpdaterMigrator.ConfigFixEvent) { event.move(9, "rift.area.motesOrbsConfig", "rift.area.motesOrbs") } diff --git a/src/main/java/at/hannibal2/skyhanni/features/rift/everywhere/motes/ShowMotesNpcSellPrice.kt b/src/main/java/at/hannibal2/skyhanni/features/rift/everywhere/motes/ShowMotesNpcSellPrice.kt index 66f6ff438ed6..cebae05d0558 100644 --- a/src/main/java/at/hannibal2/skyhanni/features/rift/everywhere/motes/ShowMotesNpcSellPrice.kt +++ b/src/main/java/at/hannibal2/skyhanni/features/rift/everywhere/motes/ShowMotesNpcSellPrice.kt @@ -1,5 +1,6 @@ package at.hannibal2.skyhanni.features.rift.everywhere.motes +import at.hannibal2.skyhanni.api.event.HandleEvent import at.hannibal2.skyhanni.config.ConfigUpdaterMigrator import at.hannibal2.skyhanni.config.features.rift.motes.RiftInventoryValueConfig.NumberFormatEntry import at.hannibal2.skyhanni.events.GuiRenderEvent @@ -194,7 +195,7 @@ object ShowMotesNpcSellPrice { private fun isInventoryValueEnabled() = RiftAPI.inRift() && config.inventoryValue.enabled - @SubscribeEvent + @HandleEvent fun onConfigFix(event: ConfigUpdaterMigrator.ConfigFixEvent) { event.transform(15, "rift.motes.inventoryValue.formatType") { element -> ConfigUtils.migrateIntToEnum(element, NumberFormatEntry::class.java) 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 9cffee3156f6..281f550c1fe1 100644 --- a/src/main/java/at/hannibal2/skyhanni/features/skillprogress/SkillProgress.kt +++ b/src/main/java/at/hannibal2/skyhanni/features/skillprogress/SkillProgress.kt @@ -195,7 +195,7 @@ object SkillProgress { SoundUtils.createSound("random.levelup", 1f, 1f).playSound() } - @SubscribeEvent + @HandleEvent fun onConfigLoad(event: ConfigLoadEvent) { onToggle( config.enabled, 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 5e3eae25fbd9..446b927deea9 100644 --- a/src/main/java/at/hannibal2/skyhanni/features/slayer/SlayerProfitTracker.kt +++ b/src/main/java/at/hannibal2/skyhanni/features/slayer/SlayerProfitTracker.kt @@ -223,7 +223,7 @@ object SlayerProfitTracker { getTracker()?.renderDisplay(config.pos) } - @SubscribeEvent + @HandleEvent fun onConfigFix(event: ConfigUpdaterMigrator.ConfigFixEvent) { event.transform(10, "#profile.slayerProfitData") { old -> for (data in old.asJsonObject.entrySet().map { it.value.asJsonObject }) { diff --git a/src/main/java/at/hannibal2/skyhanni/features/slayer/VampireSlayerFeatures.kt b/src/main/java/at/hannibal2/skyhanni/features/slayer/VampireSlayerFeatures.kt index 2d56287adce3..8f33097f6a5b 100644 --- a/src/main/java/at/hannibal2/skyhanni/features/slayer/VampireSlayerFeatures.kt +++ b/src/main/java/at/hannibal2/skyhanni/features/slayer/VampireSlayerFeatures.kt @@ -349,7 +349,7 @@ object VampireSlayerFeatures { } } - @SubscribeEvent + @HandleEvent fun onConfigFix(event: ConfigUpdaterMigrator.ConfigFixEvent) { event.move(9, "slayer.vampireSlayerConfig", "slayer.vampire") } diff --git a/src/main/java/at/hannibal2/skyhanni/features/slayer/blaze/BlazeSlayerClearView.kt b/src/main/java/at/hannibal2/skyhanni/features/slayer/blaze/BlazeSlayerClearView.kt index 065331ec2939..777e5ba3de23 100644 --- a/src/main/java/at/hannibal2/skyhanni/features/slayer/blaze/BlazeSlayerClearView.kt +++ b/src/main/java/at/hannibal2/skyhanni/features/slayer/blaze/BlazeSlayerClearView.kt @@ -56,7 +56,7 @@ object BlazeSlayerClearView { return LorenzUtils.inSkyBlock && SkyHanniMod.feature.slayer.blazes.clearView && nearBlaze } - @SubscribeEvent + @HandleEvent fun onConfigFix(event: ConfigUpdaterMigrator.ConfigFixEvent) { event.move(3, "slayer.blazeClearView", "slayer.blazes.clearView") } 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 b32cc19ec1e8..1ee722c7a608 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 @@ -254,7 +254,7 @@ object BlazeSlayerDaggerHelper { config.positionBottom.renderString(textBottom, posLabel = "Blaze Slayer Dagger Bottom") } - @SubscribeEvent + @HandleEvent fun onConfigFix(event: ConfigUpdaterMigrator.ConfigFixEvent) { event.move(3, "slayer.blazeDaggers", "slayer.blazes.hellion.daggers") event.move(3, "slayer.blazeMarkRightHellionShield", "slayer.blazes.hellion.markRightHellionShield") 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 76eb9a0d19ff..9fb4590b4366 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 @@ -70,7 +70,7 @@ object BlazeSlayerFirePitsWarning { BossType.SLAYER_BLAZE_TYPHOEUS_4, ) - @SubscribeEvent + @HandleEvent fun onConfigFix(event: ConfigUpdaterMigrator.ConfigFixEvent) { event.move(3, "slayer.firePitsWarning", "slayer.blazes.firePitsWarning") } diff --git a/src/main/java/at/hannibal2/skyhanni/features/slayer/blaze/HellionShieldHelper.kt b/src/main/java/at/hannibal2/skyhanni/features/slayer/blaze/HellionShieldHelper.kt index 5dec7f92a5f1..b01e78736fe6 100644 --- a/src/main/java/at/hannibal2/skyhanni/features/slayer/blaze/HellionShieldHelper.kt +++ b/src/main/java/at/hannibal2/skyhanni/features/slayer/blaze/HellionShieldHelper.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.LorenzWorldChangeEvent import at.hannibal2.skyhanni.mixins.hooks.RenderLivingEntityHelper @@ -15,7 +16,7 @@ object HellionShieldHelper { val hellionShieldMobs = mutableMapOf() - @SubscribeEvent + @HandleEvent fun onConfigFix(event: ConfigUpdaterMigrator.ConfigFixEvent) { event.move(3, "slayer.blazeColoredMobs", "slayer.blazes.hellion.coloredMobs") } 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 f5bf6d707522..184f5a97adc6 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 @@ -243,7 +243,7 @@ object EndermanSlayerFeatures { logger.log("Reset everything (world change)") } - @SubscribeEvent + @HandleEvent fun onConfigFix(event: ConfigUpdaterMigrator.ConfigFixEvent) { event.move( 3, diff --git a/src/main/java/at/hannibal2/skyhanni/features/slayer/enderman/EndermanSlayerHideParticles.kt b/src/main/java/at/hannibal2/skyhanni/features/slayer/enderman/EndermanSlayerHideParticles.kt index 9a3c0aa1face..c3a0f99c3fad 100644 --- a/src/main/java/at/hannibal2/skyhanni/features/slayer/enderman/EndermanSlayerHideParticles.kt +++ b/src/main/java/at/hannibal2/skyhanni/features/slayer/enderman/EndermanSlayerHideParticles.kt @@ -1,6 +1,7 @@ package at.hannibal2.skyhanni.features.slayer.enderman 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.LorenzTickEvent @@ -50,7 +51,7 @@ object EndermanSlayerHideParticles { fun isEnabled() = IslandType.THE_END.isInIsland() && SkyHanniMod.feature.slayer.endermen.hideParticles - @SubscribeEvent + @HandleEvent fun onConfigFix(event: ConfigUpdaterMigrator.ConfigFixEvent) { event.move(3, "slayer.endermanHideParticles", "slayer.endermen.hideParticles") } diff --git a/src/main/java/at/hannibal2/skyhanni/features/stranded/HighlightPlaceableNpcs.kt b/src/main/java/at/hannibal2/skyhanni/features/stranded/HighlightPlaceableNpcs.kt index c57297607184..00a2d8049a72 100644 --- a/src/main/java/at/hannibal2/skyhanni/features/stranded/HighlightPlaceableNpcs.kt +++ b/src/main/java/at/hannibal2/skyhanni/features/stranded/HighlightPlaceableNpcs.kt @@ -1,6 +1,7 @@ package at.hannibal2.skyhanni.features.stranded import at.hannibal2.skyhanni.SkyHanniMod +import at.hannibal2.skyhanni.api.event.HandleEvent import at.hannibal2.skyhanni.config.ConfigUpdaterMigrator import at.hannibal2.skyhanni.events.GuiContainerEvent import at.hannibal2.skyhanni.events.InventoryCloseEvent @@ -73,7 +74,7 @@ object HighlightPlaceableNpcs { } } - @SubscribeEvent + @HandleEvent fun onConfigFix(event: ConfigUpdaterMigrator.ConfigFixEvent) { event.move(31, "stranded", "misc.stranded") } diff --git a/src/main/java/at/hannibal2/skyhanni/features/summonings/SummoningMobManager.kt b/src/main/java/at/hannibal2/skyhanni/features/summonings/SummoningMobManager.kt index 170b27f402c3..14b7031d1af6 100644 --- a/src/main/java/at/hannibal2/skyhanni/features/summonings/SummoningMobManager.kt +++ b/src/main/java/at/hannibal2/skyhanni/features/summonings/SummoningMobManager.kt @@ -1,6 +1,7 @@ package at.hannibal2.skyhanni.features.summonings import at.hannibal2.skyhanni.SkyHanniMod +import at.hannibal2.skyhanni.api.event.HandleEvent import at.hannibal2.skyhanni.config.ConfigUpdaterMigrator import at.hannibal2.skyhanni.data.mob.Mob import at.hannibal2.skyhanni.events.GuiRenderEvent @@ -132,7 +133,7 @@ object SummoningMobManager { config.summoningMobDisplayPos.renderRenderable(renderable, posLabel = "Summoning Mob Display") } - @SubscribeEvent + @HandleEvent fun onConfigFix(event: ConfigUpdaterMigrator.ConfigFixEvent) { event.move(2, "summonings", "combat.summonings") } diff --git a/src/main/java/at/hannibal2/skyhanni/test/DebugCommand.kt b/src/main/java/at/hannibal2/skyhanni/test/DebugCommand.kt index 5b1a48d069ae..ba6e10ba590e 100644 --- a/src/main/java/at/hannibal2/skyhanni/test/DebugCommand.kt +++ b/src/main/java/at/hannibal2/skyhanni/test/DebugCommand.kt @@ -45,7 +45,7 @@ object DebugCommand { profileName(event) profileType(event) - event.postAndCatch() + event.post() if (event.empty) { list.add("") diff --git a/src/main/java/at/hannibal2/skyhanni/test/HighlightMissingRepoItems.kt b/src/main/java/at/hannibal2/skyhanni/test/HighlightMissingRepoItems.kt index 04b9651c30c5..bbcf3a3787d2 100644 --- a/src/main/java/at/hannibal2/skyhanni/test/HighlightMissingRepoItems.kt +++ b/src/main/java/at/hannibal2/skyhanni/test/HighlightMissingRepoItems.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.GuiContainerEvent import at.hannibal2.skyhanni.skyhannimodule.SkyHanniModule @@ -45,7 +46,7 @@ object HighlightMissingRepoItems { } } - @SubscribeEvent + @HandleEvent fun onConfigFix(event: ConfigUpdaterMigrator.ConfigFixEvent) { event.move(3, "dev.highlightMissingRepo", "dev.debug.highlightMissingRepo") } diff --git a/src/main/java/at/hannibal2/skyhanni/test/ParkourWaypointSaver.kt b/src/main/java/at/hannibal2/skyhanni/test/ParkourWaypointSaver.kt index 89e7c8514a2e..479a04da60bd 100644 --- a/src/main/java/at/hannibal2/skyhanni/test/ParkourWaypointSaver.kt +++ b/src/main/java/at/hannibal2/skyhanni/test/ParkourWaypointSaver.kt @@ -1,8 +1,9 @@ package at.hannibal2.skyhanni.test import at.hannibal2.skyhanni.SkyHanniMod -import at.hannibal2.skyhanni.events.LorenzKeyPressEvent +import at.hannibal2.skyhanni.api.event.HandleEvent import at.hannibal2.skyhanni.events.LorenzRenderWorldEvent +import at.hannibal2.skyhanni.events.minecraft.KeyPressEvent import at.hannibal2.skyhanni.skyhannimodule.SkyHanniModule import at.hannibal2.skyhanni.utils.LorenzColor import at.hannibal2.skyhanni.utils.LorenzUtils @@ -25,8 +26,8 @@ object ParkourWaypointSaver { private var locations = mutableListOf() private var parkourHelper: ParkourHelper? = null - @SubscribeEvent - fun onKeyClick(event: LorenzKeyPressEvent) { + @HandleEvent + fun onKeyPress(event: KeyPressEvent) { if (!LorenzUtils.inSkyBlock && !config.parkourOutsideSB) return if (Minecraft.getMinecraft().currentScreen != null) return if (NEUItems.neuHasFocus()) return diff --git a/src/main/java/at/hannibal2/skyhanni/test/ShowItemUuid.kt b/src/main/java/at/hannibal2/skyhanni/test/ShowItemUuid.kt index f8c2029cf90d..5a845c7317c3 100644 --- a/src/main/java/at/hannibal2/skyhanni/test/ShowItemUuid.kt +++ b/src/main/java/at/hannibal2/skyhanni/test/ShowItemUuid.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.LorenzToolTipEvent import at.hannibal2.skyhanni.skyhannimodule.SkyHanniModule @@ -18,7 +19,7 @@ object ShowItemUuid { } } - @SubscribeEvent + @HandleEvent fun onConfigFix(event: ConfigUpdaterMigrator.ConfigFixEvent) { event.move(3, "dev.showItemUuid", "dev.debug.showItemUuid") } diff --git a/src/main/java/at/hannibal2/skyhanni/test/SkyHanniDebugsAndTests.kt b/src/main/java/at/hannibal2/skyhanni/test/SkyHanniDebugsAndTests.kt index fa14402b5c33..8f8f6cdf348c 100644 --- a/src/main/java/at/hannibal2/skyhanni/test/SkyHanniDebugsAndTests.kt +++ b/src/main/java/at/hannibal2/skyhanni/test/SkyHanniDebugsAndTests.kt @@ -634,7 +634,7 @@ object SkyHanniDebugsAndTests { // println("offset: $offset") } - @SubscribeEvent + @HandleEvent fun onConfigFix(event: ConfigUpdaterMigrator.ConfigFixEvent) { event.move(3, "dev.debugEnabled", "dev.debug.enabled") event.move(3, "dev.showInternalName", "dev.debug.showInternalName") diff --git a/src/main/java/at/hannibal2/skyhanni/test/TestCopyBestiaryValues.kt b/src/main/java/at/hannibal2/skyhanni/test/TestCopyBestiaryValues.kt index 4bf183d74fbf..4e50baac24ca 100644 --- a/src/main/java/at/hannibal2/skyhanni/test/TestCopyBestiaryValues.kt +++ b/src/main/java/at/hannibal2/skyhanni/test/TestCopyBestiaryValues.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.InventoryUpdatedEvent import at.hannibal2.skyhanni.skyhannimodule.SkyHanniModule @@ -112,7 +113,7 @@ object TestCopyBestiaryValues { SkyHanniDebugsAndTests.displayLine = "Bestiary for $titleName" } - @SubscribeEvent + @HandleEvent fun onConfigFix(event: ConfigUpdaterMigrator.ConfigFixEvent) { event.move(3, "dev.copyBestiaryData", "dev.debug.copyBestiaryData") } diff --git a/src/main/java/at/hannibal2/skyhanni/test/TestCopyRngMeterValues.kt b/src/main/java/at/hannibal2/skyhanni/test/TestCopyRngMeterValues.kt index 5121e342139c..0bd4e7f169af 100644 --- a/src/main/java/at/hannibal2/skyhanni/test/TestCopyRngMeterValues.kt +++ b/src/main/java/at/hannibal2/skyhanni/test/TestCopyRngMeterValues.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.ConfigManager import at.hannibal2.skyhanni.config.ConfigUpdaterMigrator import at.hannibal2.skyhanni.events.InventoryFullyOpenedEvent @@ -49,7 +50,7 @@ object TestCopyRngMeterValues { ChatUtils.debug("${map.size} items saved to clipboard.") } - @SubscribeEvent + @HandleEvent fun onConfigFix(event: ConfigUpdaterMigrator.ConfigFixEvent) { event.move(3, "dev.copyRngMeter", "dev.debug.copyRngMeter") } diff --git a/src/main/java/at/hannibal2/skyhanni/test/TestExportTools.kt b/src/main/java/at/hannibal2/skyhanni/test/TestExportTools.kt index 20c825cf2824..90907d60bcdf 100644 --- a/src/main/java/at/hannibal2/skyhanni/test/TestExportTools.kt +++ b/src/main/java/at/hannibal2/skyhanni/test/TestExportTools.kt @@ -18,7 +18,6 @@ import com.google.gson.GsonBuilder import com.google.gson.JsonElement import net.minecraft.item.ItemStack import net.minecraft.nbt.NBTTagCompound -import net.minecraftforge.fml.common.eventhandler.SubscribeEvent import java.io.InputStreamReader import java.io.Reader @@ -71,7 +70,7 @@ object TestExportTools { return fromJson(category, reader) } - @SubscribeEvent + @HandleEvent fun onConfigFix(event: ConfigUpdaterMigrator.ConfigFixEvent) { event.move(3, "dev.copyNBTDataCompressed", "dev.debug.copyNBTDataCompressed") event.move(4, "dev.debug.copyNBTData", "dev.debug.copyItemData") diff --git a/src/main/java/at/hannibal2/skyhanni/utils/ComputerEnvDebug.kt b/src/main/java/at/hannibal2/skyhanni/utils/ComputerEnvDebug.kt index ff792adcbb1f..4dfdb274ab11 100644 --- a/src/main/java/at/hannibal2/skyhanni/utils/ComputerEnvDebug.kt +++ b/src/main/java/at/hannibal2/skyhanni/utils/ComputerEnvDebug.kt @@ -1,17 +1,17 @@ package at.hannibal2.skyhanni.utils +import at.hannibal2.skyhanni.api.event.HandleEvent import at.hannibal2.skyhanni.events.DebugDataCollectEvent import at.hannibal2.skyhanni.skyhannimodule.SkyHanniModule import at.hannibal2.skyhanni.test.command.ErrorManager import at.hannibal2.skyhanni.utils.RegexUtils.matchMatcher import at.hannibal2.skyhanni.utils.system.PlatformUtils -import net.minecraftforge.fml.common.eventhandler.SubscribeEvent @SkyHanniModule object ComputerEnvDebug { - @SubscribeEvent - fun onDebugDataCollect(event: DebugDataCollectEvent) { + @HandleEvent + fun onDebug(event: DebugDataCollectEvent) { os(event) java(event) launcher(event) diff --git a/src/main/java/at/hannibal2/skyhanni/utils/ComputerTimeOffset.kt b/src/main/java/at/hannibal2/skyhanni/utils/ComputerTimeOffset.kt index 7e61c03c3751..7f12a4547be6 100644 --- a/src/main/java/at/hannibal2/skyhanni/utils/ComputerTimeOffset.kt +++ b/src/main/java/at/hannibal2/skyhanni/utils/ComputerTimeOffset.kt @@ -8,7 +8,6 @@ import at.hannibal2.skyhanni.skyhannimodule.SkyHanniModule import at.hannibal2.skyhanni.test.command.ErrorManager import at.hannibal2.skyhanni.utils.TimeUtils.format import kotlinx.coroutines.launch -import net.minecraftforge.fml.common.eventhandler.SubscribeEvent import org.apache.commons.net.ntp.NTPUDPClient import java.net.InetAddress import kotlin.concurrent.thread @@ -114,8 +113,8 @@ object ComputerTimeOffset { ) } - @SubscribeEvent - fun onDebugCollect(event: DebugDataCollectEvent) { + @HandleEvent + fun onDebug(event: DebugDataCollectEvent) { event.title("Time Offset") val offset = offsetMillis ?: run { event.addIrrelevant("not calculated yet") diff --git a/src/main/java/at/hannibal2/skyhanni/utils/ItemUtils.kt b/src/main/java/at/hannibal2/skyhanni/utils/ItemUtils.kt index 0b86be39b195..4bb28c0f2dd8 100644 --- a/src/main/java/at/hannibal2/skyhanni/utils/ItemUtils.kt +++ b/src/main/java/at/hannibal2/skyhanni/utils/ItemUtils.kt @@ -1,5 +1,6 @@ package at.hannibal2.skyhanni.utils +import at.hannibal2.skyhanni.api.event.HandleEvent import at.hannibal2.skyhanni.data.NotificationManager import at.hannibal2.skyhanni.data.PetAPI import at.hannibal2.skyhanni.data.SkyHanniNotification @@ -31,7 +32,6 @@ import net.minecraft.nbt.NBTTagCompound import net.minecraft.nbt.NBTTagList import net.minecraft.nbt.NBTTagString import net.minecraftforge.common.util.Constants -import net.minecraftforge.fml.common.eventhandler.SubscribeEvent import java.util.LinkedList import java.util.regex.Matcher import kotlin.time.Duration.Companion.INFINITE @@ -552,8 +552,8 @@ object ItemUtils { it.key.getPrice(priceSource, pastRecipes) * it.value }.sum() - @SubscribeEvent - fun onDebugDataCollect(event: DebugDataCollectEvent) { + @HandleEvent + fun onDebug(event: DebugDataCollectEvent) { event.title("Missing Repo Items") if (missingRepoItems.isNotEmpty()) { diff --git a/src/main/java/at/hannibal2/skyhanni/utils/KeyboardManager.kt b/src/main/java/at/hannibal2/skyhanni/utils/KeyboardManager.kt index 9c3b8e9b466f..47393b79e740 100644 --- a/src/main/java/at/hannibal2/skyhanni/utils/KeyboardManager.kt +++ b/src/main/java/at/hannibal2/skyhanni/utils/KeyboardManager.kt @@ -1,8 +1,8 @@ package at.hannibal2.skyhanni.utils import at.hannibal2.skyhanni.events.GuiKeyPressEvent -import at.hannibal2.skyhanni.events.LorenzKeyPressEvent import at.hannibal2.skyhanni.events.LorenzTickEvent +import at.hannibal2.skyhanni.events.minecraft.KeyPressEvent import at.hannibal2.skyhanni.skyhannimodule.SkyHanniModule import at.hannibal2.skyhanni.test.command.ErrorManager import io.github.notenoughupdates.moulconfig.gui.GuiScreenElementWrapper @@ -71,21 +71,21 @@ object KeyboardManager { if (Mouse.getEventButtonState() && Mouse.getEventButton() != -1) { val key = Mouse.getEventButton() - 100 - LorenzKeyPressEvent(key).postAndCatch() + KeyPressEvent(key).post() lastClickedMouseButton = key return } if (Keyboard.getEventKeyState() && Keyboard.getEventKey() != 0) { val key = Keyboard.getEventKey() - LorenzKeyPressEvent(key).postAndCatch() + KeyPressEvent(key).post() lastClickedMouseButton = -1 return } if (Mouse.getEventButton() == -1 && lastClickedMouseButton != -1) { if (lastClickedMouseButton.isKeyHeld()) { - LorenzKeyPressEvent(lastClickedMouseButton).postAndCatch() + KeyPressEvent(lastClickedMouseButton).post() return } lastClickedMouseButton = -1 @@ -93,7 +93,7 @@ object KeyboardManager { // This is needed because of other keyboards that don't have a key code for the key, but is read as a character if (Keyboard.getEventKey() == 0) { - LorenzKeyPressEvent(Keyboard.getEventCharacter().code + 256).postAndCatch() + KeyPressEvent(Keyboard.getEventCharacter().code + 256).post() } } diff --git a/src/main/java/at/hannibal2/skyhanni/utils/MinecraftConsoleFilter.kt b/src/main/java/at/hannibal2/skyhanni/utils/MinecraftConsoleFilter.kt index 19e912215df2..eb769bf3b4e7 100644 --- a/src/main/java/at/hannibal2/skyhanni/utils/MinecraftConsoleFilter.kt +++ b/src/main/java/at/hannibal2/skyhanni/utils/MinecraftConsoleFilter.kt @@ -1,9 +1,9 @@ package at.hannibal2.skyhanni.utils import at.hannibal2.skyhanni.SkyHanniMod +import at.hannibal2.skyhanni.api.event.HandleEvent import at.hannibal2.skyhanni.config.ConfigUpdaterMigrator import at.hannibal2.skyhanni.utils.RegexUtils.matchMatcher -import net.minecraftforge.fml.common.eventhandler.SubscribeEvent import org.apache.logging.log4j.Level import org.apache.logging.log4j.LogManager import org.apache.logging.log4j.Marker @@ -237,7 +237,7 @@ class MinecraftConsoleFilter(private val loggerConfigName: String) : AbstractFil return Filter.Result.ACCEPT } - @SubscribeEvent + @HandleEvent fun onConfigFix(event: ConfigUpdaterMigrator.ConfigFixEvent) { event.move(3, "dev.printUnfilteredDebugs", "dev.minecraftConsoles.printUnfilteredDebugs") event.move(3, "dev.logUnfilteredFile", "dev.minecraftConsoles.logUnfilteredFile") diff --git a/src/main/java/at/hannibal2/skyhanni/utils/repopatterns/RepoPatternManager.kt b/src/main/java/at/hannibal2/skyhanni/utils/repopatterns/RepoPatternManager.kt index 0ae922f55b7d..f6f18479e1e0 100644 --- a/src/main/java/at/hannibal2/skyhanni/utils/repopatterns/RepoPatternManager.kt +++ b/src/main/java/at/hannibal2/skyhanni/utils/repopatterns/RepoPatternManager.kt @@ -167,7 +167,7 @@ object RepoPatternManager { reloadPatterns() } - @SubscribeEvent + @HandleEvent fun onConfigLoad(event: ConfigLoadEvent) { config.forceLocal.afterChange { reloadPatterns() } }