1
mirror of https://github.com/CarmJos/UltraDepository.git synced 2024-09-19 19:55:45 +00:00

启动时输出插件名

This commit is contained in:
Carm Jos 2021-12-29 23:36:21 +08:00
parent 8b3e0586a2
commit bc95c37476
3 changed files with 64 additions and 24 deletions

48
pom.xml
View File

@ -138,30 +138,30 @@
<useSystemClassLoader>false</useSystemClassLoader> <useSystemClassLoader>false</useSystemClassLoader>
</configuration> </configuration>
</plugin> </plugin>
<!-- <plugin>--> <plugin>
<!-- <groupId>org.apache.maven.plugins</groupId>--> <groupId>org.apache.maven.plugins</groupId>
<!-- <artifactId>maven-javadoc-plugin</artifactId>--> <artifactId>maven-javadoc-plugin</artifactId>
<!-- <version>3.2.0</version>--> <version>3.2.0</version>
<!-- <configuration>--> <configuration>
<!-- <classifier>javadoc</classifier>--> <classifier>javadoc</classifier>
<!-- <links>--> <links>
<!-- <link>https://javadoc.io/doc/org.jetbrains/annotations/</link>--> <link>https://javadoc.io/doc/org.jetbrains/annotations/</link>
<!-- </links>--> </links>
<!-- <detectJavaApiLink>false</detectJavaApiLink>--> <detectJavaApiLink>false</detectJavaApiLink>
<!-- <encoding>UTF-8</encoding>--> <encoding>UTF-8</encoding>
<!-- <charset>UTF-8</charset>--> <charset>UTF-8</charset>
<!-- <docencoding>UTF-8</docencoding>--> <docencoding>UTF-8</docencoding>
<!-- <locale>zh_CN</locale>--> <locale>zh_CN</locale>
<!-- </configuration>--> </configuration>
<!-- <executions>--> <executions>
<!-- <execution>--> <execution>
<!-- <id>attach-javadocs</id>--> <id>attach-javadocs</id>
<!-- <goals>--> <goals>
<!-- <goal>jar</goal>--> <goal>jar</goal>
<!-- </goals>--> </goals>
<!-- </execution>--> </execution>
<!-- </executions>--> </executions>
<!-- </plugin>--> </plugin>
<plugin> <plugin>
<groupId>org.apache.maven.plugins</groupId> <groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId> <artifactId>maven-compiler-plugin</artifactId>

View File

@ -41,6 +41,7 @@ public class Main extends JavaPlugin {
public void onEnable() { public void onEnable() {
instance = this; instance = this;
scheduler = new SchedulerUtils(this); scheduler = new SchedulerUtils(this);
outputPlugin();
log(getName() + " " + getDescription().getVersion() + " &7开始加载..."); log(getName() + " " + getDescription().getVersion() + " &7开始加载...");
long startTime = System.currentTimeMillis(); long startTime = System.currentTimeMillis();
@ -101,6 +102,7 @@ public class Main extends JavaPlugin {
@Override @Override
public void onDisable() { public void onDisable() {
if (!initialized) return; if (!initialized) return;
outputPlugin();
log(getName() + " " + getDescription().getVersion() + " 开始卸载..."); log(getName() + " " + getDescription().getVersion() + " 开始卸载...");
long startTime = System.currentTimeMillis(); long startTime = System.currentTimeMillis();
@ -174,4 +176,15 @@ public class Main extends JavaPlugin {
command.setExecutor(executor); command.setExecutor(executor);
if (tabCompleter != null) command.setTabCompleter(tabCompleter); if (tabCompleter != null) command.setTabCompleter(tabCompleter);
} }
public static void outputPlugin() {
log(" _ _ _ _ _____ _ _ ");
log("| | | | | | | __ \\ (_) | ");
log("| | | | | |_ _ __ __ _| | | | ___ _ __ ___ ___ _| |_ ___ _ __ _ _ ");
log("| | | | | __| '__/ _` | | | |/ _ \\ '_ \\ / _ \\/ __| | __/ _ \\| '__| | | |");
log("| |__| | | |_| | | (_| | |__| | __/ |_) | (_) \\__ \\ | || (_) | | | |_| |");
log(" \\____/|_|\\__|_| \\__,_|_____/ \\___| .__/ \\___/|___/_|\\__\\___/|_| \\__, |");
log(" | | __/ |");
log(" |_| |___/ ");
}
} }

View File

@ -0,0 +1,27 @@
import org.junit.Test;
public class PluginNameTest {
@Test
public void test() {
outputPlugin();
}
public static void outputPlugin() {
log(" _ _ _ _ _____ _ _ ");
log("| | | | | | | __ \\ (_) | ");
log("| | | | | |_ _ __ __ _| | | | ___ _ __ ___ ___ _| |_ ___ _ __ _ _ ");
log("| | | | | __| '__/ _` | | | |/ _ \\ '_ \\ / _ \\/ __| | __/ _ \\| '__| | | |");
log("| |__| | | |_| | | (_| | |__| | __/ |_) | (_) \\__ \\ | || (_) | | | |_| |");
log(" \\____/|_|\\__|_| \\__,_|_____/ \\___| .__/ \\___/|___/_|\\__\\___/|_| \\__, |");
log(" | | __/ |");
log(" |_| |___/ ");
}
private static void log(String s) {
System.out.println(s);
}
}