From 2fbc41bfe1dfa6102d8fb803b325eaee57919240 Mon Sep 17 00:00:00 2001 From: calwolfson Date: Tue, 7 Jan 2025 16:17:46 +0100 Subject: [PATCH] repo events --- .../java/at/hannibal2/skyhanni/api/event/SkyHanniEvents.kt | 5 ++--- src/main/java/at/hannibal2/skyhanni/data/FameRanks.kt | 4 ++-- .../java/at/hannibal2/skyhanni/data/GardenCropMilestones.kt | 3 +-- .../skyhanni/data/GardenCropMilestonesCommunityFix.kt | 4 ++-- src/main/java/at/hannibal2/skyhanni/data/IslandGraphs.kt | 2 +- src/main/java/at/hannibal2/skyhanni/data/LocationFixData.kt | 5 ++--- src/main/java/at/hannibal2/skyhanni/data/MaxwellAPI.kt | 2 +- src/main/java/at/hannibal2/skyhanni/data/QuiverAPI.kt | 2 +- src/main/java/at/hannibal2/skyhanni/data/model/TabWidget.kt | 3 +-- .../java/at/hannibal2/skyhanni/data/repo/RepoManager.kt | 2 +- .../at/hannibal2/skyhanni/events/RepositoryReloadEvent.kt | 3 ++- .../java/at/hannibal2/skyhanni/features/bingo/BingoAPI.kt | 3 +-- .../skyhanni/features/chat/PowderMiningChatFilter.kt | 5 ++--- .../skyhanni/features/chat/playerchat/PlayerChatFilter.kt | 4 ++-- .../skyhanni/features/combat/ghosttracker/GhostTracker.kt | 2 +- .../features/commands/tabcomplete/PlayerTabComplete.kt | 3 +-- .../features/commands/tabcomplete/WarpTabComplete.kt | 3 +-- .../skyhanni/features/dungeon/DungeonsRaceGuide.kt | 2 +- .../skyhanni/features/event/diana/DianaProfitTracker.kt | 2 +- .../features/event/hoppity/HoppityCollectionStats.kt | 2 +- .../skyhanni/features/event/hoppity/HoppityEggLocations.kt | 2 +- .../skyhanni/features/event/hoppity/HoppityEventSummary.kt | 2 +- .../features/event/hoppity/HoppityTextureHandler.kt | 4 ++-- .../features/event/hoppity/ReplaceHoppityWithContributor.kt | 4 +--- .../event/lobby/waypoints/christmas/PresentWaypoints.kt | 3 ++- .../skyhanni/features/event/spook/TheGreatSpook.kt | 2 +- .../at/hannibal2/skyhanni/features/fishing/FishingAPI.kt | 2 +- .../skyhanni/features/fishing/SeaCreatureManager.kt | 3 ++- .../features/fishing/tracker/FishingProfitTracker.kt | 2 +- .../skyhanni/features/fishing/trophy/TrophyFishManager.kt | 3 +-- .../java/at/hannibal2/skyhanni/features/garden/GardenAPI.kt | 2 +- .../skyhanni/features/garden/composter/ComposterOverlay.kt | 2 +- .../features/garden/contest/FarmingPersonalBestGain.kt | 2 +- .../skyhanni/features/garden/farming/ArmorDropTracker.kt | 2 +- .../skyhanni/features/garden/farming/GardenCropSpeed.kt | 3 +-- .../features/garden/inventory/AnitaExtraFarmingFortune.kt | 2 +- .../features/garden/visitor/GardenVisitorColorNames.kt | 4 ++-- .../garden/visitor/HighlightVisitorsOutsideOfGarden.kt | 2 +- .../features/gui/customscoreboard/ScoreboardPattern.kt | 6 +++--- .../skyhanni/features/inventory/DojoRankDisplay.kt | 2 +- .../skyhanni/features/inventory/HideNotClickableItems.kt | 2 +- .../skyhanni/features/inventory/QuickCraftFeatures.kt | 3 ++- .../skyhanni/features/inventory/attribute/AttributeAPI.kt | 4 ++-- .../inventory/chocolatefactory/ChocolateFactoryAPI.kt | 3 +-- .../hannibal2/skyhanni/features/mining/DeepCavernsGuide.kt | 2 +- .../at/hannibal2/skyhanni/features/mining/TunnelsMaps.kt | 2 +- .../skyhanni/features/minion/InfernoMinionFeatures.kt | 2 +- .../java/at/hannibal2/skyhanni/features/minion/MinionXp.kt | 2 +- .../at/hannibal2/skyhanni/features/misc/CarryTracker.kt | 2 +- .../hannibal2/skyhanni/features/misc/ContributorManager.kt | 3 +-- .../hannibal2/skyhanni/features/misc/QuickModMenuSwitch.kt | 2 +- .../skyhanni/features/misc/ReplaceRomanNumerals.kt | 2 +- .../skyhanni/features/misc/discordrpc/DiscordRPCManager.kt | 2 +- .../skyhanni/features/misc/items/EstimatedItemValue.kt | 2 +- .../skyhanni/features/misc/items/enchants/EnchantParser.kt | 3 +-- .../nether/reputationhelper/CrimsonIsleReputationHelper.kt | 2 +- .../features/rift/area/dreadfarm/WoodenButtonsHelper.kt | 2 +- .../features/rift/area/mirrorverse/DanceRoomHelper.kt | 2 +- .../features/rift/area/mirrorverse/RiftLavaMazeParkour.kt | 2 +- .../features/rift/area/mirrorverse/RiftUpsideDownParkour.kt | 2 +- .../features/rift/area/mirrorverse/TubulatorParkour.kt | 2 +- .../rift/area/stillgorechateau/RiftBloodEffigies.kt | 2 +- .../features/rift/area/westvillage/RiftGunthersRace.kt | 2 +- .../features/rift/everywhere/EnigmaSoulWaypoints.kt | 2 +- .../skyhanni/features/slayer/SlayerProfitTracker.kt | 2 +- .../java/at/hannibal2/skyhanni/test/command/ErrorManager.kt | 4 ++-- src/main/java/at/hannibal2/skyhanni/utils/NEUItems.kt | 3 +-- .../java/at/hannibal2/skyhanni/utils/SkullTextureHolder.kt | 4 ++-- src/main/java/at/hannibal2/skyhanni/utils/TabListData.kt | 5 ++--- .../skyhanni/utils/repopatterns/RepoPatternManager.kt | 3 +-- 70 files changed, 88 insertions(+), 102 deletions(-) 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 dd7d60f3c9c1..a763f48957cc 100644 --- a/src/main/java/at/hannibal2/skyhanni/api/event/SkyHanniEvents.kt +++ b/src/main/java/at/hannibal2/skyhanni/api/event/SkyHanniEvents.kt @@ -6,7 +6,6 @@ import at.hannibal2.skyhanni.events.DebugDataCollectEvent import at.hannibal2.skyhanni.events.RepositoryReloadEvent import at.hannibal2.skyhanni.skyhannimodule.SkyHanniModule import at.hannibal2.skyhanni.utils.NumberUtil.addSeparators -import net.minecraftforge.fml.common.eventhandler.SubscribeEvent import java.lang.reflect.Method @SkyHanniModule @@ -46,8 +45,8 @@ object SkyHanniEvents { .addListener(method, instance, options) } - @SubscribeEvent - fun onRepoLoad(event: RepositoryReloadEvent) { + @HandleEvent + fun onRepoReload(event: RepositoryReloadEvent) { val data = event.getConstant("DisabledEvents") disabledHandlers = data.disabledHandlers disabledHandlerInvokers = data.disabledInvokers diff --git a/src/main/java/at/hannibal2/skyhanni/data/FameRanks.kt b/src/main/java/at/hannibal2/skyhanni/data/FameRanks.kt index 750f1294390e..a59830829ddc 100644 --- a/src/main/java/at/hannibal2/skyhanni/data/FameRanks.kt +++ b/src/main/java/at/hannibal2/skyhanni/data/FameRanks.kt @@ -1,9 +1,9 @@ package at.hannibal2.skyhanni.data +import at.hannibal2.skyhanni.api.event.HandleEvent import at.hannibal2.skyhanni.data.jsonobjects.repo.FameRankJson import at.hannibal2.skyhanni.events.RepositoryReloadEvent import at.hannibal2.skyhanni.skyhannimodule.SkyHanniModule -import net.minecraftforge.fml.common.eventhandler.SubscribeEvent @SkyHanniModule object FameRanks { @@ -12,7 +12,7 @@ object FameRanks { fun getFameRankByNameOrNull(name: String) = fameRanks[name] - @SubscribeEvent + @HandleEvent fun onRepoReload(event: RepositoryReloadEvent) { val ranks = event.getConstant("FameRank") fameRanks = ranks.fameRank.values.map { FameRank(it.name, it.fameRequired, it.bitsMultiplier, it.votes) } diff --git a/src/main/java/at/hannibal2/skyhanni/data/GardenCropMilestones.kt b/src/main/java/at/hannibal2/skyhanni/data/GardenCropMilestones.kt index ba103cf601dd..5db4fb8d18a3 100644 --- a/src/main/java/at/hannibal2/skyhanni/data/GardenCropMilestones.kt +++ b/src/main/java/at/hannibal2/skyhanni/data/GardenCropMilestones.kt @@ -16,7 +16,6 @@ import at.hannibal2.skyhanni.utils.SoundUtils import at.hannibal2.skyhanni.utils.SoundUtils.playSound import at.hannibal2.skyhanni.utils.repopatterns.RepoPattern import net.minecraft.item.ItemStack -import net.minecraftforge.fml.common.eventhandler.SubscribeEvent @SkyHanniModule object GardenCropMilestones { @@ -193,7 +192,7 @@ object GardenCropMilestones { return (progress - startCrops).toDouble() / (end - startCrops) } - @SubscribeEvent + @HandleEvent fun onRepoReload(event: RepositoryReloadEvent) { cropMilestoneData = event.getConstant("Garden").cropMilestones } diff --git a/src/main/java/at/hannibal2/skyhanni/data/GardenCropMilestonesCommunityFix.kt b/src/main/java/at/hannibal2/skyhanni/data/GardenCropMilestonesCommunityFix.kt index e2bf19e9fd7b..8990585d034a 100644 --- a/src/main/java/at/hannibal2/skyhanni/data/GardenCropMilestonesCommunityFix.kt +++ b/src/main/java/at/hannibal2/skyhanni/data/GardenCropMilestonesCommunityFix.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.jsonobjects.repo.GardenJson import at.hannibal2.skyhanni.events.RepositoryReloadEvent @@ -24,7 +25,6 @@ import at.hannibal2.skyhanni.utils.StringUtils.removeColor import at.hannibal2.skyhanni.utils.repopatterns.RepoPattern import kotlinx.coroutines.launch import net.minecraft.item.ItemStack -import net.minecraftforge.fml.common.eventhandler.SubscribeEvent @SkyHanniModule object GardenCropMilestonesCommunityFix { @@ -40,7 +40,7 @@ object GardenCropMilestonesCommunityFix { private var showWrongData = false private var showWhenAllCorrect = false - @SubscribeEvent + @HandleEvent fun onRepoReload(event: RepositoryReloadEvent) { val data = event.getConstant("Garden") val map = data.cropMilestoneCommunityHelp diff --git a/src/main/java/at/hannibal2/skyhanni/data/IslandGraphs.kt b/src/main/java/at/hannibal2/skyhanni/data/IslandGraphs.kt index b814f0a40af2..c0318b315c3f 100644 --- a/src/main/java/at/hannibal2/skyhanni/data/IslandGraphs.kt +++ b/src/main/java/at/hannibal2/skyhanni/data/IslandGraphs.kt @@ -135,7 +135,7 @@ object IslandGraphs { "Glacite Tunnels|Dwarven Base Camp|Great Glacite Lake|Fossil Research Center", ) - @SubscribeEvent + @HandleEvent fun onRepoReload(event: RepositoryReloadEvent) { if (!LorenzUtils.inSkyBlock) return diff --git a/src/main/java/at/hannibal2/skyhanni/data/LocationFixData.kt b/src/main/java/at/hannibal2/skyhanni/data/LocationFixData.kt index 8ec067deb926..662d09f3e1d5 100644 --- a/src/main/java/at/hannibal2/skyhanni/data/LocationFixData.kt +++ b/src/main/java/at/hannibal2/skyhanni/data/LocationFixData.kt @@ -1,12 +1,11 @@ package at.hannibal2.skyhanni.data +import at.hannibal2.skyhanni.api.event.HandleEvent import at.hannibal2.skyhanni.data.jsonobjects.repo.LocationFixJson import at.hannibal2.skyhanni.events.RepositoryReloadEvent import at.hannibal2.skyhanni.skyhannimodule.SkyHanniModule import at.hannibal2.skyhanni.utils.LocationUtils.isPlayerInside import net.minecraft.util.AxisAlignedBB -import net.minecraftforge.fml.common.eventhandler.EventPriority -import net.minecraftforge.fml.common.eventhandler.SubscribeEvent @SkyHanniModule object LocationFixData { @@ -16,7 +15,7 @@ object LocationFixData { private data class LocationFix(val area: AxisAlignedBB, val realLocation: String) // priority set to low so that IslandType can load their island names from repo earlier - @SubscribeEvent(priority = EventPriority.LOW) + @HandleEvent(priority = HandleEvent.LOW) fun onRepoReload(event: RepositoryReloadEvent) { val data = event.getConstant("LocationFix") locationFixes.clear() diff --git a/src/main/java/at/hannibal2/skyhanni/data/MaxwellAPI.kt b/src/main/java/at/hannibal2/skyhanni/data/MaxwellAPI.kt index 0dde33126c97..8332be80bffd 100644 --- a/src/main/java/at/hannibal2/skyhanni/data/MaxwellAPI.kt +++ b/src/main/java/at/hannibal2/skyhanni/data/MaxwellAPI.kt @@ -335,7 +335,7 @@ object MaxwellAPI { private fun isEnabled() = LorenzUtils.inSkyBlock && !LorenzUtils.isOnAlphaServer && storage != null // Load powers from repo - @SubscribeEvent + @HandleEvent fun onRepoReload(event: RepositoryReloadEvent) { val data = event.getConstant("MaxwellPowers") powers = data.powers diff --git a/src/main/java/at/hannibal2/skyhanni/data/QuiverAPI.kt b/src/main/java/at/hannibal2/skyhanni/data/QuiverAPI.kt index bc5f0e10a29f..d5c01b07fcc3 100644 --- a/src/main/java/at/hannibal2/skyhanni/data/QuiverAPI.kt +++ b/src/main/java/at/hannibal2/skyhanni/data/QuiverAPI.kt @@ -303,7 +303,7 @@ object QuiverAPI { } // Load arrows from repo - @SubscribeEvent + @HandleEvent fun onRepoReload(event: RepositoryReloadEvent) { val arrowData = event.getConstant("ArrowTypes") arrows = arrowData.arrows.map { ArrowType(it.value.arrow, it.key.toInternalName()) } diff --git a/src/main/java/at/hannibal2/skyhanni/data/model/TabWidget.kt b/src/main/java/at/hannibal2/skyhanni/data/model/TabWidget.kt index 43e9b699224f..62548207e9a5 100644 --- a/src/main/java/at/hannibal2/skyhanni/data/model/TabWidget.kt +++ b/src/main/java/at/hannibal2/skyhanni/data/model/TabWidget.kt @@ -16,7 +16,6 @@ import at.hannibal2.skyhanni.utils.RegexUtils.matchMatcher import at.hannibal2.skyhanni.utils.RegexUtils.matches import at.hannibal2.skyhanni.utils.TabListData import at.hannibal2.skyhanni.utils.repopatterns.RepoPattern -import net.minecraftforge.fml.common.eventhandler.EventPriority import net.minecraftforge.fml.common.eventhandler.SubscribeEvent import java.util.regex.Matcher import java.util.regex.Pattern @@ -445,7 +444,7 @@ enum class TabWidget( sentSinceWorldChange = false } - @SubscribeEvent(priority = EventPriority.LOW) + @HandleEvent(priority = HandleEvent.LOW) fun onRepoReload(event: RepositoryReloadEvent) { extraPatterns = repoGroup.getUnusedPatterns() } diff --git a/src/main/java/at/hannibal2/skyhanni/data/repo/RepoManager.kt b/src/main/java/at/hannibal2/skyhanni/data/repo/RepoManager.kt index 67f714bdd1fd..cf58465c7945 100644 --- a/src/main/java/at/hannibal2/skyhanni/data/repo/RepoManager.kt +++ b/src/main/java/at/hannibal2/skyhanni/data/repo/RepoManager.kt @@ -192,7 +192,7 @@ class RepoManager(private val configLocation: File) { unsuccessfulConstants.clear() lastConstant = null - RepositoryReloadEvent(repoLocation, gson).postAndCatchAndBlock(ignoreErrorCache = true) { + RepositoryReloadEvent(repoLocation, gson).post { error = true lastConstant?.let { unsuccessfulConstants.add(it) diff --git a/src/main/java/at/hannibal2/skyhanni/events/RepositoryReloadEvent.kt b/src/main/java/at/hannibal2/skyhanni/events/RepositoryReloadEvent.kt index ec5b0a8ec95e..f7e3af9a548c 100644 --- a/src/main/java/at/hannibal2/skyhanni/events/RepositoryReloadEvent.kt +++ b/src/main/java/at/hannibal2/skyhanni/events/RepositoryReloadEvent.kt @@ -1,5 +1,6 @@ package at.hannibal2.skyhanni.events +import at.hannibal2.skyhanni.api.event.SkyHanniEvent import at.hannibal2.skyhanni.data.repo.RepoError import at.hannibal2.skyhanni.data.repo.RepoManager import at.hannibal2.skyhanni.data.repo.RepoUtils @@ -7,7 +8,7 @@ import com.google.gson.Gson import java.io.File import java.lang.reflect.Type -class RepositoryReloadEvent(val repoLocation: File, val gson: Gson) : LorenzEvent() { +class RepositoryReloadEvent(val repoLocation: File, val gson: Gson) : SkyHanniEvent() { inline fun getConstant(constant: String, type: Type? = null, gson: Gson = this.gson): T = try { RepoManager.setLastConstant(constant) 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 9dc59bc27481..f3a9237b482a 100644 --- a/src/main/java/at/hannibal2/skyhanni/features/bingo/BingoAPI.kt +++ b/src/main/java/at/hannibal2/skyhanni/features/bingo/BingoAPI.kt @@ -16,7 +16,6 @@ import at.hannibal2.skyhanni.utils.RegexUtils.matches import at.hannibal2.skyhanni.utils.SimpleTimeMark import at.hannibal2.skyhanni.utils.TimeUtils import at.hannibal2.skyhanni.utils.repopatterns.RepoPattern -import net.minecraftforge.fml.common.eventhandler.SubscribeEvent import java.time.LocalTime import java.time.OffsetDateTime import java.time.ZoneOffset @@ -71,7 +70,7 @@ object BingoAPI { } } - @SubscribeEvent + @HandleEvent fun onRepoReload(event: RepositoryReloadEvent) { ranks = event.getConstant("BingoRanks").ranks data = event.getConstant("Bingo").bingoTips diff --git a/src/main/java/at/hannibal2/skyhanni/features/chat/PowderMiningChatFilter.kt b/src/main/java/at/hannibal2/skyhanni/features/chat/PowderMiningChatFilter.kt index a05d3a85abb1..b5d388cbbeee 100644 --- a/src/main/java/at/hannibal2/skyhanni/features/chat/PowderMiningChatFilter.kt +++ b/src/main/java/at/hannibal2/skyhanni/features/chat/PowderMiningChatFilter.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.features.chat.PowderMiningFilterConfig import at.hannibal2.skyhanni.config.features.chat.PowderMiningFilterConfig.SimplePowderMiningRewardTypes.ASCENSION_ROPE import at.hannibal2.skyhanni.config.features.chat.PowderMiningFilterConfig.SimplePowderMiningRewardTypes.JUNGLE_HEART @@ -22,8 +23,6 @@ import at.hannibal2.skyhanni.utils.RegexUtils.matchMatcher import at.hannibal2.skyhanni.utils.RegexUtils.matches import at.hannibal2.skyhanni.utils.StringUtils import at.hannibal2.skyhanni.utils.repopatterns.RepoPattern -import net.minecraftforge.fml.common.eventhandler.EventPriority -import net.minecraftforge.fml.common.eventhandler.SubscribeEvent import java.util.regex.Pattern @SkyHanniModule @@ -317,7 +316,7 @@ object PowderMiningChatFilter { private var rewardPatterns: Map, String> = emptyMap() - @SubscribeEvent(priority = EventPriority.HIGHEST) + @HandleEvent(priority = HandleEvent.HIGHEST) fun onRepoReload(event: RepositoryReloadEvent) { rewardPatterns = mapOf( ascensionRopeRewardPattern to ASCENSION_ROPE to "powder_mining_ascension_rope", diff --git a/src/main/java/at/hannibal2/skyhanni/features/chat/playerchat/PlayerChatFilter.kt b/src/main/java/at/hannibal2/skyhanni/features/chat/playerchat/PlayerChatFilter.kt index 23de5de6b97e..3bf6ddc16eac 100644 --- a/src/main/java/at/hannibal2/skyhanni/features/chat/playerchat/PlayerChatFilter.kt +++ b/src/main/java/at/hannibal2/skyhanni/features/chat/playerchat/PlayerChatFilter.kt @@ -1,11 +1,11 @@ package at.hannibal2.skyhanni.features.chat.playerchat +import at.hannibal2.skyhanni.api.event.HandleEvent import at.hannibal2.skyhanni.data.jsonobjects.repo.PlayerChatFilterJson import at.hannibal2.skyhanni.events.RepositoryReloadEvent import at.hannibal2.skyhanni.skyhannimodule.SkyHanniModule import at.hannibal2.skyhanni.utils.MultiFilter import net.minecraft.util.IChatComponent -import net.minecraftforge.fml.common.eventhandler.SubscribeEvent @SkyHanniModule object PlayerChatFilter { @@ -23,7 +23,7 @@ object PlayerChatFilter { return false } - @SubscribeEvent + @HandleEvent fun onRepoReload(event: RepositoryReloadEvent) { filters.clear() var countCategories = 0 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 1daea5869717..a12c2f5df1c3 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 @@ -290,7 +290,7 @@ object GhostTracker { tracker.renderDisplay(config.position) } - @SubscribeEvent + @HandleEvent fun onRepoReload(event: RepositoryReloadEvent) { allowedDrops = event.getConstant("GhostDrops").ghostDrops } 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 4ca43c59b628..7c3ad46039fb 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 @@ -12,7 +12,6 @@ import at.hannibal2.skyhanni.features.commands.suggestions.LazySuggestionEntry import at.hannibal2.skyhanni.features.commands.suggestions.SuggestionProvider import at.hannibal2.skyhanni.skyhannimodule.SkyHanniModule import at.hannibal2.skyhanni.utils.EntityUtils -import net.minecraftforge.fml.common.eventhandler.SubscribeEvent @SkyHanniModule object PlayerTabComplete { @@ -105,7 +104,7 @@ object PlayerTabComplete { it.isNotEmpty() }?.distinct() - @SubscribeEvent + @HandleEvent fun onRepoReload(event: RepositoryReloadEvent) { val data = event.getConstant("VipVisits") vipVisits = data.vipVisits diff --git a/src/main/java/at/hannibal2/skyhanni/features/commands/tabcomplete/WarpTabComplete.kt b/src/main/java/at/hannibal2/skyhanni/features/commands/tabcomplete/WarpTabComplete.kt index 2a1f6a4a9fc1..984c45a6d247 100644 --- a/src/main/java/at/hannibal2/skyhanni/features/commands/tabcomplete/WarpTabComplete.kt +++ b/src/main/java/at/hannibal2/skyhanni/features/commands/tabcomplete/WarpTabComplete.kt @@ -7,7 +7,6 @@ import at.hannibal2.skyhanni.events.RepositoryReloadEvent import at.hannibal2.skyhanni.events.chat.TabCompletionEvent import at.hannibal2.skyhanni.skyhannimodule.SkyHanniModule import at.hannibal2.skyhanni.utils.LorenzUtils -import net.minecraftforge.fml.common.eventhandler.SubscribeEvent @SkyHanniModule object WarpTabComplete { @@ -15,7 +14,7 @@ object WarpTabComplete { private val config get() = SkyHanniMod.feature.misc.commands.tabComplete private var warps = listOf() - @SubscribeEvent + @HandleEvent fun onRepoReload(event: RepositoryReloadEvent) { val data = event.getConstant("Warps") warps = data.warpCommands 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 94fb6cd12daa..6ccceb464411 100644 --- a/src/main/java/at/hannibal2/skyhanni/features/dungeon/DungeonsRaceGuide.kt +++ b/src/main/java/at/hannibal2/skyhanni/features/dungeon/DungeonsRaceGuide.kt @@ -41,7 +41,7 @@ object DungeonsRaceGuide { currentRace = null } - @SubscribeEvent + @HandleEvent fun onRepoReload(event: RepositoryReloadEvent) { val data = event.getConstant("DungeonHubRaces") for ((key, map) in data.data) { diff --git a/src/main/java/at/hannibal2/skyhanni/features/event/diana/DianaProfitTracker.kt b/src/main/java/at/hannibal2/skyhanni/features/event/diana/DianaProfitTracker.kt index 2a60de842312..98fea8cdf5ca 100644 --- a/src/main/java/at/hannibal2/skyhanni/features/event/diana/DianaProfitTracker.kt +++ b/src/main/java/at/hannibal2/skyhanni/features/event/diana/DianaProfitTracker.kt @@ -170,7 +170,7 @@ object DianaProfitTracker { private fun isAllowedItem(internalName: NEUInternalName): Boolean = internalName in allowedDrops - @SubscribeEvent + @HandleEvent fun onRepoReload(event: RepositoryReloadEvent) { allowedDrops = event.getConstant("DianaDrops").dianaDrops } 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 3e213b9737d1..0b8c5d284025 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 @@ -281,7 +281,7 @@ object HoppityCollectionStats { hotspotRabbitCount -= 1 } - @SubscribeEvent + @HandleEvent fun onRepoReload(event: RepositoryReloadEvent) { val data = event.getConstant("HoppityEggLocations") for ((island, residents) in data.residentLocations) { diff --git a/src/main/java/at/hannibal2/skyhanni/features/event/hoppity/HoppityEggLocations.kt b/src/main/java/at/hannibal2/skyhanni/features/event/hoppity/HoppityEggLocations.kt index b067b4111a92..1031691c7f99 100644 --- a/src/main/java/at/hannibal2/skyhanni/features/event/hoppity/HoppityEggLocations.kt +++ b/src/main/java/at/hannibal2/skyhanni/features/event/hoppity/HoppityEggLocations.kt @@ -45,7 +45,7 @@ object HoppityEggLocations { fun hasCollectedEgg(location: LorenzVec): Boolean = islandCollectedLocations.contains(location) - @SubscribeEvent + @HandleEvent fun onRepoReload(event: RepositoryReloadEvent) { // TODO: split Chocolate Factory and Hoppity repo data val data = event.getConstant("HoppityEggLocations") 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 dae1d5ddf37b..bde257122bec 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 @@ -162,7 +162,7 @@ object HoppityEventSummary { private fun MutableList.addEmptyLine() = this.add(StatString("", false)) - @SubscribeEvent + @HandleEvent fun onRepoReload(event: RepositoryReloadEvent) { allowedHoppityIslands = event.getConstant("HoppityEggLocations").apiEggLocations.keys.toSet() } diff --git a/src/main/java/at/hannibal2/skyhanni/features/event/hoppity/HoppityTextureHandler.kt b/src/main/java/at/hannibal2/skyhanni/features/event/hoppity/HoppityTextureHandler.kt index 31766dae3326..5d7a12c563ec 100644 --- a/src/main/java/at/hannibal2/skyhanni/features/event/hoppity/HoppityTextureHandler.kt +++ b/src/main/java/at/hannibal2/skyhanni/features/event/hoppity/HoppityTextureHandler.kt @@ -1,18 +1,18 @@ package at.hannibal2.skyhanni.features.event.hoppity +import at.hannibal2.skyhanni.api.event.HandleEvent import at.hannibal2.skyhanni.data.jsonobjects.repo.HoppityRabbitTextureEntry import at.hannibal2.skyhanni.data.jsonobjects.repo.HoppityRabbitTexturesJson import at.hannibal2.skyhanni.events.RepositoryReloadEvent import at.hannibal2.skyhanni.skyhannimodule.SkyHanniModule import at.hannibal2.skyhanni.utils.LorenzRarity -import net.minecraftforge.fml.common.eventhandler.SubscribeEvent @SkyHanniModule object HoppityTextureHandler { private var hoppityRabbitTextures = mutableMapOf>() - @SubscribeEvent + @HandleEvent fun onRepoReload(event: RepositoryReloadEvent) { val data = event.getConstant("HoppityRabbitTextures") hoppityRabbitTextures = data.textures.mapNotNull { (key, entries) -> diff --git a/src/main/java/at/hannibal2/skyhanni/features/event/hoppity/ReplaceHoppityWithContributor.kt b/src/main/java/at/hannibal2/skyhanni/features/event/hoppity/ReplaceHoppityWithContributor.kt index cf4584f90691..ba5457aa732f 100644 --- a/src/main/java/at/hannibal2/skyhanni/features/event/hoppity/ReplaceHoppityWithContributor.kt +++ b/src/main/java/at/hannibal2/skyhanni/features/event/hoppity/ReplaceHoppityWithContributor.kt @@ -13,8 +13,6 @@ import at.hannibal2.skyhanni.utils.ItemUtils.name import at.hannibal2.skyhanni.utils.LorenzUtils import at.hannibal2.skyhanni.utils.StringUtils.allLettersFirstUppercase import at.hannibal2.skyhanni.utils.StringUtils.removeColor -import net.minecraftforge.fml.common.eventhandler.EventPriority -import net.minecraftforge.fml.common.eventhandler.SubscribeEvent @SkyHanniModule object ReplaceHoppityWithContributor { @@ -28,7 +26,7 @@ object ReplaceHoppityWithContributor { update() } - @SubscribeEvent(priority = EventPriority.LOW) + @HandleEvent(priority = HandleEvent.LOW) fun onRepoReload(event: RepositoryReloadEvent) { update() } diff --git a/src/main/java/at/hannibal2/skyhanni/features/event/lobby/waypoints/christmas/PresentWaypoints.kt b/src/main/java/at/hannibal2/skyhanni/features/event/lobby/waypoints/christmas/PresentWaypoints.kt index be54088714ea..8d0360b5eacf 100644 --- a/src/main/java/at/hannibal2/skyhanni/features/event/lobby/waypoints/christmas/PresentWaypoints.kt +++ b/src/main/java/at/hannibal2/skyhanni/features/event/lobby/waypoints/christmas/PresentWaypoints.kt @@ -1,6 +1,7 @@ package at.hannibal2.skyhanni.features.event.lobby.waypoints.christmas import at.hannibal2.skyhanni.SkyHanniMod +import at.hannibal2.skyhanni.api.event.HandleEvent import at.hannibal2.skyhanni.data.HypixelData import at.hannibal2.skyhanni.data.WinterAPI import at.hannibal2.skyhanni.data.jsonobjects.repo.EventWaypointsJson @@ -117,7 +118,7 @@ object PresentWaypoints { private fun EventWaypoint.shouldShow(): Boolean = !isFound && (!config.onlyClosest || closest == this) - @SubscribeEvent + @HandleEvent fun onRepoReload(event: RepositoryReloadEvent) { val data = event.getConstant("EventWaypoints") presentLocations = loadEventWaypoints(data.presents) 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 7cbfdd64a920..6e2a778e84c2 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 @@ -230,7 +230,7 @@ object TheGreatSpook { } } - @SubscribeEvent + @HandleEvent fun onRepoReload(event: RepositoryReloadEvent) { val data = event.getConstant("Events").greatSpook diff --git a/src/main/java/at/hannibal2/skyhanni/features/fishing/FishingAPI.kt b/src/main/java/at/hannibal2/skyhanni/features/fishing/FishingAPI.kt index 16bb66689e8a..e64eed10a06f 100644 --- a/src/main/java/at/hannibal2/skyhanni/features/fishing/FishingAPI.kt +++ b/src/main/java/at/hannibal2/skyhanni/features/fishing/FishingAPI.kt @@ -125,7 +125,7 @@ object FishingAPI { holdingWaterRod = event.newItem.isWaterRod() } - @SubscribeEvent + @HandleEvent fun onRepoReload(event: RepositoryReloadEvent) { val data = event.getConstant("Items") lavaRods = data.lavaFishingRods diff --git a/src/main/java/at/hannibal2/skyhanni/features/fishing/SeaCreatureManager.kt b/src/main/java/at/hannibal2/skyhanni/features/fishing/SeaCreatureManager.kt index 2914863f1848..5923c4b9aabb 100644 --- a/src/main/java/at/hannibal2/skyhanni/features/fishing/SeaCreatureManager.kt +++ b/src/main/java/at/hannibal2/skyhanni/features/fishing/SeaCreatureManager.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.data.jsonobjects.repo.SeaCreatureJson import at.hannibal2.skyhanni.events.LorenzChatEvent import at.hannibal2.skyhanni.events.RepositoryReloadEvent @@ -56,7 +57,7 @@ object SeaCreatureManager { } } - @SubscribeEvent + @HandleEvent fun onRepoReload(event: RepositoryReloadEvent) { seaCreatureMap.clear() allFishingMobs = emptyMap() diff --git a/src/main/java/at/hannibal2/skyhanni/features/fishing/tracker/FishingProfitTracker.kt b/src/main/java/at/hannibal2/skyhanni/features/fishing/tracker/FishingProfitTracker.kt index b53547e41429..61810c199300 100644 --- a/src/main/java/at/hannibal2/skyhanni/features/fishing/tracker/FishingProfitTracker.kt +++ b/src/main/java/at/hannibal2/skyhanni/features/fishing/tracker/FishingProfitTracker.kt @@ -104,7 +104,7 @@ object FishingProfitTracker { private var itemCategories = mapOf>() - @SubscribeEvent + @HandleEvent fun onRepoReload(event: RepositoryReloadEvent) { itemCategories = event.getConstant("FishingProfitItems").categories } diff --git a/src/main/java/at/hannibal2/skyhanni/features/fishing/trophy/TrophyFishManager.kt b/src/main/java/at/hannibal2/skyhanni/features/fishing/trophy/TrophyFishManager.kt index c86ed4a9c447..e7ac3425f1ad 100644 --- a/src/main/java/at/hannibal2/skyhanni/features/fishing/trophy/TrophyFishManager.kt +++ b/src/main/java/at/hannibal2/skyhanni/features/fishing/trophy/TrophyFishManager.kt @@ -20,7 +20,6 @@ import at.hannibal2.skyhanni.utils.repopatterns.RepoPattern import net.minecraft.event.HoverEvent import net.minecraft.util.ChatComponentText import net.minecraft.util.ChatStyle -import net.minecraftforge.fml.common.eventhandler.SubscribeEvent @SkyHanniModule object TrophyFishManager { @@ -44,7 +43,7 @@ object TrophyFishManager { "§.(?.*) §c✖", ) - @SubscribeEvent + @HandleEvent fun onRepoReload(event: RepositoryReloadEvent) { val data = event.getConstant("TrophyFish") trophyFishInfo = data.trophyFish 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 ada49f71195e..fc8e6517ca9b 100644 --- a/src/main/java/at/hannibal2/skyhanni/features/garden/GardenAPI.kt +++ b/src/main/java/at/hannibal2/skyhanni/features/garden/GardenAPI.kt @@ -262,7 +262,7 @@ object GardenAPI { return tier } - @SubscribeEvent + @HandleEvent fun onRepoReload(event: RepositoryReloadEvent) { val data = event.getConstant("Garden") gardenExperience = data.gardenExp 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 1ff3dd87b592..462649958671 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 @@ -548,7 +548,7 @@ object ComposterOverlay { updateOrganicMatterFactors() } - @SubscribeEvent + @HandleEvent fun onRepoReload(event: RepositoryReloadEvent) { val data = event.getConstant("Garden") organicMatter = data.organicMatter 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 21215b6ddd58..092c88337be1 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 @@ -53,7 +53,7 @@ object FarmingPersonalBestGain { var crop: String? = null var cropType: CropType? = null - @SubscribeEvent + @HandleEvent fun onRepoReload(event: RepositoryReloadEvent) { val data = event.getConstant("Garden") personalBestIncrements = data.personalBestIncrement 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 c9787683bfda..4f295ea1a259 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 @@ -131,7 +131,7 @@ object ArmorDropTracker { hasArmor = armorPieces > 1 } - @SubscribeEvent + @HandleEvent fun onRepoReload(event: RepositoryReloadEvent) { val data = event.getConstant("ArmorDrops") armorDropInfo = data.specialCrops 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 3bfec86484d6..741bace9aedc 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 @@ -18,7 +18,6 @@ import at.hannibal2.skyhanni.utils.CollectionUtils.editCopy import at.hannibal2.skyhanni.utils.InventoryUtils import at.hannibal2.skyhanni.utils.ItemUtils.getInternalName import at.hannibal2.skyhanni.utils.SimpleTimeMark -import net.minecraftforge.fml.common.eventhandler.SubscribeEvent import kotlin.concurrent.fixedRateTimer @SkyHanniModule @@ -138,7 +137,7 @@ object GardenCropSpeed { } } - @SubscribeEvent + @HandleEvent fun onRepoReload(event: RepositoryReloadEvent) { val data = event.getConstant("DicerDrops") calculateAverageDicer(melonDicer, data.MELON) 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 6abaf0aff459..4ee14209fd62 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 @@ -81,7 +81,7 @@ object AnitaExtraFarmingFortune { } } - @SubscribeEvent + @HandleEvent fun onRepoReload(event: RepositoryReloadEvent) { val data = event.getConstant("AnitaUpgradeCosts") levelPrice = data.levelPrice diff --git a/src/main/java/at/hannibal2/skyhanni/features/garden/visitor/GardenVisitorColorNames.kt b/src/main/java/at/hannibal2/skyhanni/features/garden/visitor/GardenVisitorColorNames.kt index 4350330cf87f..7a79af9bedef 100644 --- a/src/main/java/at/hannibal2/skyhanni/features/garden/visitor/GardenVisitorColorNames.kt +++ b/src/main/java/at/hannibal2/skyhanni/features/garden/visitor/GardenVisitorColorNames.kt @@ -1,10 +1,10 @@ package at.hannibal2.skyhanni.features.garden.visitor +import at.hannibal2.skyhanni.api.event.HandleEvent import at.hannibal2.skyhanni.data.jsonobjects.repo.GardenJson import at.hannibal2.skyhanni.events.RepositoryReloadEvent import at.hannibal2.skyhanni.skyhannimodule.SkyHanniModule import at.hannibal2.skyhanni.utils.StringUtils.removeColor -import net.minecraftforge.fml.common.eventhandler.SubscribeEvent @SkyHanniModule object GardenVisitorColorNames { @@ -12,7 +12,7 @@ object GardenVisitorColorNames { private val visitorColors = mutableMapOf() // name -> color code var visitorItems = mutableMapOf>() - @SubscribeEvent + @HandleEvent fun onRepoReload(event: RepositoryReloadEvent) { val data = event.getConstant("Garden") visitorColors.clear() diff --git a/src/main/java/at/hannibal2/skyhanni/features/garden/visitor/HighlightVisitorsOutsideOfGarden.kt b/src/main/java/at/hannibal2/skyhanni/features/garden/visitor/HighlightVisitorsOutsideOfGarden.kt index 98f087e54e51..bb7e4755acb2 100644 --- a/src/main/java/at/hannibal2/skyhanni/features/garden/visitor/HighlightVisitorsOutsideOfGarden.kt +++ b/src/main/java/at/hannibal2/skyhanni/features/garden/visitor/HighlightVisitorsOutsideOfGarden.kt @@ -35,7 +35,7 @@ object HighlightVisitorsOutsideOfGarden { private val config get() = GardenAPI.config.visitors - @SubscribeEvent + @HandleEvent fun onRepoReload(event: RepositoryReloadEvent) { visitorJson = event.getConstant( "Garden", GardenJson::class.java, diff --git a/src/main/java/at/hannibal2/skyhanni/features/gui/customscoreboard/ScoreboardPattern.kt b/src/main/java/at/hannibal2/skyhanni/features/gui/customscoreboard/ScoreboardPattern.kt index edd7bc05bcdf..045bb915566a 100644 --- a/src/main/java/at/hannibal2/skyhanni/features/gui/customscoreboard/ScoreboardPattern.kt +++ b/src/main/java/at/hannibal2/skyhanni/features/gui/customscoreboard/ScoreboardPattern.kt @@ -1,9 +1,9 @@ package at.hannibal2.skyhanni.features.gui.customscoreboard +import at.hannibal2.skyhanni.api.event.HandleEvent import at.hannibal2.skyhanni.events.RepositoryReloadEvent import at.hannibal2.skyhanni.skyhannimodule.SkyHanniModule import at.hannibal2.skyhanni.utils.repopatterns.RepoPattern -import net.minecraftforge.fml.common.eventhandler.SubscribeEvent @SkyHanniModule object ScoreboardPattern { @@ -12,8 +12,8 @@ object ScoreboardPattern { // Lines from the scoreboard private val scoreboardGroup by group.exclusiveGroup("scoreboard") - @SubscribeEvent - fun onRepositoryReload(event: RepositoryReloadEvent) { + @HandleEvent + fun onRepoReload(event: RepositoryReloadEvent) { UnknownLinesHandler.remoteOnlyPatterns = scoreboardGroup.getUnusedPatterns().toTypedArray() } diff --git a/src/main/java/at/hannibal2/skyhanni/features/inventory/DojoRankDisplay.kt b/src/main/java/at/hannibal2/skyhanni/features/inventory/DojoRankDisplay.kt index 7f84f9591ec3..b228c053d9ee 100644 --- a/src/main/java/at/hannibal2/skyhanni/features/inventory/DojoRankDisplay.kt +++ b/src/main/java/at/hannibal2/skyhanni/features/inventory/DojoRankDisplay.kt @@ -90,7 +90,7 @@ object DojoRankDisplay { display = emptyList() } - @SubscribeEvent + @HandleEvent fun onRepoReload(event: RepositoryReloadEvent) { val data = event.getConstant("Belts") belts = data.belts 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 835a85d1dd49..578b008e58d0 100644 --- a/src/main/java/at/hannibal2/skyhanni/features/inventory/HideNotClickableItems.kt +++ b/src/main/java/at/hannibal2/skyhanni/features/inventory/HideNotClickableItems.kt @@ -87,7 +87,7 @@ object HideNotClickableItems { private val netherWart = "NETHER_STALK".toInternalName() - @SubscribeEvent + @HandleEvent fun onRepoReload(event: RepositoryReloadEvent) { val hideNotClickable = event.getConstant("HideNotClickableItems") hideNpcSellFilter.load(hideNotClickable.hideNpcSell) diff --git a/src/main/java/at/hannibal2/skyhanni/features/inventory/QuickCraftFeatures.kt b/src/main/java/at/hannibal2/skyhanni/features/inventory/QuickCraftFeatures.kt index f1235a968af8..ee7cc8e7a418 100644 --- a/src/main/java/at/hannibal2/skyhanni/features/inventory/QuickCraftFeatures.kt +++ b/src/main/java/at/hannibal2/skyhanni/features/inventory/QuickCraftFeatures.kt @@ -1,6 +1,7 @@ package at.hannibal2.skyhanni.features.inventory import at.hannibal2.skyhanni.SkyHanniMod +import at.hannibal2.skyhanni.api.event.HandleEvent import at.hannibal2.skyhanni.events.GuiContainerEvent import at.hannibal2.skyhanni.events.LorenzToolTipEvent import at.hannibal2.skyhanni.events.RepositoryReloadEvent @@ -36,7 +37,7 @@ object QuickCraftFeatures { InventoryType.MORE_QUICK_CRAFT_OPTIONS -> slotNumber !in 10..44 } - @SubscribeEvent + @HandleEvent fun onRepoReload(event: RepositoryReloadEvent) { quickCraftableItems = event.getConstant>("QuickCraftableItems") } diff --git a/src/main/java/at/hannibal2/skyhanni/features/inventory/attribute/AttributeAPI.kt b/src/main/java/at/hannibal2/skyhanni/features/inventory/attribute/AttributeAPI.kt index 44d0af4d123a..e997374f6de3 100644 --- a/src/main/java/at/hannibal2/skyhanni/features/inventory/attribute/AttributeAPI.kt +++ b/src/main/java/at/hannibal2/skyhanni/features/inventory/attribute/AttributeAPI.kt @@ -1,5 +1,6 @@ package at.hannibal2.skyhanni.features.inventory.attribute +import at.hannibal2.skyhanni.api.event.HandleEvent import at.hannibal2.skyhanni.data.jsonobjects.repo.AttributeGoodRollsJson import at.hannibal2.skyhanni.events.RepositoryReloadEvent import at.hannibal2.skyhanni.skyhannimodule.SkyHanniModule @@ -9,7 +10,6 @@ import at.hannibal2.skyhanni.utils.NEUInternalName import at.hannibal2.skyhanni.utils.RegexUtils.matches import at.hannibal2.skyhanni.utils.SkyBlockItemModifierUtils.getAttributes import net.minecraft.item.ItemStack -import net.minecraftforge.fml.common.eventhandler.SubscribeEvent import java.util.regex.Pattern @SkyHanniModule @@ -72,7 +72,7 @@ object AttributeAPI { private data class GoodRollItem(val regex: Pattern, val attributes: List>) - @SubscribeEvent + @HandleEvent fun onRepoReload(event: RepositoryReloadEvent) { val data = event.getConstant("AttributeGoodRolls") goodRolls = data.goodRolls.values.map { 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 65ca3f656527..3e324ee8ee61 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 @@ -28,7 +28,6 @@ import at.hannibal2.skyhanni.utils.StringUtils.removeColor import at.hannibal2.skyhanni.utils.UtilsPatterns import at.hannibal2.skyhanni.utils.repopatterns.RepoPattern import net.minecraft.item.ItemStack -import net.minecraftforge.fml.common.eventhandler.SubscribeEvent import java.util.TreeSet import kotlin.time.Duration import kotlin.time.Duration.Companion.hours @@ -148,7 +147,7 @@ object ChocolateFactoryAPI { } } - @SubscribeEvent + @HandleEvent fun onRepoReload(event: RepositoryReloadEvent) { val data = event.getConstant("HoppityEggLocations") 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 7c60eb31f33f..545711add9f5 100644 --- a/src/main/java/at/hannibal2/skyhanni/features/mining/DeepCavernsGuide.kt +++ b/src/main/java/at/hannibal2/skyhanni/features/mining/DeepCavernsGuide.kt @@ -63,7 +63,7 @@ object DeepCavernsGuide { show = false } - @SubscribeEvent + @HandleEvent fun onRepoReload(event: RepositoryReloadEvent) { val data = event.getConstant("DeepCavernsParkour") parkourHelper = ParkourHelper( 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 1696cdbcfbd7..bfc473bec529 100644 --- a/src/main/java/at/hannibal2/skyhanni/features/mining/TunnelsMaps.kt +++ b/src/main/java/at/hannibal2/skyhanni/features/mining/TunnelsMaps.kt @@ -221,7 +221,7 @@ object TunnelsMaps { } } - @SubscribeEvent + @HandleEvent fun onRepoReload(event: RepositoryReloadEvent) { graph = event.getConstant("island_graphs/GLACITE_TUNNELS", gson = Graph.gson) possibleLocations = graph.groupBy { it.name }.filterNotNullKeys().mapValues { (_, value) -> diff --git a/src/main/java/at/hannibal2/skyhanni/features/minion/InfernoMinionFeatures.kt b/src/main/java/at/hannibal2/skyhanni/features/minion/InfernoMinionFeatures.kt index 7d89827bdf20..7f8974addcd6 100644 --- a/src/main/java/at/hannibal2/skyhanni/features/minion/InfernoMinionFeatures.kt +++ b/src/main/java/at/hannibal2/skyhanni/features/minion/InfernoMinionFeatures.kt @@ -32,7 +32,7 @@ object InfernoMinionFeatures { private var fuelItemIds = listOf() private var inInventory = false - @SubscribeEvent + @HandleEvent fun onRepoReload(event: RepositoryReloadEvent) { val data = event.getConstant("InfernoMinionFuels") fuelItemIds = data.minionFuels diff --git a/src/main/java/at/hannibal2/skyhanni/features/minion/MinionXp.kt b/src/main/java/at/hannibal2/skyhanni/features/minion/MinionXp.kt index 181bc415f3bc..266ae247c8e6 100644 --- a/src/main/java/at/hannibal2/skyhanni/features/minion/MinionXp.kt +++ b/src/main/java/at/hannibal2/skyhanni/features/minion/MinionXp.kt @@ -185,7 +185,7 @@ object MinionXp { collectItemXpList.clear() } - @SubscribeEvent + @HandleEvent fun onRepoReload(event: RepositoryReloadEvent) { xpInfoMap = event.getConstant("MinionXP").minionXp.mapNotNull { xpType -> xpType.value.mapNotNull { it.key.toInternalName() to XpInfo(SkillType.getByName(xpType.key), it.value) } diff --git a/src/main/java/at/hannibal2/skyhanni/features/misc/CarryTracker.kt b/src/main/java/at/hannibal2/skyhanni/features/misc/CarryTracker.kt index 0ed50799af5e..513f90dddd07 100644 --- a/src/main/java/at/hannibal2/skyhanni/features/misc/CarryTracker.kt +++ b/src/main/java/at/hannibal2/skyhanni/features/misc/CarryTracker.kt @@ -105,7 +105,7 @@ object CarryTracker { } } - @SubscribeEvent + @HandleEvent fun onRepoReload(event: RepositoryReloadEvent) { val data = event.getConstant("CarryTracker") slayerNames = data.slayerNames.mapKeys { SlayerType.valueOf(it.key) } diff --git a/src/main/java/at/hannibal2/skyhanni/features/misc/ContributorManager.kt b/src/main/java/at/hannibal2/skyhanni/features/misc/ContributorManager.kt index e4f2e54547a1..c9e8113a7a57 100644 --- a/src/main/java/at/hannibal2/skyhanni/features/misc/ContributorManager.kt +++ b/src/main/java/at/hannibal2/skyhanni/features/misc/ContributorManager.kt @@ -10,7 +10,6 @@ import at.hannibal2.skyhanni.events.entity.EntityDisplayNameEvent import at.hannibal2.skyhanni.skyhannimodule.SkyHanniModule import net.minecraft.entity.player.EntityPlayer import net.minecraft.util.ChatComponentText -import net.minecraftforge.fml.common.eventhandler.SubscribeEvent @SkyHanniModule object ContributorManager { @@ -23,7 +22,7 @@ object ContributorManager { var contributorNames = emptyList() private set - @SubscribeEvent + @HandleEvent fun onRepoReload(event: RepositoryReloadEvent) { val map = event.getConstant("Contributors").contributors contributors = map.mapKeys { it.key.lowercase() } 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 2eef9111c189..e3709284c515 100644 --- a/src/main/java/at/hannibal2/skyhanni/features/misc/QuickModMenuSwitch.kt +++ b/src/main/java/at/hannibal2/skyhanni/features/misc/QuickModMenuSwitch.kt @@ -32,7 +32,7 @@ object QuickModMenuSwitch { private var currentlyOpeningMod = "" private var lastGuiOpen = 0L - @SubscribeEvent + @HandleEvent fun onRepoReload(event: RepositoryReloadEvent) { val modsJar = event.getConstant("ModGuiSwitcher") mods = modsJar.mods.filter { mod -> diff --git a/src/main/java/at/hannibal2/skyhanni/features/misc/ReplaceRomanNumerals.kt b/src/main/java/at/hannibal2/skyhanni/features/misc/ReplaceRomanNumerals.kt index 8f59492a758f..04bcefa5b7c0 100644 --- a/src/main/java/at/hannibal2/skyhanni/features/misc/ReplaceRomanNumerals.kt +++ b/src/main/java/at/hannibal2/skyhanni/features/misc/ReplaceRomanNumerals.kt @@ -85,7 +85,7 @@ object ReplaceRomanNumerals { event.applyIfPossible { it.tryReplace() } } - @SubscribeEvent(priority = EventPriority.LOW) + @HandleEvent(priority = HandleEvent.LOW) fun onRepoReload(event: RepositoryReloadEvent) { cachedStrings.clear() } 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 6b7a6ad125df..1743552d325c 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 @@ -120,7 +120,7 @@ object DiscordRPCManager : IPCListener { } } - @SubscribeEvent + @HandleEvent fun onRepoReload(event: RepositoryReloadEvent) { stackingEnchants = event.getConstant("StackingEnchants").enchants } 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 e27e09770bc1..b012b0f6dbae 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 @@ -57,7 +57,7 @@ object EstimatedItemValue { event.readConstant>>>("gemstonecosts") } - @SubscribeEvent + @HandleEvent fun onRepoReload(event: RepositoryReloadEvent) { val data = event.getConstant("Items") bookBundleAmount = data.bookBundleAmount 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 6d028f6ecd8b..166cb8bce704 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 @@ -27,7 +27,6 @@ import net.minecraft.item.ItemStack import net.minecraft.util.ChatComponentText import net.minecraft.util.IChatComponent import net.minecraftforge.fml.common.Loader -import net.minecraftforge.fml.common.eventhandler.SubscribeEvent import java.util.TreeSet /** @@ -87,7 +86,7 @@ object EnchantParser { // Maps for all enchants private var enchants: EnchantsJson = EnchantsJson() - @SubscribeEvent + @HandleEvent fun onRepoReload(event: RepositoryReloadEvent) { this.enchants = event.getConstant("Enchants") } 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 04d0a5948155..37cff1b21bc4 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 @@ -62,7 +62,7 @@ class CrimsonIsleReputationHelper(skyHanniMod: SkyHanniMod) { skyHanniMod.loadModule(kuudraBossHelper) } - @SubscribeEvent + @HandleEvent fun onRepoReload(event: RepositoryReloadEvent) { val data = event.getConstant("CrimsonIsleReputation") miniBossHelper.onRepoReload(data.MINIBOSS) diff --git a/src/main/java/at/hannibal2/skyhanni/features/rift/area/dreadfarm/WoodenButtonsHelper.kt b/src/main/java/at/hannibal2/skyhanni/features/rift/area/dreadfarm/WoodenButtonsHelper.kt index f4d15c606aae..7cbce9c90c26 100644 --- a/src/main/java/at/hannibal2/skyhanni/features/rift/area/dreadfarm/WoodenButtonsHelper.kt +++ b/src/main/java/at/hannibal2/skyhanni/features/rift/area/dreadfarm/WoodenButtonsHelper.kt @@ -55,7 +55,7 @@ object WoodenButtonsHelper { private var currentSpot: GraphNode? = null private var lastBlowgunFire = SimpleTimeMark.farPast() - @SubscribeEvent + @HandleEvent fun onRepoReload(event: RepositoryReloadEvent) { val data = event.getConstant("rift/RiftWoodenButtons") buttonLocations = mutableMapOf>().apply { 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 c502d1095799..efb2f584e5be 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 @@ -166,7 +166,7 @@ object DanceRoomHelper { } } - @SubscribeEvent + @HandleEvent fun onRepoReload(event: RepositoryReloadEvent) { instructions = event.getConstant("DanceRoomInstructions").instructions } 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 afe8c615a7c8..ac99e17feb3e 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 @@ -22,7 +22,7 @@ object RiftLavaMazeParkour { private var parkourHelper: ParkourHelper? = null - @SubscribeEvent + @HandleEvent fun onRepoReload(event: RepositoryReloadEvent) { val data = event.getConstant("RiftLavaMazeParkour") parkourHelper = ParkourHelper( 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 d7a8060d24b0..a9b64d0a9c54 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 @@ -21,7 +21,7 @@ object RiftUpsideDownParkour { private val config get() = RiftAPI.config.area.mirrorverse.upsideDownParkour private var parkourHelper: ParkourHelper? = null - @SubscribeEvent + @HandleEvent fun onRepoReload(event: RepositoryReloadEvent) { val data = event.getConstant("RiftUpsideDownParkour") parkourHelper = ParkourHelper( 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 d2419c0ec0dc..4090e2a77db7 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 @@ -23,7 +23,7 @@ object TubulatorParkour { private var parkourHelper: ParkourHelper? = null private val puzzleRoom = AxisAlignedBB(-298.0, 0.0, -112.0, -309.0, 63.0, -101.0) - @SubscribeEvent + @HandleEvent fun onRepoReload(event: RepositoryReloadEvent) { val data = event.getConstant("RiftTubulator") parkourHelper = ParkourHelper( 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 c848880a7e32..d08eb99944d5 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 @@ -71,7 +71,7 @@ object RiftBloodEffigies { } } - @SubscribeEvent + @HandleEvent fun onRepoReload(event: RepositoryReloadEvent) { val newLocations = event.getConstant("RiftEffigies").locations if (newLocations.size != 6) { 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 5786b6580332..5968840f6b42 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 @@ -66,7 +66,7 @@ object RiftGunthersRace { RiftAPI.inRiftRace = false } - @SubscribeEvent + @HandleEvent fun onRepoReload(event: RepositoryReloadEvent) { val data = event.getConstant("rift/RiftRace") parkourHelper = ParkourHelper( diff --git a/src/main/java/at/hannibal2/skyhanni/features/rift/everywhere/EnigmaSoulWaypoints.kt b/src/main/java/at/hannibal2/skyhanni/features/rift/everywhere/EnigmaSoulWaypoints.kt index a4cd2fa5df96..4d594c23fd8d 100644 --- a/src/main/java/at/hannibal2/skyhanni/features/rift/everywhere/EnigmaSoulWaypoints.kt +++ b/src/main/java/at/hannibal2/skyhanni/features/rift/everywhere/EnigmaSoulWaypoints.kt @@ -169,7 +169,7 @@ object EnigmaSoulWaypoints { } } - @SubscribeEvent + @HandleEvent fun onRepoReload(event: RepositoryReloadEvent) { val data = event.getConstant("EnigmaSouls") val areas = data.areas 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 0bb83f270d7b..85235bd7a052 100644 --- a/src/main/java/at/hannibal2/skyhanni/features/slayer/SlayerProfitTracker.kt +++ b/src/main/java/at/hannibal2/skyhanni/features/slayer/SlayerProfitTracker.kt @@ -100,7 +100,7 @@ object SlayerProfitTracker { private var allowedItems = mapOf>() - @SubscribeEvent + @HandleEvent fun onRepoReload(event: RepositoryReloadEvent) { allowedItems = event.getConstant("SlayerProfitTrackerItems").slayers } diff --git a/src/main/java/at/hannibal2/skyhanni/test/command/ErrorManager.kt b/src/main/java/at/hannibal2/skyhanni/test/command/ErrorManager.kt index 50e5427cee8d..feea9a6bb165 100644 --- a/src/main/java/at/hannibal2/skyhanni/test/command/ErrorManager.kt +++ b/src/main/java/at/hannibal2/skyhanni/test/command/ErrorManager.kt @@ -1,6 +1,7 @@ package at.hannibal2.skyhanni.test.command import at.hannibal2.skyhanni.SkyHanniMod +import at.hannibal2.skyhanni.api.event.HandleEvent import at.hannibal2.skyhanni.data.jsonobjects.repo.ChangedChatErrorsJson import at.hannibal2.skyhanni.data.jsonobjects.repo.RepoErrorData import at.hannibal2.skyhanni.events.RepositoryReloadEvent @@ -12,7 +13,6 @@ import at.hannibal2.skyhanni.utils.StringUtils import at.hannibal2.skyhanni.utils.StringUtils.removeColor import at.hannibal2.skyhanni.utils.TimeLimitedSet import net.minecraft.client.Minecraft -import net.minecraftforge.fml.common.eventhandler.SubscribeEvent import kotlin.time.Duration.Companion.minutes @SkyHanniModule @@ -203,7 +203,7 @@ object ErrorManager { return if (hideError) null else finalMessage } - @SubscribeEvent + @HandleEvent fun onRepoReload(event: RepositoryReloadEvent) { val data = event.getConstant("ChangedChatErrors") val version = SkyHanniMod.modVersion diff --git a/src/main/java/at/hannibal2/skyhanni/utils/NEUItems.kt b/src/main/java/at/hannibal2/skyhanni/utils/NEUItems.kt index 00d79bb535fb..90d17b218a9f 100644 --- a/src/main/java/at/hannibal2/skyhanni/utils/NEUItems.kt +++ b/src/main/java/at/hannibal2/skyhanni/utils/NEUItems.kt @@ -35,7 +35,6 @@ import net.minecraft.init.Items import net.minecraft.item.Item import net.minecraft.item.ItemStack import net.minecraft.nbt.NBTTagCompound -import net.minecraftforge.fml.common.eventhandler.SubscribeEvent import org.lwjgl.opengl.GL11 import kotlin.time.Duration.Companion.seconds @@ -60,7 +59,7 @@ object NEUItems { ) } - @SubscribeEvent + @HandleEvent fun onRepoReload(event: RepositoryReloadEvent) { val ignoredItems = event.getConstant("IgnoredItems") ignoreItemsFilter.load(ignoredItems) diff --git a/src/main/java/at/hannibal2/skyhanni/utils/SkullTextureHolder.kt b/src/main/java/at/hannibal2/skyhanni/utils/SkullTextureHolder.kt index 4060f84ec7c1..d38e1070129c 100644 --- a/src/main/java/at/hannibal2/skyhanni/utils/SkullTextureHolder.kt +++ b/src/main/java/at/hannibal2/skyhanni/utils/SkullTextureHolder.kt @@ -1,16 +1,16 @@ package at.hannibal2.skyhanni.utils +import at.hannibal2.skyhanni.api.event.HandleEvent import at.hannibal2.skyhanni.events.RepositoryReloadEvent import at.hannibal2.skyhanni.features.mining.eventtracker.MiningEventType import at.hannibal2.skyhanni.skyhannimodule.SkyHanniModule -import net.minecraftforge.fml.common.eventhandler.SubscribeEvent @SkyHanniModule object SkullTextureHolder { private var skullTextures = mutableMapOf() - @SubscribeEvent + @HandleEvent fun onRepoReload(event: RepositoryReloadEvent) { skullTextures = event.getConstant>("Skulls").toMutableMap() fixLateInits() diff --git a/src/main/java/at/hannibal2/skyhanni/utils/TabListData.kt b/src/main/java/at/hannibal2/skyhanni/utils/TabListData.kt index 28da14391cde..5e59ca1e8edb 100644 --- a/src/main/java/at/hannibal2/skyhanni/utils/TabListData.kt +++ b/src/main/java/at/hannibal2/skyhanni/utils/TabListData.kt @@ -25,8 +25,7 @@ import net.minecraftforge.fml.common.eventhandler.SubscribeEvent import net.minecraftforge.fml.relauncher.Side import net.minecraftforge.fml.relauncher.SideOnly import kotlin.time.Duration.Companion.seconds - -//#if MC<1.12 +//#if MC < 1.12 import net.minecraft.world.WorldSettings //#else //$$ import net.minecraft.world.GameType @@ -120,7 +119,7 @@ object TabListData { o2.gameType != WorldSettings.GameType.SPECTATOR, //#else //$$ o1.gameType != GameType.SPECTATOR, - //$$ o2.gameType != GameType.SPECTATOR + //$$ o2.gameType != GameType.SPECTATOR, //#endif ) .compare( 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 f6f18479e1e0..90150dc27d9a 100644 --- a/src/main/java/at/hannibal2/skyhanni/utils/repopatterns/RepoPatternManager.kt +++ b/src/main/java/at/hannibal2/skyhanni/utils/repopatterns/RepoPatternManager.kt @@ -19,7 +19,6 @@ import at.hannibal2.skyhanni.utils.StringUtils.substringBeforeLastOrNull import at.hannibal2.skyhanni.utils.system.PlatformUtils import net.minecraft.launchwrapper.Launch import net.minecraftforge.fml.common.FMLCommonHandler -import net.minecraftforge.fml.common.eventhandler.SubscribeEvent import org.apache.logging.log4j.LogManager import java.io.File import java.util.NavigableMap @@ -156,7 +155,7 @@ object RepoPatternManager { checkExclusivity(owner, key) } - @SubscribeEvent + @HandleEvent fun onRepoReload(event: RepositoryReloadEvent) { loadPatternsFromDump(event.getConstant("regexes")) }