refactor: 将 PlaceholderAPI 初始化逻辑移至服务器启动后执行
Some checks failed
Publish Project / build (push) Failing after 3m47s
Some checks failed
Publish Project / build (push) Failing after 3m47s
This commit is contained in:
@@ -6,7 +6,7 @@ plugins {
|
||||
}
|
||||
|
||||
group = "cn.hamster3.mc.plugin"
|
||||
version = "3.1.3-SNAPSHOT"
|
||||
version = "3.1.4-SNAPSHOT"
|
||||
|
||||
repositories {
|
||||
maven("https://maven.airgame.net/maven-public/")
|
||||
|
||||
@@ -54,14 +54,6 @@ public class CurrencyPlugin extends JavaPlugin {
|
||||
} catch (SQLException e) {
|
||||
error(e);
|
||||
}
|
||||
if (Bukkit.getPluginManager().isPluginEnabled("PlaceholderAPI")) {
|
||||
logger.info("检测到 PlaceholderAPI 已安装");
|
||||
if (PlaceholderHook.INSTANCE.register()) {
|
||||
logger.info("已挂载 PlaceholderAPI 变量");
|
||||
}
|
||||
} else {
|
||||
logger.info("未检测到 PlaceholderAPI");
|
||||
}
|
||||
long time = System.currentTimeMillis() - start;
|
||||
logger.info("仓鼠经济初始化完成,总计耗时 " + time + " ms");
|
||||
}
|
||||
@@ -87,6 +79,16 @@ public class CurrencyPlugin extends JavaPlugin {
|
||||
} else {
|
||||
logger.info("不进行 Vault 经济系统注册");
|
||||
}
|
||||
sync(() -> {
|
||||
if (Bukkit.getPluginManager().isPluginEnabled("PlaceholderAPI")) {
|
||||
logger.info("检测到 PlaceholderAPI 已安装");
|
||||
if (PlaceholderHook.INSTANCE.register()) {
|
||||
logger.info("已挂载 PlaceholderAPI 变量");
|
||||
}
|
||||
} else {
|
||||
logger.info("未检测到 PlaceholderAPI");
|
||||
}
|
||||
});
|
||||
long time = System.currentTimeMillis() - start;
|
||||
logger.info("仓鼠经济启动完成,总计耗时 " + time + " ms");
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user