diff options
author | Linnea Gräf <nea@nea.moe> | 2024-09-01 22:21:19 +0200 |
---|---|---|
committer | Linnea Gräf <nea@nea.moe> | 2024-09-01 22:21:19 +0200 |
commit | 5ed74f2df49c93ed1617520a935078b59ad7e195 (patch) | |
tree | f0d52699fff7f820bd724902878988859bd43516 /src/main/kotlin/features/FeatureManager.kt | |
parent | 816f80f862d2f5de6bc9b0ae84cd6df0da341228 (diff) | |
download | firmament-5ed74f2df49c93ed1617520a935078b59ad7e195.tar.gz firmament-5ed74f2df49c93ed1617520a935078b59ad7e195.tar.bz2 firmament-5ed74f2df49c93ed1617520a935078b59ad7e195.zip |
Add per compat project event listeners
[no changelog]
Diffstat (limited to 'src/main/kotlin/features/FeatureManager.kt')
-rw-r--r-- | src/main/kotlin/features/FeatureManager.kt | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/src/main/kotlin/features/FeatureManager.kt b/src/main/kotlin/features/FeatureManager.kt index 19b91de..c2889eb 100644 --- a/src/main/kotlin/features/FeatureManager.kt +++ b/src/main/kotlin/features/FeatureManager.kt @@ -1,14 +1,12 @@ - - package moe.nea.firmament.features import kotlinx.serialization.Serializable import kotlinx.serialization.serializer import moe.nea.firmament.Firmament -import moe.nea.firmament.annotations.generated.AllSubscriptions import moe.nea.firmament.events.FeaturesInitializedEvent import moe.nea.firmament.events.FirmamentEvent import moe.nea.firmament.events.subscription.Subscription +import moe.nea.firmament.events.subscription.SubscriptionList import moe.nea.firmament.features.chat.AutoCompletions import moe.nea.firmament.features.chat.ChatLinks import moe.nea.firmament.features.chat.QuickCommands @@ -88,13 +86,15 @@ object FeatureManager : DataHolder<FeatureManager.Config>(serializer(), "feature } fun subscribeEvents() { - AllSubscriptions.provideSubscriptions { - subscribeSingleEvent(it) + SubscriptionList.allLists.forEach { + it.provideSubscriptions { + subscribeSingleEvent(it) + } } } private fun <T : FirmamentEvent> subscribeSingleEvent(it: Subscription<T>) { - it.eventBus.subscribe(false, it.invoke) + it.eventBus.subscribe(false, "${it.owner.javaClass.simpleName}:${it.methodName}", it.invoke) } fun loadFeature(feature: FirmamentFeature) { |