fix: Crashing when launching without jade

This commit is contained in:
Linnea Gräf
2025-03-18 11:06:17 +01:00
parent 0169939b6e
commit bab85b9a2f
2 changed files with 76 additions and 71 deletions

View File

@@ -163,7 +163,7 @@ fun createIsolatedSourceSet(name: String, path: String = "compat/$name", isEnabl
extendsFrom(getByName(mainSS.annotationProcessorConfigurationName))
}
(mainSS.runtimeOnlyConfigurationName) {
extendsFrom(getByName(ss.runtimeClasspathConfigurationName))
// extendsFrom(getByName(ss.runtimeClasspathConfigurationName))
}
("ksp$upperName") {
extendsFrom(ksp.get())

View File

@@ -82,13 +82,18 @@ object FeatureManager : DataHolder<FeatureManager.Config>(serializer(), "feature
}
fun subscribeEvents() {
SubscriptionList.allLists.forEach {
it.provideSubscriptions {
SubscriptionList.allLists.forEach { list ->
runCatching {
list.provideSubscriptions {
it.owner.javaClass.classes.forEach {
runCatching { it.getDeclaredField("INSTANCE").get(null) }
}
subscribeSingleEvent(it)
}
}.getOrElse {
// TODO: allow annotating source sets to specifically opt out of loading for mods, maybe automatically
Firmament.logger.info("Ignoring events from $list, likely due to a missing compat mod.", it)
}
}
}