plugin supporting

This commit is contained in:
jiahua.liu 2020-01-18 17:29:46 +08:00
parent ead002d27f
commit d67a858548
6 changed files with 50 additions and 1 deletions

View File

@ -74,7 +74,9 @@ class PluginDescription(
lowercaseLine.startsWith("info") || lowercaseLine.startsWith("information") -> {
info = line.substringAfter(":").trim()
}
lowercaseLine.startsWith("path") || lowercaseLine.startsWith("basepath") -> {
lowercaseLine.startsWith("main") || lowercaseLine.startsWith("path") || lowercaseLine.startsWith(
"basepath"
) -> {
basePath = line.substringAfter(":").trim()
}
lowercaseLine.startsWith("version") || lowercaseLine.startsWith("ver") -> {

View File

@ -0,0 +1,15 @@
<?xml version="1.0" encoding="UTF-8"?>
<module type="JAVA_MODULE" version="4">
<component name="NewModuleRootManager" inherit-compiler-output="true">
<exclude-output />
<content url="file://$MODULE_DIR$">
<sourceFolder url="file://$MODULE_DIR$/resources" type="java-resource" />
<sourceFolder url="file://$MODULE_DIR$/src/main/java" isTestSource="false" />
<sourceFolder url="file://$MODULE_DIR$/src/main/resources" type="java-resource" />
</content>
<orderEntry type="inheritedJdk" />
<orderEntry type="sourceFolder" forTests="false" />
<orderEntry type="library" name="KotlinJavaRuntime (3)" level="project" />
<orderEntry type="module" module-name="mirai-console_main" />
</component>
</module>

View File

@ -0,0 +1,15 @@
package net.mamoe.mirai.imageplugin;
import net.mamoe.mirai.plugin.PluginBase;
public class ImagePluginMain extends PluginBase {
@Override
public void onLoad() {
System.out.println("Loaded");
}
@Override
public void onEnable() {
System.out.println("Enabled");
}
}

View File

@ -0,0 +1,5 @@
name: ImageSender
main: net.mamoe.mirai.imageplugin.ImagePluginMain
version: 1.0.0
author: mamoe
info: a demo plugin of mirai

View File

@ -0,0 +1,12 @@
<?xml version="1.0" encoding="UTF-8"?>
<module type="JAVA_MODULE" version="4">
<component name="NewModuleRootManager" inherit-compiler-output="true">
<exclude-output />
<content url="file://$MODULE_DIR$">
<sourceFolder url="file://$MODULE_DIR$/src" isTestSource="false" />
</content>
<orderEntry type="inheritedJdk" />
<orderEntry type="sourceFolder" forTests="false" />
<orderEntry type="library" name="KotlinJavaRuntime" level="project" />
</component>
</module>