@@ -8,32 +8,22 @@ import net.mamoe.mirai.console.data.*
8
8
import net.mamoe.mirai.console.extension.*
9
9
import net.mamoe.mirai.console.plugin.jvm.*
10
10
import net.mamoe.mirai.event.*
11
- import net.mamoe.mirai.utils.*
12
11
import xyz.cssxsh.arknights.*
13
12
import kotlin.collections.*
14
13
15
14
public object ArknightsHelperPlugin : KotlinPlugin(
16
- JvmPluginDescription ("xyz.cssxsh.mirai.plugin.arknights-helper", "2.1.2 ") {
15
+ JvmPluginDescription ("xyz.cssxsh.mirai.plugin.arknights-helper", "2.1.3 ") {
17
16
name("arknights-helper")
18
17
author("cssxsh")
19
18
20
19
dependsOn("xyz.cssxsh.mirai.plugin.meme-helper", true)
21
20
}
22
21
) {
23
22
24
- private val commands: List <Command > by spi()
25
- private val config: List <PluginConfig > by spi()
26
- private val data: List <PluginData > by spi()
27
- private val listeners: List <ListenerHost > by spi()
28
-
29
- @Suppress(" INVISIBLE_MEMBER" )
30
- private inline fun <reified T : Any > spi (): Lazy <List <T >> = lazy {
31
- with (net.mamoe.mirai.console.internal.util.PluginServiceHelper ) {
32
- jvmPluginClasspath.pluginClassLoader
33
- .findServices<T >()
34
- .loadAllServices()
35
- }
36
- }
23
+ private val commands: List <Command > by services()
24
+ private val config: List <PluginConfig > by services()
25
+ private val data: List <PluginData > by services()
26
+ private val listeners: List <ListenerHost > by services()
37
27
38
28
init {
39
29
System .setProperty(IGNORE_UNKNOWN_KEYS , " true" )
0 commit comments