diff --git a/backend/mirai-console/src/main/kotlin/net/mamoe/mirai/console/internal/plugin/PluginManagerImpl.kt b/backend/mirai-console/src/main/kotlin/net/mamoe/mirai/console/internal/plugin/PluginManagerImpl.kt index 828675db7..c28349223 100644 --- a/backend/mirai-console/src/main/kotlin/net/mamoe/mirai/console/internal/plugin/PluginManagerImpl.kt +++ b/backend/mirai-console/src/main/kotlin/net/mamoe/mirai/console/internal/plugin/PluginManagerImpl.kt @@ -52,11 +52,14 @@ internal object PluginManagerImpl : PluginManager, CoroutineScope by MiraiConsol get() = _pluginLoaders.toList() override val Plugin.description: PluginDescription - get() = resolvedPlugins.firstOrNull { it == this } + get() = if (this is JvmPlugin) { + this.safeLoader.getDescription(this) + } else resolvedPlugins.firstOrNull { it == this } ?.loader?.cast>() ?.getDescription(this) ?: error("Plugin is unloaded") + override fun PluginLoader<*, *>.register(): Boolean = loadersLock.withLock { if (_pluginLoaders.any { it::class == this::class }) { return false