1
mirror of https://github.com/CarmJos/UltraDepository.git synced 2026-06-04 16:48:21 +08:00

启动时输出插件名

This commit is contained in:
2021-12-29 23:36:21 +08:00
parent 8b3e0586a2
commit bc95c37476
3 changed files with 64 additions and 24 deletions
@@ -41,6 +41,7 @@ public class Main extends JavaPlugin {
public void onEnable() {
instance = this;
scheduler = new SchedulerUtils(this);
outputPlugin();
log(getName() + " " + getDescription().getVersion() + " &7开始加载...");
long startTime = System.currentTimeMillis();
@@ -101,6 +102,7 @@ public class Main extends JavaPlugin {
@Override
public void onDisable() {
if (!initialized) return;
outputPlugin();
log(getName() + " " + getDescription().getVersion() + " 开始卸载...");
long startTime = System.currentTimeMillis();
@@ -174,4 +176,15 @@ public class Main extends JavaPlugin {
command.setExecutor(executor);
if (tabCompleter != null) command.setTabCompleter(tabCompleter);
}
public static void outputPlugin() {
log(" _ _ _ _ _____ _ _ ");
log("| | | | | | | __ \\ (_) | ");
log("| | | | | |_ _ __ __ _| | | | ___ _ __ ___ ___ _| |_ ___ _ __ _ _ ");
log("| | | | | __| '__/ _` | | | |/ _ \\ '_ \\ / _ \\/ __| | __/ _ \\| '__| | | |");
log("| |__| | | |_| | | (_| | |__| | __/ |_) | (_) \\__ \\ | || (_) | | | |_| |");
log(" \\____/|_|\\__|_| \\__,_|_____/ \\___| .__/ \\___/|___/_|\\__\\___/|_| \\__, |");
log(" | | __/ |");
log(" |_| |___/ ");
}
}
+27
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);
}
}