diff --git a/backend/mirai-console/src/main/kotlin/net/mamoe/mirai/console/plugin/jvm/AbstractJvmPlugin.kt b/backend/mirai-console/src/main/kotlin/net/mamoe/mirai/console/plugin/jvm/AbstractJvmPlugin.kt index ad910d908..ae6fc008a 100644 --- a/backend/mirai-console/src/main/kotlin/net/mamoe/mirai/console/plugin/jvm/AbstractJvmPlugin.kt +++ b/backend/mirai-console/src/main/kotlin/net/mamoe/mirai/console/plugin/jvm/AbstractJvmPlugin.kt @@ -13,8 +13,6 @@ package net.mamoe.mirai.console.plugin.jvm import net.mamoe.mirai.console.plugin.internal.JvmPluginInternal import net.mamoe.mirai.console.setting.Setting -import net.mamoe.mirai.console.setting.getValue -import net.mamoe.mirai.console.setting.value import kotlin.coroutines.CoroutineContext import kotlin.coroutines.EmptyCoroutineContext @@ -30,12 +28,4 @@ abstract class AbstractJvmPlugin @JvmOverloads constructor( final override val name: String get() = this.description.name override fun getSetting(clazz: Class): T = loader.settingStorage.load(this, clazz) -} - - -object MyPlugin : KotlinPlugin() - -object TestSetting : Setting by MyPlugin.getSetting() { - val account by value("123456") - val password by value("123") } \ No newline at end of file diff --git a/backend/mirai-console/src/main/kotlin/net/mamoe/mirai/console/setting/Setting.kt b/backend/mirai-console/src/main/kotlin/net/mamoe/mirai/console/setting/Setting.kt index 01f8ecb86..6557b1d72 100644 --- a/backend/mirai-console/src/main/kotlin/net/mamoe/mirai/console/setting/Setting.kt +++ b/backend/mirai-console/src/main/kotlin/net/mamoe/mirai/console/setting/Setting.kt @@ -55,6 +55,8 @@ interface Setting { // TODO: 2020/6/26 document val updaterSerializer: KSerializer + + fun onValueChanged(value: Value<*>) } //// region Setting_value_primitives CODEGEN //// diff --git a/backend/mirai-console/src/test/kotlin/net/mamoe/mirai/console/command/TestComposite.kt b/backend/mirai-console/src/test/kotlin/net/mamoe/mirai/console/command/TestComposite.kt index 133eb62db..2494c0de7 100644 --- a/backend/mirai-console/src/test/kotlin/net/mamoe/mirai/console/command/TestComposite.kt +++ b/backend/mirai-console/src/test/kotlin/net/mamoe/mirai/console/command/TestComposite.kt @@ -7,6 +7,8 @@ * https://github.com/mamoe/mirai/blob/master/LICENSE */ +@file:Suppress("unused") + package net.mamoe.mirai.console.command import net.mamoe.mirai.contact.Member