diff --git a/core-velocity/src/main/java/cn/hamster3/mc/plugin/core/velocity/HamsterCorePlugin.java b/core-velocity/src/main/java/cn/hamster3/mc/plugin/core/velocity/HamsterCorePlugin.java index f836851..0c8fe41 100644 --- a/core-velocity/src/main/java/cn/hamster3/mc/plugin/core/velocity/HamsterCorePlugin.java +++ b/core-velocity/src/main/java/cn/hamster3/mc/plugin/core/velocity/HamsterCorePlugin.java @@ -3,6 +3,7 @@ package cn.hamster3.mc.plugin.core.velocity; import cn.hamster3.mc.plugin.core.common.api.CoreAPI; import cn.hamster3.mc.plugin.core.velocity.api.CoreVelocityAPI; import com.google.inject.Inject; +import com.velocitypowered.api.event.PostOrder; import com.velocitypowered.api.event.Subscribe; import com.velocitypowered.api.event.proxy.ProxyInitializeEvent; import com.velocitypowered.api.event.proxy.ProxyShutdownEvent; @@ -67,18 +68,16 @@ public class HamsterCorePlugin { slf4jLogger.info("HamsterCore 初始化完成,总计耗时 " + time + " ms"); } - @Subscribe + @Subscribe(order = PostOrder.FIRST) public void onProxyInitialization(ProxyInitializeEvent event) { long start = System.currentTimeMillis(); slf4jLogger.info("仓鼠核心正在启动"); -// CoreMessage.init(getLogger(), new File(dataFolder, "messages.yml")); -// logger.info("已初始化语言文本"); long time = System.currentTimeMillis() - start; slf4jLogger.info("仓鼠核心启动完成,总计耗时 " + time + " ms"); } - @Subscribe - public void onProxyInitialization(ProxyShutdownEvent event) { + @Subscribe(order = PostOrder.LAST) + public void onProxyShutdown(ProxyShutdownEvent event) { long start = System.currentTimeMillis(); CoreAPI.getInstance().getJedisPool().close(); slf4jLogger.info("已关闭 Redis 连接池");