Skip to content

Commit

Permalink
kdocs; keep old internal constructor
Browse files Browse the repository at this point in the history
  • Loading branch information
Karlatemp committed Jul 20, 2023
1 parent f537726 commit 9bb6af7
Show file tree
Hide file tree
Showing 4 changed files with 23 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -1958,6 +1958,7 @@ public final class net/mamoe/mirai/console/plugin/description/PluginDescription$
}

public abstract class net/mamoe/mirai/console/plugin/jvm/AbstractJvmPlugin : net/mamoe/mirai/console/internal/plugin/JvmPluginInternal, net/mamoe/mirai/console/data/AutoSavePluginDataHolder, net/mamoe/mirai/console/plugin/jvm/JvmPlugin {
public fun <init> ()V
public fun <init> (Lkotlin/coroutines/CoroutineContext;)V
public synthetic fun <init> (Lkotlin/coroutines/CoroutineContext;ILkotlin/jvm/internal/DefaultConstructorMarker;)V
public fun <init> (Lnet/mamoe/mirai/console/plugin/jvm/JvmPluginDescription;)V
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,7 @@ public abstract class AbstractJvmPlugin : JvmPluginInternal, JvmPlugin, AutoSave
this.description = description
}

@JvmOverloads
public constructor(parentCoroutineContext: CoroutineContext = EmptyCoroutineContext) : super(parentCoroutineContext) {
this.description = javaClass.loadPluginDescriptionFromClassLoader()
}
Expand Down
10 changes: 10 additions & 0 deletions mirai-console/backend/mirai-console/src/plugin/jvm/JavaPlugin.kt
Original file line number Diff line number Diff line change
Expand Up @@ -19,12 +19,22 @@ import kotlin.coroutines.EmptyCoroutineContext
*/
public abstract class JavaPlugin : JvmPlugin, AbstractJvmPlugin {

/**
* 通过一个指定的 [JvmPluginDescription] 构造插件示例
*
* 当使用 `plugin.yml` 加载插件示例时不能使用此构造器
*/
@JvmOverloads
public constructor(
description: JvmPluginDescription,
parentCoroutineContext: CoroutineContext = EmptyCoroutineContext,
) : super(description, parentCoroutineContext)

/**
* 通过插件内置的 `plugin.yml` 构造插件实例
*
* @since 2.16.0
*/
@JvmOverloads
public constructor(
parentCoroutineContext: CoroutineContext = EmptyCoroutineContext,
Expand Down
11 changes: 11 additions & 0 deletions mirai-console/backend/mirai-console/src/plugin/jvm/KotlinPlugin.kt
Original file line number Diff line number Diff line change
Expand Up @@ -18,12 +18,23 @@ import kotlin.coroutines.EmptyCoroutineContext
* Kotlin 插件的父类.
*/
public abstract class KotlinPlugin : JvmPlugin, AbstractJvmPlugin {
/**
* 通过一个指定的 [JvmPluginDescription] 构造插件示例
*
* 当使用 `plugin.yml` 加载插件示例时不能使用此构造器
*/
@JvmOverloads
public constructor(
description: JvmPluginDescription,
parentCoroutineContext: CoroutineContext = EmptyCoroutineContext,
) : super(description, parentCoroutineContext)


/**
* 通过插件内置的 `plugin.yml` 构造插件实例
*
* @since 2.16.0
*/
@JvmOverloads
public constructor(
parentCoroutineContext: CoroutineContext = EmptyCoroutineContext,
Expand Down

0 comments on commit 9bb6af7

Please sign in to comment.